ncappc is a flexible tool, to
perform a traditional NCA
perform simulation-based posterior predictive checks for a population PK model using NCA metrics.
Usage
ncappc(
obsFile = "nca_original.npctab.dta",
simFile = "nca_simulation.1.npctab.dta.zip",
str1Nm = NULL,
str1 = NULL,
str2Nm = NULL,
str2 = NULL,
str3Nm = NULL,
str3 = NULL,
concUnit = NULL,
timeUnit = NULL,
doseUnit = NULL,
obsLog = FALSE,
simLog = obsLog,
psnOut = TRUE,
idNmObs = "ID",
timeNmObs = "TIME",
concNmObs = "DV",
idNmSim = idNmObs,
timeNmSim = timeNmObs,
concNmSim = concNmObs,
onlyNCA = FALSE,
AUCTimeRange = NULL,
backExtrp = FALSE,
LambdaTimeRange = NULL,
LambdaExclude = NULL,
doseAmtNm = NULL,
adminType = "extravascular",
doseType = "ns",
doseTime = NULL,
Tau = NULL,
TI = NULL,
method = "linearup-logdown",
blqNm = NULL,
blqExcl = 1,
evid = TRUE,
evidIncl = 0,
mdv = FALSE,
filterNm = NULL,
filterExcl = NULL,
negConcExcl = FALSE,
param = c("AUClast", "Cmax"),
timeFormat = "number",
dateColNm = NULL,
dateFormat = NULL,
spread = "npi",
tabCol = c("AUClast", "Cmax", "Tmax", "AUCINF_obs", "Vz_obs", "Cl_obs", "HL_Lambda_z"),
figFormat = "tiff",
noPlot = FALSE,
printOut = TRUE,
studyName = NULL,
new_data_method = TRUE,
overwrite_SIMDATA = NULL,
overwrite_sim_est_file = NULL,
outFileNm = NULL,
out_format = "html",
gg_theme = theme_bw(),
parallel = FALSE,
extrapolate = FALSE,
timing = FALSE,
...
)
Arguments
- obsFile
Observed concentration-time data from an internal data frame or an external table with comma, tab or space as separators.
- simFile
NONMEM simulation output with the simulated concentration-time data from an internal data frame or an external table.
NULL
produces just the NCA output, a filename or data frame produces the NCA output as well as the PopPK diagnosis. Ifnew_data_method=TRUE
then this can be a compressed file as well.- str1Nm
Column name for 1st level population stratifier. Default is
NULL
- str1
Stratification ID of the members within 1st level stratification (e.g c(1,2)). Default is
NULL
- str2Nm
Column name for 2nd level population stratifier. Default is
NULL
- str2
Stratification ID of the members within 2nd level stratification (e.g c(1,2)). Default is
NULL
- str3Nm
Column name for 3rd level population stratifier. Default is
NULL
- str3
Stratification ID of the members within 3rd level stratification (e.g c(1,2)). Default is
NULL
- concUnit
Unit of concentration (e.g. "ng/mL"). Default is
NULL
- timeUnit
Unit of time (e.g. "h"). Default is
NULL
- doseUnit
Unit of dose amount (e.g. "ng"). Default is
NULL
- obsLog
If
TRUE
concentration in observed data is in logarithmic scale. Default isFALSE
- simLog
If
TRUE
concentration in simulated data is in logarithmic scale. Default isFALSE
- psnOut
If
TRUE
observed data is an output from PsN or in NONMEM output format. Default isTRUE
- idNmObs
Column name for ID in observed data. Default is "ID"
- timeNmObs
Column name for time in observed data. Default is "TIME"
- concNmObs
Column name for concentration in observed data. Default is "DV"
- idNmSim
Column name for ID in simulated data. Default is "ID"
- timeNmSim
Column name for time in simulated data. Default is "TIME"
- concNmSim
Column name for concentration in simulated data. Default is "DV"
- onlyNCA
If
TRUE
only NCA is performed and ppc part is ignored although simFile is notNULL
. Default isFALSE
- AUCTimeRange
User-defined window of time used to estimate AUC. Default is
NULL
- backExtrp
If
TRUE
back-extrapolation is performed while estimating AUC. Default isFALSE
- LambdaTimeRange
User-defined window of time to estimate elimination rate-constant. This argument lets the user to choose a specific window of time to be used to estimate the elimination rate constant (Lambda) in the elimination phase. The accepted format for the input to this argument is a numeric array of two elements;
c(14,24)
will estimate the Lambda using the data within the time units 14 to 24. Default isNULL
- LambdaExclude
User-defined excluded observation time points for estimation of Lambda. This can be numeric value or logical condition (e.g. c(1, 2, "<20", ">=100", "!=100")). Default is
NULL
- doseAmtNm
Column name to specify dose amount. Default is
NULL
- adminType
Route of administration. Allowed options are iv-bolus, iv-infusion or extravascular. Default is "extravascular"
- doseType
Steady-state (ss) or non-steady-state (ns) dose. Default is "ns"
- doseTime
Dose time prior to the first observation for steady-state data. Default is
NULL
- Tau
Dosing interval for steady-state data. Default is
NULL
- TI
Infusion duration. If TI is a single numeric value, TI is the same for all individuals. If TI is the name of a column with numeric data present in the data set, TI is set to the unique value of the column for a given individual. Default is
NULL
- method
Method to estimate AUC.
linear
method applies the linear trapezoidal rule to estimate the area under the curve.log
method applies the logarithmic trapezoidal rule to estimate the area under the curve.linearup-logdown
method applies the linear trapezoidal rule to estimate the area under the curve for the ascending part of the curve and the logarithmic trapezoidal rule to estimate the area under the curve for the descending part of the curve. Default is "linearup-logdown"- blqNm
Name of BLQ column if used to exclude data. Default is
NULL
- blqExcl
Excluded BLQ value; either a numeric value or a logical condition (e.g. 1 or ">=1" or c(1,">3")). Used only if the
blqNm
is notNULL
. Default is "1"- evid
If
TRUE
EVID is used to filter data. Default isTRUE
- evidIncl
Included values in EVID. Default is "0"
- mdv
If
TRUE
MDV is used to include data when MDV=0. Default isFALSE
- filterNm
Column name to filter data. Default is
NULL
- filterExcl
Row exclusion criteria based on the column defined by
filterNm
. This can be numeric value or logical condition (e.g. c(1, 2, "<20", ">=100", "!=100")). Default isNULL
- negConcExcl
If
TRUE
negative concentrations are excluded. Default isFALSE
- param
NCA parameters (AUClast, AUClower_upper, AUCINF_obs, AUCINF_pred, AUMClast, Cmax, Tmax, HL_Lambda_z). Default is (c"AUClast", "Cmax")
- timeFormat
time format (number, H:M, H:M:S). Default is "number"
- dateColNm
column name for date if used (e.g. "Date", "DATE"). Default is
NULL
- dateFormat
date format (D-M-Y, D/M/Y or any other combination of D,M,Y). Default is
NULL
- spread
Measure of the spread of simulated data (
"ppi"
(95% parametric prediction interval) or"npi"
(95% nonparametric prediction interval)). Default is "npi"- tabCol
Output columns to be printed in the report in addition to ID, dose and population strata information (list of NCA metrics in a string array). Default is c("AUClast", "Cmax", "Tmax", "AUCINF_obs", "Vz_obs", "Cl_obs", "HL_Lambda_z")
- figFormat
format of the produced figures (bmp, jpeg, tiff, png). Default is "tiff"
- noPlot
If
TRUE
only NCA calculations are performed without any plot generation. Default isFALSE
- printOut
If
TRUE
tabular and graphical outputs are saved on the disk. Default isTRUE
- studyName
Name of the study to be added as a description in the report. Default is
NULL
- new_data_method
If
TRUE
a faster method of reading data is tested. Default isTRUE
- overwrite_SIMDATA
If
TRUE
new information is created in the SIMDATA directory. IfFALSE
the information in the SIMDATA directory is used. IfNULL
a dialog will come up to ask the user what to do. Default isNULL
- overwrite_sim_est_file
If
TRUE
The NCA metrics are created again based on the simulation data. IfFALSE
the information in the ncaSimEst file is used. IfNULL
a dialog will come up to ask the user what to do. Default isNULL
- outFileNm
Additional tag to the name of the output html and pdf output file hyphenated to the standard ncappc report file name standard ncappc report file name. Default is
NULL
- out_format
What type of output format should the NCA report have? Pass "all" to render all formats defined within the rmarkdown file. Pass "first" to render the first format defined within the rmarkdown file. Pass "html" to render in HTML. Pass "pdf" to render in PDF.
- gg_theme
Which ggplot theme should be used for the plots?
- parallel
Should the nca computations for the simulated data be run in parallel? See
start_parallel
for a description and additional arguments that can be added to this function and passed tostart_parallel
.- extrapolate
Should the NCA calculations extrapolate from the last observation to infinity?
- timing
Should timings of calculations be reported to the screen?
- ...
Additional arguments passed to other functions, including
start_parallel
.
Details
Non-compartmental analysis (NCA) calculates pharmacokinetic (PK) metrics related to the systemic exposure to a drug following administration, e.g. area under the concentration-time curve and peak concentration. ncappc performs a traditional NCA using the observed plasma concentration-time data. In the presence of simulated plasma concentration-time data, ncappc also performs simulation-based posterior predictive checks (ppc) using NCA metrics for the corresponding population PK (PopPK) model used to generate the simulated data. The diagnostic analysis is performed at the population as well as the individual level. The distribution of the simulated population means of each NCA metric is compared with the corresponding observed population mean. The individual level comparison is performed based on the deviation of the mean of any NCA metric based on simulations for an individual from the corresponding NCA metric obtained from the observed data. Additionally, ncappc reports the normalized prediction distribution error (NPDE) of the simulated NCA metrics for each individual and their distribution within a population. ncappc produces two default outputs depending on the type of analysis performed, i.e., traditional NCA and PopPK diagnosis. The PopPK diagnosis feature of ncappc produces 7 sets of graphical outputs to assess the ability of a population model to simulate the concentration-time profile of a drug and thereby identify model misspecification. In addition, tabular outputs are generated showing the values of the NCA metrics estimated from the observed and the simulated data, along with the deviation, NPDE, regression parameters used to estimate the elimination rate constant and the related population statistics. The default values of the arguments used in ncappc are shown in the Usage section of this document and/or in bold in the Arguments section.
Examples
out <- ncappc(obsFile=system.file("extdata","pkdata.csv",package="ncappc"),
onlyNCA = TRUE,
extrapolate = TRUE,
printOut = FALSE,
evid = FALSE,
psnOut=FALSE)
data_1 <- data.frame(
ID=1,
TIME = c(0,0.25,0.5,1,1.5,2,3,4,6,8,12,16,24),
DV=c(0, 0.07, 0.14, 0.21, 0.24, 0.27, 0.26, 0.25, 0.22, 0.19, 0.13, 0.081, 0.033)
)
out_1 <- ncappc(obsFile=data_1,
onlyNCA = TRUE,
extrapolate = TRUE,
printOut = FALSE,
evid = FALSE,
timing=TRUE)
#> Time taken to estimate NCA parameters on observed data: 0.025 seconds.
data_2 <- dplyr::filter(data_1,TIME>17|TIME<3)
out_2 <- ncappc(obsFile=data_2,
onlyNCA = TRUE,
extrapolate = TRUE,
printOut = FALSE,
evid = FALSE,
force_extrapolate=TRUE)