force_find_lambdaz: Forceful estimation of terminal slope
Description
Estimates the terminal elimination rate constant (lambda_z) of a pharmacokinetic
profile. The function first attempts to use the find_best_lambdaz method. If no
valid estimate is obtained, it falls back to a simplified log-linear regression
using progressively fewer data points to enforce a negative slope.
intercept: Intercept of the log-linear regression, used to extrapolate concentration at time zero
method: Method used (find_best_lambdaz or fallback regression)
UsedPoints: Number of time-concentration points used for estimation
adj.r.squared: Adjusted R-squared (available only when using find_best_lambdaz)
message: Diagnostic message summarizing the outcome
slopefit: Fitted linear model object
Arguments
time
Numeric vector of time points.
conc
Numeric vector of concentration values corresponding to time.
...
Additional arguments passed to find_best_lambdaz (e.g., nlastpoints).
Author
Zhonghui Huang
Details
This function implements a two-step strategy to ensure estimation of the
terminal elimination slope:
First, it applies find_best_lambdaz to automatically select the best
fitting terminal phase segment based on adjusted R-squared optimization.
If find_best_lambdaz fails (e.g., limited data), the function forcibly
fits simplified linear models using progressively fewer points (starting
from n-1 down to 2) until a negative slope is identified. In fallback
mode, adjusted R-squared is not considered.