BestSlope.Rd
It sequentially fits (log(y) ~ x) from the last point of x to the previous points with at least 3 points. It chooses a slope the highest adjusted R-square. If the difference is less then 1e-4, it pickes longer slope.
BestSlope(x, y, adm = "Extravascular", TOL=1e-4, excludeDelta = 1)
vector values of x-axis, usually time
vector values of y-axis, usually concentration
one of "Bolus"
or "Infusion"
or "Extravascular"
to indicate drug administration mode
tolerance. See Phoneix WinNonlin 6.4 User's Guide p33 for the detail.
Improvement of R2ADJ larger than this value could exclude the last point. Default value 1 is for the compatibility with other software.
Choosing the best terminal slope (y in log scale) in pharmacokinetic analysis is somewhat challenging, and it could vary by analysis performer.
Pheonix WinNonlin chooses a slope with highest adjusted R-squared and the longest one. The difference of adjusted R-Squared less than TOL considered to be 0.
This function uses ordinary least square method (OLS). Author recommends to use excludeDelta
option with about 0.3.
R-squared
adjusted R-squared
number of points used for slope
negative of the slope, lambda_z
intercept of the regression line
correlation of log(y) and x
earliest x for lambda_z
last x for lambda_z
predicted y value at the last point, predicted concentration for the last time point
BestSlope(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"])
#> R2 R2ADJ LAMZNPT LAMZ b0 CORRXY LAMZLL
#> 0.9999997 0.9999995 3.0000000 0.0484570 2.3687851 -0.9999999 9.0500000
#> LAMZUL CLSTP
#> 24.3700000 3.2801465
#> attr(,"UsedPoints")
#> [1] 9 10 11
BestSlope(Indometh[Indometh$Subject==1, "time"], Indometh[Indometh$Subject==1, "conc"],
adm="Bolus")
#> R2 R2ADJ LAMZNPT LAMZ b0 CORRXY
#> 0.99706673 0.99413345 3.00000000 0.15832048 -1.72421060 -0.99853229
#> LAMZLL LAMZUL CLSTP
#> 5.00000000 8.00000000 0.05024851
#> attr(,"UsedPoints")
#> [1] 9 10 11