R/BestSlope.R

Defines functions BestSlope

Documented in BestSlope

BestSlope = function(x, y, adm="Extravascular", TOL=1e-4)
{
# Author: Kyun-Seop Bae k@acr.kr
# Automatic terminal-slope (lambda z) selection by the maximum adjusted R-squared
# criterion. Delegates to NonCompart::BestSlope for a single maintained engine.
# INPUT
#    x: time
#    y: concentration (original scale, not logged)
#    adm: administration method, "Extravascular", "Bolus", or "Infusion"
#    TOL: tolerance for adjusted R-squared comparison
# RETURNS
#    named vector: R2, R2ADJ, LAMZNPT, LAMZ, b0, CORRXY, LAMZLL, LAMZUL, CLSTP
  return(NonCompart::BestSlope(x, y, adm=adm, TOL=TOL))
}

Try the pkr package in your browser

Any scripts or data that you put into this service are public.

pkr documentation built on July 30, 2026, 5:08 p.m.