Learn R Programming

qpNCA (version 1.1.6)

est.thalf: Calculate Lambda_z and Elimination Half-life

Description

Calculates lambda_z and thalf for each PK curve identified using by.

Usage

est.thalf(
  x,
  by = character(0),
  timevar = "time",
  depvar = "dv",
  includeCmax = "Y",
  exclvar = NA
)

Arguments

x

a dataset

by

column names in x indicating grouping variables

timevar

variable name containing the actual sampling time after dose

depvar

variable name containing the dependent variable (e.g., concentration)

includeCmax

include results of regression including Cmax in selection? (y/n); x$includeCmax overrides if provided

exclvar

a variable name containing information about points to be excluded (these should have exclvar = 1)

Value

a dataset with estimates for each regression analysis in one observation. The following parameters are available.

  • no.points number of data points used in the regression analysis

  • intercept estimated intercept

  • lambda_z -1*estimated slope

  • r.squared square of the correlation coefficient

  • adj.r.squared adjusted square of the correlation coefficient

  • thalf elimination half-life

  • start_th time of first sample included in the thalf estimation

  • end_th time of last sample included in the thalf estimation

  • includeCmax include results of regression including Cmax in selection? (y/n)

  • points_excluded are time points excluded from the half-life estimation? (y/n)

Details

The function starts with the last three sample points and performs log-linear regression on it. It then adds one sampling point at a time (including and ending at tmax) and performs the regression again. The results of the regression with the highest adjusted R-squared are returned.

Visual outliers can be excluded from the regression analysis.

Examples

Run this code
# NOT RUN {
example(correct.loq)
x %<>% mutate(includeCmax = 'Y')
th <- x %>% est.thalf(by='subject',exclvar=)
th %>%  head
# }

Run the code above in your browser using DataLab