qpNCA {qpNCA} | R Documentation |
Perform Non-compartmental Analysis
Description
Consecutively executes the following NCA steps:
-
correct.loq impute LOQ values
-
est.thalf calculate lambda_z and half-life
-
plot_reg plot each regression curve
-
calc.ctmax calculate Cmax and Tmax
-
correct.time correct time deviations at critical time points
-
correct.conc impute missing concentrations at critical time points
-
tab.corr tabulate data alterations
-
calc.par calculates parameters not dependent on lambda_z
-
calc.par.th calculates parameters dependent on lambda_z
Usage
qpNCA(
x,
by = character(0),
nomtimevar = "ntad",
timevar = "time",
depvar = "dv",
bloqvar = "bloq",
loqvar = "loq",
loqrule = 1,
includeCmax = "Y",
exclvar = NA,
plotdir = NA,
timelab = "timevar",
deplab = "depvar",
tau = NA,
tstart = NA,
tend = NA,
teval = NA,
covariates = NA,
dose = "dose",
factor = 1,
reg = "SD",
ss = "N",
route = "EV",
method = 1
)
Arguments
x |
input dataset name |
by |
column names in x indicating grouping variables |
nomtimevar |
variable name containing the nominal sampling time after dose |
timevar |
variable name containing the actual sampling time after dose |
depvar |
variable name containing the dependent variable (e.g., concentration) |
bloqvar |
variable name containing the BLOQ flag (0: no, 1: yes) |
loqvar |
variable name containing the LOQ value |
loqrule |
rule number to be applied to the LOQ values in the curve; x$loqrule overrides if provided |
includeCmax |
include Cmax in half-life estimation? (y/n); x$includeCmax overrides if provided |
exclvar |
variable name indicating points to be excluded in half-life estimation (these should have exclvar = 1) |
plotdir |
directory where regression plots (.PNG) will be saved; NA gives default location, NULL skips regression plots |
timelab |
label for time axis in regression plots |
deplab |
label for dependent variable axis in regression plots |
tau |
dosing interval (for multiple dosing); NA (default) if single dose; x$tau overrides |
tstart |
start time of partial AUC (start>0); NA (default) if not requested; x$tstart overrides |
tend |
end time of partial AUC; NA (default) if not requested; x$tend overrides |
teval |
user selected AUC interval (starting at t=0); NA (default) if not requested; x$teval overrides |
covariates |
covariates dataset; Must contain the dose variable |
dose |
variable containing the dose amount |
factor |
conversion factor for CL and V calculation (e.g. dose in mg, conc in ng/mL, factor=1000); x$factor overrides if provided |
reg |
regimen, "SD" or "MD"; x$reg overrides if provided |
ss |
is steady state reached (y/n); x$ss overrides if provided |
route |
route of drug administration ("EV","IVB", "IVI"); x$route overrides if provided |
method |
method for trapezoidal rule; x$method overrides if provided
|
Value
(list)
-
covariates covariates selected with the
covariates
argument -
half_life linear regression parameters
-
ct_corr the time and concentration corrected dataset
-
corrections descriptions of the corrections applied
-
pkpar all estimated PK parameters
-
plots generated plots
Examples
library(magrittr)
library(dplyr)
library(qpNCA)
x <- Theoph
ntad <- c(0,0.25,0.5,1,2,4,5,7,9,12,24)
for(i in 1:nrow(x)){
time <- x$Time[[i]]
delta <- abs(ntad - time)
best <- min(delta)
index <- match(best, delta)
nom <- ntad[[index]]
x$ntad[[i]] <- nom
}
rm(list = c('time','delta','best','index','nom', 'i','ntad'))
x %<>% rename(time = Time, dv = conc, subject = Subject)
x %<>% mutate(bloq = 0, loq = 0.01, tad = time,excl_th=0,
subject=as.numeric(subject),ntad=as.numeric(ntad))
x %<>% filter(dv > 0)
covs <- x %>%
select(subject, Wt, dose = Dose) %>%
distinct(subject,.keep_all=TRUE) %>%
mutate(dose = dose * Wt) # see ?Theoph
z <- qpNCA(x, by = 'subject', covariates = covs, exclvar='excl_th')