| Version: | 0.1.6 |
| Date: | 2026-07-30 |
| Title: | Pharmacokinetics in R |
| Description: | Conduct a noncompartmental analysis as closely as possible to the most widely used commercial software. The core noncompartmental computations are delegated to the 'NonCompart' package so that the two share a single, maintained engine. Some features are 1) CDISC SDTM terms 2) Automatic slope selection with the same criterion of WinNonlin(R), restricted by default to samples after the end of an infusion 3) Supporting both 'linear-up linear-down' and 'linear-up log-down' method 4) Interval(partial) AUCs with 'linear' or 'log' interpolation method * Reference: Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts and Applications. 5th ed. 2016. (ISBN:9198299107). |
| Depends: | R (≥ 3.6.0) |
| Imports: | NonCompart (≥ 0.8.2), foreign, grDevices, graphics, grid, stats, utils |
| Suggests: | binr, forestplot, rtf |
| Copyright: | 2017-, Kyun-Seop Bae, Jee Eun Lee |
| License: | GPL-3 |
| NeedsCompilation: | no |
| URL: | https://cran.r-project.org/package=pkr |
| Packaged: | 2026-07-30 01:06:04 UTC; Kyun-SeopBae |
| Author: | Kyun-Seop Bae [aut, cre], Jee Eun Lee [aut] |
| Maintainer: | Kyun-Seop Bae <k@acr.kr> |
| Repository: | CRAN |
| Date/Publication: | 2026-07-30 11:30:08 UTC |
Pharmacokinetics in R
Description
It conducts a noncompartmental analysis(NCA) as closely as possible to the most widely used commercial pharmacokinetic analysis software.
Details
The main functions are
NCA to perform NCA for many subjects. IndiNCA to perform NCA for one subject.
Author(s)
Kyun-Seop Bae <k@acr.kr>, Jee Eun Lee <JeeEun.Lee@fda.hhs.gov>
References
Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts and Applications. 5th ed. 2016.
Shargel L, Yu A. Applied Biopharmaceutics and Pharmacokinetics. 7th ed. 2015.
Rowland M, Tozer TN. Clinical Pharmacokinetics and Pharmacodynamics - Concepts and Applications. 4th ed. 2011.
Gibaldi M, Perrier D. Pharmacokinetics. 2nd ed. revised and expanded. 1982.
Examples
# Theoph and Indometh data: dose in mg, conc in mg/L, time in h
NCA(Theoph, "Subject", "Time", "conc", dose=320, uConc="mg/L")
NCA(Indometh, "Subject", "time", "conc", dose=25, adm="Bolus", uConc="mg/L")
iAUC = data.frame(Name=c("AUC[0-12h]","AUC[0-24h]"), Start=c(0,0), End=c(12,24)) ; iAUC
NCA(Theoph, "Subject", "Time", "conc", dose=320, iAUC=iAUC, uConc="mg/L")
NCA(Indometh, "Subject", "time", "conc", dose=25, adm="Bolus", iAUC=iAUC, uConc="mg/L")
# writeLines(NCA(Theoph, "Subject", "Time", "conc", dose=320, report="Text", uConc="mg/L"),
# "Theoph_Linear_CoreOutput.txt")
# writeLines(NCA(Theoph, "Subject", "Time", "conc", dose=320, fit="Log", report="Text",
# uConc="mg/L"), "Theoph_Log_CoreOutput.txt")
# writeLines(NCA(Indometh, "Subject", "time", "conc", dose=25, adm="Bolus", report="Text",
# uConc="mg/L"), "Indometh_Bolus_Linear_CoreOutput.txt")
# writeLines(NCA(Indometh, "Subject", "time", "conc", dose=25, adm="Bolus", fit="Log",
# report="Text", uConc="mg/L"), "Indometh_Bolus_Log_CoreOutput.txt")
# writeLines(NCA(Indometh, "Subject", "time", "conc", dose=25, adm="Infusion", dur=0.25,
# report="Text", uConc="mg/L"), "Indometh_Infusion_Linear_CoreOutput.txt")
# writeLines(NCA(Indometh, "Subject", "time", "conc", dose=25, adm="Infusion", dur=0.25,
# fit="Log", report="Text", uConc="mg/L"), "Indometh_Infusion_Log_CoreOutput.txt")
sNCA(Theoph[Theoph$Subject==1,"Time"], Theoph[Theoph$Subject==1, "conc"], dose=320, concUnit="mg/L")
sNCA(Indometh[Indometh$Subject==1,"time"], Indometh[Indometh$Subject==1, "conc"], dose=25,
adm="Bolus", concUnit="mg/L")
sNCA(Indometh[Indometh$Subject==1,"time"], Indometh[Indometh$Subject==1, "conc"], dose=25,
adm="Infusion", dur=0.25, concUnit="mg/L")
iAUC = data.frame(Name=c("AUC[0-12h]","AUC[0-24h]"), Start=c(0,0), End=c(12,24)) ; iAUC
sNCA(Theoph[Theoph$Subject==1,"Time"], Theoph[Theoph$Subject==1, "conc"], dose=320,
iAUC=iAUC, concUnit="mg/L")
sNCA(Indometh[Indometh$Subject==1,"time"], Indometh[Indometh$Subject==1, "conc"], dose=25,
adm="Bolus", iAUC=iAUC, concUnit="mg/L")
sNCA(Indometh[Indometh$Subject==1,"time"], Indometh[Indometh$Subject==1, "conc"], dose=25,
adm="Infusion", dur=0.25, iAUC=iAUC, concUnit="mg/L")
Calculate Area Under the Curve (AUC) and Area Under the first Moment Curve (AUMC) in a table format
Description
Calculate Area Under the Curve(AUC) and the first Moment Curve(AUMC) in two ways; 'linear trapezoidal method' or 'linear-up and log-down' method. Return a table of cumulative values.
Usage
AUC(x, y, down = "Linear")
Arguments
x |
vector values of independent variable, usually time |
y |
vector values of dependent variable, usually concentration |
down |
either of |
Details
down="Linear" means linear trapezoidal rule with linear interpolation.
down="Log" means linear-up and log-down method.
Value
Table with two columns, AUC and AUMC; the first column values are cumulative AUCs and the second column values cumulative AUMCs.
Author(s)
Kyun-Seop Bae <k@acr.kr>
References
Rowland M, Tozer TN. Clinical Pharmacokinetics and Pharmacodynamics - Concepts and Applications. 4th ed. pp687-689. 2011.
See Also
Examples
AUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"])
AUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"], down="Log")
Internal Functions
Description
Internal functions
Details
These are not to be called by the user.
Choose best fit slope for the log(y) and x regression by the criteria of adjusted R-square
Description
It sequentially fits (log(y) ~ x) from the last point of x to the previous points with at least 3 points. It chooses a slope the highest adjusted R-square. If the difference is less then 1e-4, it chooses longer slope.
Usage
BestSlope(x, y, adm = "Extravascular", TOL=1e-4)
Arguments
x |
vector values of x-axis, usually time |
y |
vector values of y-axis, usually concentration |
adm |
one of |
TOL |
tolerance. See Phoneix WinNonlin 6.4 User's Guide p33 for the detail. |
Details
Choosing the best terminal slope (y in log scale) in pharmacokinetic analysis is somewhat challenging, and it could vary by analysis performer. Pheonix WinNonlin chooses a slope with highest adjusted R-squared and the longest one. Difference of adjusted R-Squared less than TOL considered to be 0. This function uses ordinary least square method (OLS).
Value
R2 |
R-squared |
R2ADJ |
adjusted R-squared |
LAMZNPT |
number of points used for slope |
LAMZ |
negative of slope, lambda_z |
b0 |
intercept of regression line |
CORRXY |
correlation of log(y) and x |
LAMZLL |
earliest x for lambda_z |
LAMZUL |
last x for lambda_z |
CLSTP |
predicted y value at last point, predicted concentration for the last time point |
Author(s)
Kyun-Seop Bae <k@acr.kr>
See Also
Examples
BestSlope(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"])
BestSlope(Indometh[Indometh$Subject==1, "time"], Indometh[Indometh$Subject==1, "conc"],
adm="Bolus")
Noncompartmental Analysis for an Individual
Description
It performs a noncompartmental analysis with one subject data. This will be deprecated. Use sNCA() instead.
Usage
IndiNCA(x, y, dose = 0, fit = "Linear", adm = "Extravascular", dur = 0,
report = "Table", iAUC = "", uTime = "h", uConc = "ug/L", uDose = "mg")
Arguments
x |
vector values of independent variable, usually time |
y |
vector values of dependent variable, usually concentration |
dose |
administered dose for the subject |
fit |
either of |
adm |
one of |
dur |
infusion duration for constant infusion, otherwise 0 |
report |
either of |
iAUC |
data.frame with three columns, "Name", "Start", "End" to specify the invervals for partial (interval) AUC |
uTime |
unit of time |
uConc |
unit of concentration |
uDose |
unit of dose |
Details
This performs a noncompartmental analysis for a subject. It returns practically the same result with the most popular commercial software.
Value
CMAX |
maximum concentration, Cmax |
CMAXD |
dose normalized Cmax, CMAX / Dose, Cmax / Dose |
TMAX |
time of maximum concentration, Tmax |
TLAG |
time to observe the first non-zero concentration, for extravascular administration only |
CLST |
last positive concentration observed, Clast |
CLSTP |
last positive concentration predicted, Clast_pred |
TLST |
time of last positive concentration, Tlast |
LAMZHL |
half-life by lambda z, ln(2)/LAMZ |
LAMZ |
lambda_z negative of best fit terminal slope |
LAMZLL |
earliest time for LAMZ |
LAMZUL |
last time for LAMZ |
LAMZNPT |
number of points for LAMZ |
CORRXY |
correlation of log(concentration) and time |
R2 |
R-squared |
R2ADJ |
R-squared adjusted |
C0 |
back extrapolated concentration at time 0, for bolus intravascular administration only |
AUCLST |
AUC from 0 to TLST |
AUCALL |
AUC using all the given points, including trailing zero concentrations |
AUCIFO |
AUC infinity observed |
AUCIFOD |
AUCIFO / Dose |
AUCIFP |
AUC infinity predicted using CLSTP instead of CLST |
AUCIFPD |
AUCIFP / Dose |
AUCPEO |
AUC % extrapolation observed |
AUCPEP |
AUC % extrapolated for AUCIFP |
AUCPBEO |
AUC % back extrapolation observed, for bolus IV administration only |
AUCPBEP |
AUC % back extrapolation predicted with AUCIFP, for bolus IV administration only |
AUMCLST |
AUMC to the TLST |
AUMCIFO |
AUMC infinity observed using CLST |
AUMCIFP |
AUMC infinity determined by CLSTP |
AUMCPEO |
AUMC % extrapolated observed |
AUMCPEP |
AUMC % extrapolated predicted |
MRTIVLST |
mean residence time (MRT) to TLST, for intravascular administration |
MRTIVIFO |
mean residence time (MRT) infinity using CLST, for intravascular administration |
MRTIVIFP |
mean residence time (MRT) infinity using CLSTP, for intravascular administration |
MRTEVLST |
mean residence time (MRT) to TLST, for extravascular administration |
MRTEVIFO |
mean residence time (MRT) infinity using CLST, for extravascular administration |
MRTEVIFP |
mean residence time (MRT) infinity using CLSTP, for extravascular administration |
VZO |
volume of distribution determined by LAMZ and AUCIFO, for intravascular administration |
VZP |
volume of distribution determined by LAMZ and AUCIFP, for intravascular administration |
VZFO |
VZO for extravascular administration, VZO/F, F is bioavailability |
VZFP |
VZP for extravascular administration, VZP/F, F is bioavailability |
CLO |
clearance using AUCIFO, for intravascular administration |
CLP |
clearance using AUCIFP, for intravascular administration |
CLFO |
CLO for extravascular administration, CLO/F, F is bioavailability |
CLFP |
CLP for extravascular administration, CLP/F, F is bioavailability |
VSSO |
volume of distribution at steady state using CLST, for intravascular administration only |
VSSP |
volume of distribution at stead state using CLSTP, for intravascular administration only |
Author(s)
Kyun-Seop Bae <k@acr.kr>
References
Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts and Applications. 5th ed. 2016.
Shargel L, Yu A. Applied Biopharmaceutics and Pharmacokinetics. 7th ed. 2015.
Rowland M, Tozer TN. Clinical Pharmacokinetics and Pharmacodynamics - Concepts and Applications. 4th ed. 2011.
Gibaldi M, Perrier D. Pharmacokinetics. 2nd ed. revised and expanded. 1982.
See Also
Examples
IndiNCA(Theoph[Theoph$Subject==1,"Time"], Theoph[Theoph$Subject==1, "conc"], dose=320, uConc="mg/L")
IndiNCA(Indometh[Indometh$Subject==1,"time"], Indometh[Indometh$Subject==1, "conc"], dose=25,
adm="Bolus", uConc="mg/L")
IndiNCA(Indometh[Indometh$Subject==1,"time"], Indometh[Indometh$Subject==1, "conc"], dose=25,
adm="Infusion", dur=0.25, uConc="mg/L")
IndiNCA(Theoph[Theoph$Subject==1,"Time"], Theoph[Theoph$Subject==1, "conc"], dose=320,
report="Text", uConc="mg/L")
IndiNCA(Indometh[Indometh$Subject==1,"time"], Indometh[Indometh$Subject==1, "conc"], dose=25,
adm="Bolus", report="Text", uConc="mg/L")
IndiNCA(Indometh[Indometh$Subject==1,"time"], Indometh[Indometh$Subject==1, "conc"], dose=25,
adm="Infusion", dur=0.25, report="Text", uConc="mg/L")
iAUC = data.frame(Name=c("AUC[0-12h]","AUC[0-24h]"), Start=c(0,0), End=c(12,24)) ; iAUC
IndiNCA(Theoph[Theoph$Subject==1,"Time"], Theoph[Theoph$Subject==1, "conc"], dose=320,
iAUC=iAUC, uConc="mg/L")
IndiNCA(Indometh[Indometh$Subject==1,"time"], Indometh[Indometh$Subject==1, "conc"], dose=25,
adm="Bolus", iAUC=iAUC, uConc="mg/L")
IndiNCA(Indometh[Indometh$Subject==1,"time"], Indometh[Indometh$Subject==1, "conc"], dose=25,
adm="Infusion", dur=0.25, iAUC=iAUC, uConc="mg/L")
Calculate interval AUC
Description
It calculates interval AUC
Usage
IntAUC(x, y, t1, t2, Res, down = "Linear")
Arguments
x |
vector values of independent variable, usually time |
y |
vector values of dependent variable, usually concentration |
t1 |
start time for AUC |
t2 |
end time for AUC |
Res |
result from |
down |
either of |
Details
This calculates an interval (partial) AUC (from t1 to t2) with the given series of x and y.
If t1 and/or t2 cannot be found within x vector, it interpolates according to the down option.
Value
return interval AUC value (scalar)
Author(s)
Kyun-Seop Bae <k@acr.kr>
References
Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts and Applications. 5th ed. 2016.
Shargel L, Yu A. Applied Biopharmaceutics and Pharmacokinetics. 7th ed. 2015.
Rowland M, Tozer TN. Clinical Pharmacokinetics and Pharmacodynamics - Concepts and Applications. 4th ed. 2011.
Gibaldi M, Perrier D. Pharmacokinetics. 2nd ed. revised and expanded. 1982.
See Also
Examples
Res = sNCA(Theoph[Theoph$Subject==1,"Time"], Theoph[Theoph$Subject==1, "conc"],
dose=320, concUnit="mg/L")
IntAUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"], t1=0.5, t2=11, Res)
Interpolate y value
Description
It interpolates y value when a corresponding x value (xnew) does not exist within x vector
Usage
Interpol(x, y, xnew, Slope, b0, down = "Linear")
Arguments
x |
vector values of x-axis, usually time |
y |
vector values of y-axis, usually concentration |
xnew |
new x point to be interpolated, usually new time point |
Slope |
slope of regression log(y) ~ x |
b0 |
y value of just left point of xnew |
down |
either of |
Details
This function interpolate y value, if xnew is not in x vector.
If xnew is in x vector, it just returns the given x and y vector.
This function usually is called by IntAUC function
Returned vector is sorted in the order of increasing x values.
Value
new x and y vector containing xnew and ynew point
Author(s)
Kyun-Seop Bae <k@acr.kr>
See Also
Examples
x = 10:1 + 0.1
y = -2*x + 40.2
Interpol(x, y, 1.5)
Interpol(x, y, 1.5, down="Log")
Area Under the Curve(AUC) and Area Under the first Moment Curve(AUMC) by linear trapezoidal method
Description
It calculates AUC and AUMC using linear trapezoidal method
Usage
LinAUC(x, y)
Arguments
x |
vector values of independent variable, usually time |
y |
vector values of dependent variable, usually concentration |
Details
This function returns AUC and AUMC by linear trapezoidal method.
Value
AUC |
area under the curve |
AUMC |
area under the first moment curve |
Author(s)
Kyun-Seop Bae <k@acr.kr>
References
Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts and Applications. 5th ed. 2016.
Shargel L, Yu A. Applied Biopharmaceutics and Pharmacokinetics. 7th ed. 2015.
Rowland M, Tozer TN. Clinical Pharmacokinetics and Pharmacodynamics - Concepts and Applications. 4th ed. 2011.
Gibaldi M, Perrier D. Pharmacokinetics. 2nd ed. revised and expanded. 1982.
See Also
Examples
LinAUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"])
AUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"]) # compare the last line
Area Under the Curve(AUC) and Area Under the first Moment Curve(AUMC) by linear-up log-down method
Description
It calculates AUC and AUMC using linear-up log-down method
Usage
LogAUC(x, y)
Arguments
x |
vector values of independent variable, usually time |
y |
vector values of dependent variable, usually concentration |
Details
This function returns AUC and AUMC by linear-up log-down method.
Value
AUC |
area under the curve |
AUMC |
area under the first moment curve |
Author(s)
Kyun-Seop Bae <k@acr.kr>
References
Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts and Applications. 5th ed. 2016.
Shargel L, Yu A. Applied Biopharmaceutics and Pharmacokinetics. 7th ed. 2015.
Rowland M, Tozer TN. Clinical Pharmacokinetics and Pharmacodynamics - Concepts and Applications. 4th ed. 2011.
Gibaldi M, Perrier D. Pharmacokinetics. 2nd ed. revised and expanded. 1982.
See Also
Examples
LogAUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"])
# Compare the last line with the above
AUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"], down="Log")
Noncompartmental analysis for a dataset with multiple subjects
Description
conduct noncompartmental analysis for many subjects in a data table
Usage
NCA(concData, id, Time, conc, trt="", fit = "Linear", dose = 0,
adm = "Extravascular", dur = 0, report = "Table", iAUC = "",
uTime = "h", uConc = "ug/L", uDose = "mg")
Arguments
concData |
name of data table containing time-concentration data of multiple subjects |
id |
column name for subject ID |
Time |
column name for the time |
conc |
column name for the concentration |
trt |
column name for the treatment code. This is useful for crossover study like bioequivalence trial. |
fit |
one of |
dose |
administered dose. One should be careful for the unit. This can be a vector containing dose for each subject in order. |
adm |
one of |
dur |
infusion duration for constant infusion, otherwise 0. This can be a vector containing values for each subject in order. |
report |
either of |
iAUC |
data.frame with three columns, "Name", "Start", "End" to specify partial interval AUC |
uTime |
unit of time |
uConc |
unit of concentration |
uDose |
unit of dose |
Details
This function calls sNCA repeatedly to do NCA for each subject.
If you specify report="Text", this function returns in free text format to be used in a report file.
Value
CMAX |
maximum concentration, Cmax |
CMAXD |
dose normalized Cmax, CMAX / Dose, Cmax / Dose |
TMAX |
time of maximum concentration, Tmax |
TLAG |
time to observe the first non-zero concentration, for extravascular administration only |
CLST |
last positive concentration observed, Clast |
CLSTP |
last positive concentration predicted, Clast_pred |
TLST |
time of last positive concentration, Tlast |
LAMZHL |
half-life by lambda z, ln(2)/LAMZ |
LAMZ |
lambda_z negative of best fit terminal slope |
LAMZLL |
earliest time for LAMZ |
LAMZUL |
last time for LAMZ |
LAMZNPT |
number of points for LAMZ |
CORRXY |
correlation of log(concentration) and time |
R2 |
R-squared |
R2ADJ |
R-squared adjusted |
C0 |
back extrapolated concentration at time 0, for bolus intravascular administration only |
AUCLST |
AUC from 0 to TLST |
AUCALL |
AUC using all the given points, including trailing zero concentrations |
AUCIFO |
AUC infinity observed |
AUCIFOD |
AUCIFO / Dose |
AUCIFP |
AUC infinity predicted using CLSTP instead of CLST |
AUCIFPD |
AUCIFP / Dose |
AUCPEO |
AUC % extrapolation observed |
AUCPEP |
AUC % extrapolated for AUCIFP |
AUCPBEO |
AUC % back extrapolation observed, for bolus IV administration only |
AUCPBEP |
AUC % back extrapolation predicted with AUCIFP, for bolus IV administration only |
AUMCLST |
AUMC to the TLST |
AUMCIFO |
AUMC infinity observed using CLST |
AUMCIFP |
AUMC infinity determined by CLSTP |
AUMCPEO |
AUMC % extrapolated observed |
AUMCPEP |
AUMC % extrapolated predicted |
MRTIVLST |
mean residence time (MRT) to TLST, for intravascular administration |
MRTIVIFO |
mean residence time (MRT) infinity using CLST, for intravascular administration |
MRTIVIFP |
mean residence time (MRT) infinity using CLSTP, for intravascular administration |
MRTEVLST |
mean residence time (MRT) to TLST, for extravascular administration |
MRTEVIFO |
mean residence time (MRT) infinity using CLST, for extravascular administration |
MRTEVIFP |
mean residence time (MRT) infinity using CLSTP, for extravascular administration |
VZO |
volume of distribution determined by LAMZ and AUCIFO, for intravascular administration |
VZP |
volume of distribution determined by LAMZ and AUCIFP, for intravascular administration |
VZFO |
VZO for extravascular administration, VZO/F, F is bioavailability |
VZFP |
VZP for extravascular administration, VZP/F, F is bioavailability |
CLO |
clearance using AUCIFO, for intravascular administration |
CLP |
clearance using AUCIFP, for intravascular administration |
CLFO |
CLO for extravascular administration, CLO/F, F is bioavailability |
CLFP |
CLP for extravascular administration, CLP/F, F is bioavailability |
VSSO |
volume of distribution at steady state using CLST, for intravascular administration only |
VSSP |
volume of distribution at stead state using CLSTP, for intravascular administration only |
Author(s)
Kyun-Seop Bae <k@acr.kr>
References
Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts and Applications. 5th ed. 2016.
Shargel L, Yu A. Applied Biopharmaceutics and Pharmacokinetics. 7th ed. 2015.
Rowland M, Tozer TN. Clinical Pharmacokinetics and Pharmacodynamics - Concepts and Applications. 4th ed. 2011.
Gibaldi M, Perrier D. Pharmacokinetics. 2nd ed. revised and expanded. 1982.
See Also
Examples
# Theoph and Indometh data: dose in mg, conc in mg/L, time in h
NCA(Theoph, "Subject", "Time", "conc", dose=320, uConc="mg/L")
NCA(Indometh, "Subject", "time", "conc", dose=25, adm="Bolus", uConc="mg/L")
iAUC = data.frame(Name=c("AUC[0-12h]","AUC[0-24h]"), Start=c(0,0), End=c(12,24)) ; iAUC
NCA(Theoph, "Subject", "Time", "conc", dose=320, iAUC=iAUC, uConc="mg/L")
NCA(Indometh, "Subject", "time", "conc", dose=25, adm="Bolus", iAUC=iAUC, uConc="mg/L")
# writeLines(NCA(Theoph, "Subject", "Time", "conc", dose=320, report="Text", uConc="mg/L"),
# "Theoph_Linear_CoreOutput.txt")
# writeLines(NCA(Theoph, "Subject", "Time", "conc", dose=320, fit="Log", report="Text",
# uConc="mg/L"), "Theoph_Log_CoreOutput.txt")
# writeLines(NCA(Indometh, "Subject", "time", "conc", dose=25, adm="Bolus", report="Text",
# uConc="mg/L"), "Indometh_Bolus_Linear_CoreOutput.txt")
# writeLines(NCA(Indometh, "Subject", "time", "conc", dose=25, adm="Bolus", fit="Log",
# report="Text", uConc="mg/L"), "Indometh_Bolus_Log_CoreOutput.txt")
# writeLines(NCA(Indometh, "Subject", "time", "conc", dose=25, adm="Infusion", dur=0.25,
# report="Text", uConc="mg/L"), "Indometh_Infusion_Linear_CoreOutput.txt")
# writeLines(NCA(Indometh, "Subject", "time", "conc", dose=25, adm="Infusion", dur=0.25,
# fit="Log", report="Text", uConc="mg/L"), "Indometh_Infusion_Log_CoreOutput.txt")
NCA of SDTM data for single subject
Description
This performs Noncompartmental Analysis(NCA) for one dosing record from the CDISC EX and PC domain.
Usage
NCA0(EX0, PC0, fit="Linear", excludeInfusion=TRUE, label="")
Arguments
EX0 |
One EX record: a named character vector, a one-row data.frame or a one-row matrix. It needs the names EXDOSE, EXDOSU, EXROUTE, EXSTDTC and EXENDTC. |
PC0 |
The concentration records of that dosing interval, with the columns PCDTC, PCSTRESN and PCSTRESU |
fit |
either of |
excludeInfusion |
when the administration is an infusion, estimate the terminal slope from post-infusion samples only; |
label |
identifier used only in warning messages |
Details
The administration method is taken from EXROUTE first: an EXROUTE of
"INTRAVENOUS" gives "Infusion" when EXENDTC is later than EXSTDTC
and "Bolus" otherwise, and any other route gives "Extravascular".
Time after dose is computed from EXSTDTC and negative values are set to zero, so
a pre-dose sample is placed at time zero.
This calls sNCA.
This is called by rNCA function.
Value
This returns a named character vector: AdmMethod, Dose, UnitDose, Dur, UnitTime, UnitConc, followed by the NCA parameters. Which parameters are present depends on the administration method.
Author(s)
Kyun-Seop Bae <k@acr.kr>
See Also
Round Half Away from Zero
Description
This is an ordinary rounding function, so called round half away from zero
Usage
Round(x, n = 0)
Arguments
x |
numeric to be rounded |
n |
indicating decimal digits |
Details
The function round in R base rounds to the even number, i.e. round(0.5) is 0 not 1.
If you want rounding 0.5 be 1, you can use this Round function.
This function is for the consistency with other software like MS-Excel, SAS.
Value
ordinarily rounded value
Author(s)
Kyun-Seop Bae <k@acr.kr>
References
See wikipedia subject "Rounding"
Examples
(x = 1:10 - 0.5)
Round(x)
round(x) # compare with the above
NCA Report Configuation Table
Description
Contains the names and order of colum of return table/text by IndiNCA and NCA functions
Usage
RptCfg
Format
A data frame with 48 observations on the following 10 variables.
PPTESTCDa character vector of CDISC SDTM PPTESTCD
SYNONYMa character vector of CDISC SDTM PPTESTCD Synonym
NCIa character vector of NCI peferred terms
WNLa character vector of WinNonlin(R) software variables
ExtravascularDefaulta numeric vector of ordering in report for extravascular administration, Zero means exclusion in the report.
ExtravascularWNLa numeric vector of WinNonlin(R) style ordering in report for extravascular administration, Zero means exclusion in the report.
BolusDefaulta numeric vector of ordering in report for extravascular administration, Zero means exclusion in the report.
BolusWNLa numeric vector of WinNonlin(R) style ordering in report for extravascular administration, Zero means exclusion in the report.
InfusionDefaulta numeric vector of ordering in report for extravascular administration, Zero means exclusion in the report.
InfusionWNLa numeric vector of WinNonlin(R) style ordering in report for extravascular administration, Zero means exclusion in the report.
Details
This table should exist in pkr package. User can edit this table for shaping the report in one's own style.
Get the Slope of regression log(y) ~ x
Description
It calculates the slope with linear regression of log(y) ~ x
Usage
Slope(x, y)
Arguments
x |
vector values of independent variable, usually time |
y |
vector values of dependent variable, usually concentration |
Details
With time-concentration curve, you frequently need to estimate slope in log(concentration) ~ time.
This function is usually called by BestSlope function and you seldom need to call this function directly.
Value
R2 |
R-squared |
R2ADJ |
adjusted R-squared |
LAMZNPT |
number of points used for slope |
LAMZ |
negative of slope, lambda_z |
b0 |
intercept of regression line |
CORRXY |
correlation of log(y) and x |
LAMZLL |
earliest x for lambda_z |
LAMZUL |
last x for lambda_z |
CLSTP |
predicted y value at last point, predicted concentration for the last time point |
Author(s)
Kyun-Seop Bae <k@acr.kr>
See Also
Examples
Slope(Indometh[Indometh$Subject==1, "time"], Indometh[Indometh$Subject==1, "conc"])
Internal Functions
Description
Internal functions
Details
These are not to be called by the user.
Internal Functions
Description
Internal functions
Details
These are not to be called by the user.
Disply CDISC standard units and multiplied factor of NCA results
Description
It displays CDISC PP output units and multiplication factor for them.
Usage
Unit(code = "", timeUnit = "h", concUnit = "ng/mL", doseUnit = "mg", MW = 0)
Arguments
code |
vector of PPTESTCD |
timeUnit |
unit of time |
concUnit |
unit of concentration |
doseUnit |
unit of dose |
MW |
molecular weight of drug |
Value
row names |
PPTESTCD |
Unit |
unit |
Factor |
internal mulitpilcation factor |
Author(s)
Kyun-Seop Bae <k@acr.kr>
Examples
Unit(concUnit="ug/L", doseUnit="mg")
Unit(concUnit="ng/L", doseUnit="mg")
Unit(concUnit="umol/L", doseUnit="mmol")
Unit(concUnit="nmol/L", doseUnit="mmol")
Unit(concUnit="mmol/L", doseUnit="mg", MW=500)
Unit(concUnit="umol/L", doseUnit="mg", MW=500)
Unit(concUnit="nmol/L", doseUnit="mg", MW=500)
Unit(concUnit="nmol/mL", doseUnit="mg", MW=500)
Unit(concUnit="ug/L", doseUnit="mmol", MW=500)
Unit(concUnit="ug/L", doseUnit="mol", MW=500)
Unit(concUnit="ng/L", doseUnit="mmol", MW=500)
Unit(concUnit="ng/mL", doseUnit="mmol", MW=500)
Unit(concUnit="nmol/L", doseUnit="mg")
Unit(concUnit="ug/L", doseUnit="mmol")
Combine XPT files
Description
This function combines specified CDISC domain XPT files across the folders.
Usage
combXPT(folders, domain)
Arguments
folders |
where to find specified CDISC domain XPT files |
domain |
domain XPT files to be comined across the folders |
Details
You need to designate only one CDISC domain name. You may specify one or more folders to find the domain XPT files.
Value
XPT |
combined table |
Author(s)
Kyun-Seop Bae <k@acr.kr>
See Also
Convert intermeidate NCA result to adequate unit.
Description
This is an internal function
Author(s)
Kyun-Seop Bae <k@acr.kr>
Forest plot to compare NCA results
Description
This function compares NCA results usually from rNCA function
Usage
foreNCA(NCAres = "", PPTESTCD = "", PCTESTCD = "", title = "", ...)
Arguments
NCAres |
NCA results from rNCA function |
PPTESTCD |
CDISC SDTM PP domain Test Code to coompare |
PCTESTCD |
Molecular species to compare specified in PCTESTCD of CDISC SDTM PC domain |
title |
Title of the plot |
... |
further aguments to pass to the forestplot function |
Details
This functio calls forestplot in forest package.
Value
Currently, this just plots.
Author(s)
Kyun-Seop Bae <k@acr.kr>
See Also
Load EX and PC domain files in folders
Description
This loads and returns EX and PC domain files in the specified folders
Usage
loadEXPC(folders)
Arguments
folders |
folders where to find EX and PC domain files |
Details
This reads EX and PC domain files in the specified folder.
This calls readEX and readPC functions.
Value
EX |
combined EX domain data |
PC |
combined PC doamin data |
Author(s)
Kyun-Seop Bae <k@acr.kr>
See Also
NCA output to pdf file
Description
This output NCA result in a pdf file.
Usage
pdfNCA(fileName = "Temp-NCA.pdf", concData, colSubj = "Subject", colTime = "Time",
colConc = "conc", dose = 0, adm = "Extravascular", dur = 0, doseUnit = "mg",
timeUnit = "h", concUnit = "ug/L", down="Linear", MW = 0)
Arguments
fileName |
file name to save |
concData |
concentration data table |
colSubj |
column name for subject ID |
colTime |
column name for time |
colConc |
column name for concentration |
dose |
administered dose |
adm |
one of |
dur |
duration of infusion |
doseUnit |
unit of dose |
timeUnit |
unit of time |
concUnit |
unit of concentration |
down |
either of |
MW |
molecular weight of drug |
Value
CMAX |
maximum concentration, Cmax |
CMAXD |
dose normalized Cmax, CMAX / Dose, Cmax / Dose |
TMAX |
time of maximum concentration, Tmax |
TLAG |
time to observe the first non-zero concentration, for extravascular administration only |
CLST |
last positive concentration observed, Clast |
CLSTP |
last positive concentration predicted, Clast_pred |
TLST |
time of last positive concentration, Tlast |
LAMZHL |
half-life by lambda z, ln(2)/LAMZ |
LAMZ |
lambda_z negative of best fit terminal slope |
LAMZLL |
earliest time for LAMZ |
LAMZUL |
last time for LAMZ |
LAMZNPT |
number of points for LAMZ |
CORRXY |
correlation of log(concentration) and time |
R2 |
R-squared |
R2ADJ |
R-squared adjusted |
C0 |
back extrapolated concentration at time 0, for bolus intravascular administration only |
AUCLST |
AUC from 0 to TLST |
AUCALL |
AUC using all the given points, including trailing zero concentrations |
AUCIFO |
AUC infinity observed |
AUCIFOD |
AUCIFO / Dose |
AUCIFP |
AUC infinity predicted using CLSTP instead of CLST |
AUCIFPD |
AUCIFP / Dose |
AUCPEO |
AUC % extrapolation observed |
AUCPEP |
AUC % extrapolated for AUCIFP |
AUCPBEO |
AUC % back extrapolation observed, for bolus IV administration only |
AUCPBEP |
AUC % back extrapolation predicted with AUCIFP, for bolus IV administration only |
AUMCLST |
AUMC to the TLST |
AUMCIFO |
AUMC infinity observed using CLST |
AUMCIFP |
AUMC infinity determined by CLSTP |
AUMCPEO |
AUMC % extrapolated observed |
AUMCPEP |
AUMC % extrapolated predicted |
MRTIVLST |
mean residence time (MRT) to TLST, for intravascular administration |
MRTIVIFO |
mean residence time (MRT) infinity using CLST, for intravascular administration |
MRTIVIFP |
mean residence time (MRT) infinity using CLSTP, for intravascular administration |
MRTEVLST |
mean residence time (MRT) to TLST, for extravascular administration |
MRTEVIFO |
mean residence time (MRT) infinity using CLST, for extravascular administration |
MRTEVIFP |
mean residence time (MRT) infinity using CLSTP, for extravascular administration |
VZO |
volume of distribution determined by LAMZ and AUCIFO, for intravascular administration |
VZP |
volume of distribution determined by LAMZ and AUCIFP, for intravascular administration |
VZFO |
VZO for extravascular administration, VZO/F, F is bioavailability |
VZFP |
VZP for extravascular administration, VZP/F, F is bioavailability |
CLO |
clearance using AUCIFO, for intravascular administration |
CLP |
clearance using AUCIFP, for intravascular administration |
CLFO |
CLO for extravascular administration, CLO/F, F is bioavailability |
CLFP |
CLP for extravascular administration, CLP/F, F is bioavailability |
VSSO |
volume of distribution at steady state using CLST, for intravascular administration only |
VSSP |
volume of distribution at stead state using CLSTP, for intravascular administration only |
Author(s)
Kyun-Seop Bae <k@acr.kr>
See Also
Examples
#pdfNCA(fileName="NCA-Theoph.pdf", Theoph, colSubj="Subject", colTime="Time",
# colConc="conc", dose=320, doseUnit="mg", timeUnit="h", concUnit="mg/L")
#pdfNCA(fileName="NCA-Indometh.pdf", Indometh, colSubj="Subject", colTime="time",
# colConc="conc", adm="Infusion", dur=0.5, dose=25, doseUnit="mg",
# timeUnit="h", concUnit="mg/L")
Plot best fit slope
Description
Automatically select best fit slope for the given x(usually time) and log(y)(usually concentration) values.
Usage
plotFit(concData, id, Time, conc, mol = "", adm = "Extravascular", ID = "", Mol = "")
Arguments
concData |
name of data table containing time-concentration data of multiple subjects |
id |
column name for subject ID |
Time |
column name for the time |
conc |
column name for the concentration |
mol |
column name for molecular species |
adm |
one of |
ID |
Subject ID for this plot |
Mol |
the name of molecular species to see |
Details
Find the best fit slope then plot it.
Currently this function uses ordinary least square method(OLS) only.
This function calles BestSlope function.
Value
R2 |
R-squared |
R2ADJ |
adjusted R-squared |
LAMZNPT |
number of points used for slope |
LAMZ |
negative of slope, lambda_z |
b0 |
intercept of regression line |
CORRXY |
correlation of log(y) and x |
LAMZLL |
earliest x for lambda_z |
LAMZUL |
last x for lambda_z |
CLSTP |
predicted y value at last point, predicted concentration for the last time point |
Author(s)
Jee Eun Lee <JeeEun.Lee@fda.hhs.gov>
See Also
Examples
plotFit(Theoph, "Subject", "Time", "conc", ID="1")
plotFit(Indometh, "Subject", "time", "conc", adm="Bolus", ID="1")
Plot concentration vs. time curve for individuals and collectively.
Description
Generates individual and superposed concentration vs. time curves and saves them in pdf and tiff files.
Usage
plotPK(concData, id, Time, conc, unitTime = "hr", unitConc = "ng/mL", trt = "",
fit = "Linear", dose = 0, adm = "Extravascular", dur = 0, outdir = "Output",
name = "")
Arguments
concData |
name of data table containing time-concentration data of multiple subjects |
id |
column name for subject ID |
Time |
column name for the time |
conc |
column name for the concentration |
unitTime |
unit for the time |
unitConc |
unit for the concentration |
trt |
column name for the treatment code. This is useful for crossover study like bioequivalence trial. |
fit |
one of |
dose |
administered dose. One should be careful for the unit. This can be a vector containing dose for each subject and treatment in order. |
adm |
one of |
dur |
infusion duration for constant infusion, otherwise 0. This can be a vector containing values for each subject and treatment in order. |
outdir |
name of the folder to be used for the output files. |
name |
stem used in the output file names. |
Details
This function generates five figures: individual linear and semi-logarithmic profiles (one pdf each, several panels per page) and pooled linear, semi-logarithmic and mean with 95% confidence interval profiles (one tiff each, or png where the R build has no tiff device).
Each subject gets its own colour and plotting symbol whatever the number of subjects, and the subject legend is drawn in a panel of its own so that it cannot overlap the curves. When there are more subjects than can be labelled legibly, the count is shown instead of an unreadable legend. Treatment panels are laid out in a grid of at most four columns, so a study with many treatments neither exhausts the figure margins nor produces an enormous raster.
Non-finite times and concentrations are dropped from the axis ranges, and the semi-logarithmic figures use only positive concentrations. The semi-logarithmic axis is aligned to whole decades enclosing the data, so a labelled tick is always visible.
This function calls NCA().
Value
Invisibly, a character vector of the paths written. The files are saved in the
outdir folder.
Author(s)
Jee Eun Lee <JeeEun.Lee@fda.hhs.gov>, Kyun-Seop Bae <k@acr.kr>
See Also
Examples
# plotPK(Theoph, "Subject", "Time", "conc", unitTime="hr", unitConc="mg/L", dose=320)
# plotPK(Indometh, "Subject", "time", "conc", unitTime="hr", unitConc="mg/L", adm="Bolus", dose=25)
Do NCA for review
Description
This performs NCA from the CDISC EX and PC datasets.
Usage
rNCA(ex, pc, study = "", trt = "", id = "", analyte = "",
codeBQL = c("< 0", "<0", "NQ", "BLQ", "BQL", "BQoL", "<LOQ"),
fit="Linear", MinPoints = 5, excludeInfusion = TRUE)
Arguments
ex |
EX domain data, usually from the |
pc |
PC domain data, usually form the |
study |
vector of study names in EX and PC domain to do NCA. |
trt |
vector of treatment names in EXTRT to do NCA. |
id |
vector of subject IDs in USUBJID to do NCA. |
analyte |
vector of molecular species in PCTESTCD to do NCA. |
codeBQL |
symbols of below the quantitation limit |
fit |
either of |
MinPoints |
an analysis is done only when the number of quantifiable (greater than zero) concentrations in the dosing interval is strictly greater than this value. Note that this counts quantifiable concentrations, not sampling points: BQL and zero records do not count. |
excludeInfusion |
estimate the terminal slope of an infusion from post-infusion samples only; |
Details
One row of result is produced for each subject, dosing interval and analyte. A dosing interval starts at its own EXSTDTC and ends at the subject's next real dose of any treatment in the same study, so that in a crossover trial the first period is not extended into the second; a placebo or zero dose delivers no drug and does not end an interval. The final interval is open-ended, so terminal and follow-up samples still contribute to the elimination phase.
The last concentration in the 24 hours before the dose is carried into the interval as the pre-dose sample, and placed at time zero. The lookback is bounded because an unbounded one would report a sample from an earlier period as this dose's initial concentration. In an interval that is followed by another dose the trailing trough is dropped when its nominal time (PCTPTNUM) equals the pre-dose one, so that it is not counted twice.
EX and PC records are sorted by date and time before use, so the result does not
depend on the row order of the input. Records whose date and time cannot be read
as a full YYYY-MM-DDTHH:MM:SS value are dropped with a warning naming the
subjects affected.
The automatic terminal-slope search restricts itself to samples after the maximum
concentration. That is the right rule for an extravascular dose but says nothing
about an infusion, so a sample drawn while drug is still being infused can win on
adjusted R-squared and be reported as terminal elimination. Because a terminal
phase does not exist while drug is still going in, excludeInfusion defaults
to TRUE: the search is given only the samples after the end of infusion,
and the same maximum-adjusted-R-squared criterion then selects the window among
them; within that window it still starts after the largest of those samples. Set
excludeInfusion=FALSE for the unrestricted search over all samples.
Only lambda z and the parameters derived from it (half-life, AUCIFO, AUCPEO, Vz) are affected - Cmax, AUClast and the other observed parameters cannot change. When there are too few post-infusion samples to fit a slope, a warning names the profile and the unrestricted selection is used, so no profile is lost silently.
The restriction applies to this function and to NCA0, which know the
dosing record and so the end of infusion. sNCA and
tblNCA take times and concentrations without a dosing record and
remain faithful wrappers around NonCompart; give sNCA an explicit
UsePoints to fix the window there.
This calls NCA0. Results of this can be further processed by foreNCA to plot and compare between studies and dose groups.
Value
This returns a table of NCA results, or invisibly NULL with a warning when
no subject meets the MinPoints criterion.
Author(s)
Kyun-Seop Bae <k@acr.kr>
See Also
Read EX domain files
Description
This reads EX domain files from the specified folders.
Usage
readEX(folders)
Arguments
folders |
folders where to find EX doamin files |
Details
This calls combXPT function.
This is called by loadEXPC function.
Value
This returns combined table of EX doamin.
Author(s)
Kyun-Seop Bae <k@acr.kr>
See Also
Read PC domain files
Description
This reads PC domain files from the specified folders.
Usage
readPC(folders)
Arguments
folders |
folders where to find PC doamin files |
Details
This calls combXPT function.
This is called by loadEXPC function.
Value
This returns combined table of PC doamin.
Author(s)
Kyun-Seop Bae <k@acr.kr>
See Also
NCA output to rtf file
Description
This output NCA result in a rtf file.
Usage
rtfNCA(fileName = "Temp-NCA.rtf", concData, colSubj = "Subject", colTime = "Time",
colConc = "conc", dose = 0, adm = "Extravascular", dur = 0, doseUnit = "mg",
timeUnit = "h", concUnit = "ug/L", down="Linear", MW = 0)
Arguments
fileName |
file name to save |
concData |
concentration data table |
colSubj |
column name for subject ID |
colTime |
column name for time |
colConc |
column name for concentration |
dose |
administered dose |
adm |
one of |
dur |
duration of infusion |
doseUnit |
unit of dose |
timeUnit |
unit of time |
concUnit |
unit of concentration |
down |
either of |
MW |
molecular weight of drug |
Value
CMAX |
maximum concentration, Cmax |
CMAXD |
dose normalized Cmax, CMAX / Dose, Cmax / Dose |
TMAX |
time of maximum concentration, Tmax |
TLAG |
time to observe the first non-zero concentration, for extravascular administration only |
CLST |
last positive concentration observed, Clast |
CLSTP |
last positive concentration predicted, Clast_pred |
TLST |
time of last positive concentration, Tlast |
LAMZHL |
half-life by lambda z, ln(2)/LAMZ |
LAMZ |
lambda_z negative of best fit terminal slope |
LAMZLL |
earliest time for LAMZ |
LAMZUL |
last time for LAMZ |
LAMZNPT |
number of points for LAMZ |
CORRXY |
correlation of log(concentration) and time |
R2 |
R-squared |
R2ADJ |
R-squared adjusted |
C0 |
back extrapolated concentration at time 0, for bolus intravascular administration only |
AUCLST |
AUC from 0 to TLST |
AUCALL |
AUC using all the given points, including trailing zero concentrations |
AUCIFO |
AUC infinity observed |
AUCIFOD |
AUCIFO / Dose |
AUCIFP |
AUC infinity predicted using CLSTP instead of CLST |
AUCIFPD |
AUCIFP / Dose |
AUCPEO |
AUC % extrapolation observed |
AUCPEP |
AUC % extrapolated for AUCIFP |
AUCPBEO |
AUC % back extrapolation observed, for bolus IV administration only |
AUCPBEP |
AUC % back extrapolation predicted with AUCIFP, for bolus IV administration only |
AUMCLST |
AUMC to the TLST |
AUMCIFO |
AUMC infinity observed using CLST |
AUMCIFP |
AUMC infinity determined by CLSTP |
AUMCPEO |
AUMC % extrapolated observed |
AUMCPEP |
AUMC % extrapolated predicted |
MRTIVLST |
mean residence time (MRT) to TLST, for intravascular administration |
MRTIVIFO |
mean residence time (MRT) infinity using CLST, for intravascular administration |
MRTIVIFP |
mean residence time (MRT) infinity using CLSTP, for intravascular administration |
MRTEVLST |
mean residence time (MRT) to TLST, for extravascular administration |
MRTEVIFO |
mean residence time (MRT) infinity using CLST, for extravascular administration |
MRTEVIFP |
mean residence time (MRT) infinity using CLSTP, for extravascular administration |
VZO |
volume of distribution determined by LAMZ and AUCIFO, for intravascular administration |
VZP |
volume of distribution determined by LAMZ and AUCIFP, for intravascular administration |
VZFO |
VZO for extravascular administration, VZO/F, F is bioavailability |
VZFP |
VZP for extravascular administration, VZP/F, F is bioavailability |
CLO |
clearance using AUCIFO, for intravascular administration |
CLP |
clearance using AUCIFP, for intravascular administration |
CLFO |
CLO for extravascular administration, CLO/F, F is bioavailability |
CLFP |
CLP for extravascular administration, CLP/F, F is bioavailability |
VSSO |
volume of distribution at steady state using CLST, for intravascular administration only |
VSSP |
volume of distribution at stead state using CLSTP, for intravascular administration only |
Author(s)
Kyun-Seop Bae <k@acr.kr>
See Also
Examples
#rtfNCA(fileName="NCA-Theoph.rtf", Theoph, colSubj="Subject", colTime="Time",
# colConc="conc", dose=320, doseUnit="mg", timeUnit="h", concUnit="mg/L")
#rtfNCA(fileName="NCA-Indometh.rtf", Indometh, colSubj="Subject", colTime="time",
# colConc="conc", adm="Infusion", dur=0.5, dose=25, doseUnit="mg",
# timeUnit="h", concUnit="mg/L")
Simplest NCA
Description
This is the work-horse function for NCA.
Usage
sNCA(x, y, dose = 0, adm = "Extravascular", dur = 0, doseUnit = "mg", timeUnit = "h",
concUnit = "ug/L", iAUC = "", down = "Linear", MW = 0, returnNA = TRUE,
UsePoints = NULL)
Arguments
x |
usually time |
y |
usually concentration |
dose |
given amount |
adm |
one of |
dur |
duration of infusion |
doseUnit |
unit of dose |
timeUnit |
unit of time |
concUnit |
unit of concentration |
iAUC |
interval AUCs to calculate |
down |
either of |
MW |
molecular weight of the drug |
returnNA |
if |
UsePoints |
indices into |
Details
This will replace IndiNCA.
Value
CMAX |
maximum concentration, Cmax |
CMAXD |
dose normalized Cmax, CMAX / Dose, Cmax / Dose |
TMAX |
time of maximum concentration, Tmax |
TLAG |
time to observe the first non-zero concentration, for extravascular administration only |
CLST |
last positive concentration observed, Clast |
CLSTP |
last positive concentration predicted, Clast_pred |
TLST |
time of last positive concentration, Tlast |
LAMZHL |
half-life by lambda z, ln(2)/LAMZ |
LAMZ |
lambda_z negative of best fit terminal slope |
LAMZLL |
earliest time for LAMZ |
LAMZUL |
last time for LAMZ |
LAMZNPT |
number of points for LAMZ |
CORRXY |
correlation of log(concentration) and time |
R2 |
R-squared |
R2ADJ |
R-squared adjusted |
C0 |
back extrapolated concentration at time 0, for bolus intravascular administration only |
AUCLST |
AUC from 0 to TLST |
AUCALL |
AUC using all the given points, including trailing zero concentrations |
AUCIFO |
AUC infinity observed |
AUCIFOD |
AUCIFO / Dose |
AUCIFP |
AUC infinity predicted using CLSTP instead of CLST |
AUCIFPD |
AUCIFP / Dose |
AUCPEO |
AUC % extrapolation observed |
AUCPEP |
AUC % extrapolated for AUCIFP |
AUCPBEO |
AUC % back extrapolation observed, for bolus IV administration only |
AUCPBEP |
AUC % back extrapolation predicted with AUCIFP, for bolus IV administration only |
AUMCLST |
AUMC to the TLST |
AUMCIFO |
AUMC infinity observed using CLST |
AUMCIFP |
AUMC infinity determined by CLSTP |
AUMCPEO |
AUMC % extrapolated observed |
AUMCPEP |
AUMC % extrapolated predicted |
MRTIVLST |
mean residence time (MRT) to TLST, for intravascular administration |
MRTIVIFO |
mean residence time (MRT) infinity using CLST, for intravascular administration |
MRTIVIFP |
mean residence time (MRT) infinity using CLSTP, for intravascular administration |
MRTEVLST |
mean residence time (MRT) to TLST, for extravascular administration |
MRTEVIFO |
mean residence time (MRT) infinity using CLST, for extravascular administration |
MRTEVIFP |
mean residence time (MRT) infinity using CLSTP, for extravascular administration |
VZO |
volume of distribution determined by LAMZ and AUCIFO, for intravascular administration |
VZP |
volume of distribution determined by LAMZ and AUCIFP, for intravascular administration |
VZFO |
VZO for extravascular administration, VZO/F, F is bioavailability |
VZFP |
VZP for extravascular administration, VZP/F, F is bioavailability |
CLO |
clearance using AUCIFO, for intravascular administration |
CLP |
clearance using AUCIFP, for intravascular administration |
CLFO |
CLO for extravascular administration, CLO/F, F is bioavailability |
CLFP |
CLP for extravascular administration, CLP/F, F is bioavailability |
VSSO |
volume of distribution at steady state using CLST, for intravascular administration only |
VSSP |
volume of distribution at steady state using CLSTP, for intravascular administration only |
Author(s)
Kyun-Seop Bae <k@acr.kr>
References
Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts and Applications. 5th ed. 2016.
See Also
Examples
# For one subject
x = Theoph[Theoph$Subject=="1","Time"]
y = Theoph[Theoph$Subject=="1","conc"]
sNCA(x, y, dose=320, doseUnit="mg", concUnit="mg/L", timeUnit="h")
sNCA(x, y, dose=320, concUnit="mg/L", returnNA=FALSE)
iAUC = data.frame(Name=c("AUC[0-12h]","AUC[0-24h]"), Start=c(0,0), End=c(12,24))
sNCA(x, y, dose=320, doseUnit="mg", concUnit="mg/L", timeUnit="h", iAUC=iAUC)
MW = 180.164 # Molecular weight of theophylline
sNCA(x, y/MW, dose=320, doseUnit="mg", concUnit="mmol/L", timeUnit="h")
sNCA(x, y/MW, dose=320, doseUnit="mg", concUnit="mmol/L", timeUnit="h", MW=MW)
sNCA(x, y, dose=320/MW, doseUnit="mmol", concUnit="mg/L", timeUnit="h", MW=MW)
sNCA(x, y/MW, dose=320/MW, doseUnit="mmol", concUnit="mmol/L", timeUnit="h", MW=MW)
sNCA(x, y/MW, dose=320/MW, doseUnit="mmol", concUnit="mmol/L", timeUnit="h", MW=MW,
returnNA=FALSE)
sNCA(x, y/MW, doseUnit="mmol", concUnit="mmol/L", timeUnit="h", MW=MW, returnNA=FALSE)
sNCA(x, y/MW, dose=as.numeric(NA), doseUnit="mmol", concUnit="mmol/L", timeUnit="h",
MW=MW, returnNA=FALSE)
sNCA(x, y, dose=320, concUnit="mg/L", timeUnit="hr")
sNCA(x*60, y, dose=320, concUnit="mg/L", timeUnit="min")
Table output NCA
Description
do multiple NCA and returns a result table.
Usage
tblNCA(concData, key = "Subject", colTime = "Time", colConc = "conc", dose = 0,
adm = "Extravascular", dur = 0, doseUnit = "mg", timeUnit = "h",
concUnit = "ug/L", down = "Linear", MW = 0, returnNA = FALSE)
Arguments
concData |
concentration data table |
key |
column names of concData to be shown at the output table |
colTime |
column name for time |
colConc |
column name for concentration |
dose |
administered dose |
adm |
one of |
dur |
duration of infusion |
doseUnit |
unit of dose |
timeUnit |
unit of time |
concUnit |
unit of concentration |
down |
method to calculate AUC, |
MW |
molecular weight of drug |
returnNA |
if |
Value
Basically same with sNCA
Author(s)
Kyun-Seop Bae <k@acr.kr>
See Also
Examples
tblNCA(Theoph, key="Subject", dose=320, concUnit="mg/L")
tblNCA(Indometh, key="Subject", colTime="time", colConc="conc", dose=25,
adm="Infusion", dur=0.5, concUnit="mg/L")
Text output of NCA for one subject
Description
This is the text form output.
Usage
txtNCA(x, y, dose = 0, adm = "Extravascular", dur = 0, doseUnit = "mg", timeUnit = "h",
concUnit = "ug/L", iAUC = "", down="Linear", MW = 0, returnNA = FALSE)
Arguments
x |
usually time |
y |
usually concentration |
dose |
given amount |
adm |
one of |
dur |
duration of infusion |
doseUnit |
unit of dose |
timeUnit |
unit of time |
concUnit |
unit of concentration |
iAUC |
interval AUCs to calculate |
down |
either of |
MW |
molecular weight of the drug |
returnNA |
if |
Value
CMAX |
maximum concentration, Cmax |
CMAXD |
dose normalized Cmax, CMAX / Dose, Cmax / Dose |
TMAX |
time of maximum concentration, Tmax |
TLAG |
time to observe the first non-zero concentration, for extravascular administration only |
CLST |
last positive concentration observed, Clast |
CLSTP |
last positive concentration predicted, Clast_pred |
TLST |
time of last positive concentration, Tlast |
LAMZHL |
half-life by lambda z, ln(2)/LAMZ |
LAMZ |
lambda_z negative of best fit terminal slope |
LAMZLL |
earliest time for LAMZ |
LAMZUL |
last time for LAMZ |
LAMZNPT |
number of points for LAMZ |
CORRXY |
correlation of log(concentration) and time |
R2 |
R-squared |
R2ADJ |
R-squared adjusted |
C0 |
back extrapolated concentration at time 0, for bolus intravascular administration only |
AUCLST |
AUC from 0 to TLST |
AUCALL |
AUC using all the given points, including trailing zero concentrations |
AUCIFO |
AUC infinity observed |
AUCIFOD |
AUCIFO / Dose |
AUCIFP |
AUC infinity predicted using CLSTP instead of CLST |
AUCIFPD |
AUCIFP / Dose |
AUCPEO |
AUC % extrapolation observed |
AUCPEP |
AUC % extrapolated for AUCIFP |
AUCPBEO |
AUC % back extrapolation observed, for bolus IV administration only |
AUCPBEP |
AUC % back extrapolation predicted with AUCIFP, for bolus IV administration only |
AUMCLST |
AUMC to the TLST |
AUMCIFO |
AUMC infinity observed using CLST |
AUMCIFP |
AUMC infinity determined by CLSTP |
AUMCPEO |
AUMC % extrapolated observed |
AUMCPEP |
AUMC % extrapolated predicted |
MRTIVLST |
mean residence time (MRT) to TLST, for intravascular administration |
MRTIVIFO |
mean residence time (MRT) infinity using CLST, for intravascular administration |
MRTIVIFP |
mean residence time (MRT) infinity using CLSTP, for intravascular administration |
MRTEVLST |
mean residence time (MRT) to TLST, for extravascular administration |
MRTEVIFO |
mean residence time (MRT) infinity using CLST, for extravascular administration |
MRTEVIFP |
mean residence time (MRT) infinity using CLSTP, for extravascular administration |
VZO |
volume of distribution determined by LAMZ and AUCIFO, for intravascular administration |
VZP |
volume of distribution determined by LAMZ and AUCIFP, for intravascular administration |
VZFO |
VZO for extravascular administration, VZO/F, F is bioavailability |
VZFP |
VZP for extravascular administration, VZP/F, F is bioavailability |
CLO |
clearance using AUCIFO, for intravascular administration |
CLP |
clearance using AUCIFP, for intravascular administration |
CLFO |
CLO for extravascular administration, CLO/F, F is bioavailability |
CLFP |
CLP for extravascular administration, CLP/F, F is bioavailability |
VSSO |
volume of distribution at steady state using CLST, for intravascular administration only |
VSSP |
volume of distribution at stead state using CLSTP, for intravascular administration only |
Author(s)
Kyun-Seop Bae <k@acr.kr>
See Also
Examples
# For one subject
txtNCA(Theoph[Theoph$Subject=="1","Time"], Theoph[Theoph$Subject=="1","conc"],
dose=320, doseUnit="mg", concUnit="mg/L", timeUnit="h")
# or equivalently
x = Theoph[Theoph$Subject=="1","Time"]
y = Theoph[Theoph$Subject=="1","conc"]
txtNCA(x, y, dose=320, doseUnit="mg", concUnit="mg/L", timeUnit="h")
# For all subjects
IDs = sort(as.numeric(unique(Theoph[,"Subject"])))
nID = length(IDs)
Res = vector()
for (i in 1:nID) {
tRes = txtNCA(Theoph[Theoph[,"Subject"]==IDs[i],"Time"],
Theoph[Theoph[,"Subject"]==IDs[i],"conc"],
dose=320, concUnit="mg/L", returnNA=FALSE)
tRes = c(paste("ID =", IDs[i]), tRes, "")
Res = c(Res, tRes)
}
Res