Pkr Manual

pkr-manual

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 38

DownloadPkr-manual
Open PDF In BrowserView PDF
Package ‘pkr’
June 4, 2018
Version 0.1.2
Date 2018-06-04
Title Pharmacokinetics in R
Description Conduct a noncompartmental analysis as closely as possible to the most widely used commercial software for pharmacokinetic analysis, i.e. 'Phoenix(R) WinNonlin(R)' .
Some features are
1) CDISC SDTM terms
2) Automatic slope selection with the same criterion of WinNonlin(R)
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 (>= 2.0.0), foreign, binr, forestplot, rtf
Author Kyun-Seop Bae [aut], Jee Eun Lee [aut]
Maintainer Kyun-Seop Bae 
Copyright 2017, Kyun-Seop Bae, Jee Eun Lee
License GPL-3
NeedsCompilation no
Repository CRAN
URL https://cran.r-project.org/package=pkr

R topics documented:
pkr-package
AUC . . . .
BestSlope .
combXPT .
foreNCA .
IndiNCA .
IntAUC . .
Interpol . .
LinAUC . .
loadEXPC .
LogAUC . .
NCA . . . .

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
1

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

2
3
4
5
6
7
10
11
12
13
13
14

2

pkr-package
NCA0 .
pdfNCA
plotFit .
plotPK .
readEX
readPC .
rNCA .
Round .
RptCfg .
rtfNCA
Slope .
sNCA .
tblNCA
txtNCA
Unit . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

Index

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

17
18
20
22
23
23
24
25
26
27
29
30
33
34
36
38

pkr-package

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 , Jee Eun Lee 
References
1. Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts
and Applications. 5th ed. 2016.
2. Shargel L, Yu A. Applied Biopharmaceutics and Pharmacokinetics. 7th ed. 2015.
3. Rowland M, Tozer TN. Clinical Pharmacokinetics and Pharmacodynamics - Concepts and
Applications. 4th ed. 2011.
4. Gibaldi M, Perrier D. Pharmacokinetics. 2nd ed. revised and expanded. 1982.

AUC

3

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")

AUC

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
y
down

vector values of independent variable, usually time
vector values of dependent variable, usually concentration
either of "Linear" or "Log" to indicate the way to calculate AUC and AUMC

4

BestSlope

Details
down="Linear" means linear trapezoidal rule with linear interpolation. down="Log" means linearup 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 
References
Rowland M, Tozer TN. Clinical Pharmacokinetics and Pharmacodynamics - Concepts and Applications. 4th ed. pp687-689. 2011.
See Also
LinAUC, LogAUC
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")

BestSlope

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 "Bolus" or "Infusion" or "Extravascular" to indicate drug administration mode

TOL

tolerance. See Phoneix WinNonlin 6.4 User’s Guide p33 for the detail.

combXPT

5

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 
See Also
Slope
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")

combXPT

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

6

foreNCA

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 
See Also
help, readEX, readPC

Forest plot to compare NCA results

foreNCA

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 
See Also
help, rNCA

IndiNCA

IndiNCA

7

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 "Linear" or "Log" to indicate the way to calculate AUC and AUMC

adm

one of "Bolus" or "Infusion" or "Extravascular" to indicate drug administration mode

dur

infusion duration for constant infusion, otherwise 0

report

either of "Table" or "Text" to specify the type of return value

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

8

IndiNCA
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

IndiNCA

9

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 
References
1. Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts
and Applications. 5th ed. 2016.
2. Shargel L, Yu A. Applied Biopharmaceutics and Pharmacokinetics. 7th ed. 2015.
3. Rowland M, Tozer TN. Clinical Pharmacokinetics and Pharmacodynamics - Concepts and
Applications. 4th ed. 2011.
4. Gibaldi M, Perrier D. Pharmacokinetics. 2nd ed. revised and expanded. 1982.
See Also
AUC, BestSlope

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")

10

IntAUC

Calculate interval AUC

IntAUC

Description
It calculates interval AUC
Usage
IntAUC(x, y, t1, t2, Res, down = "Linear")
Arguments
x
y
t1
t2
Res
down

vector values of independent variable, usually time
vector values of dependent variable, usually concentration
start time for AUC
end time for AUC
result from IndiNCA function
either of "Linear" or "Log" to indicate the way to calculate AUC

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 
References
1. Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts
and Applications. 5th ed. 2016.
2. Shargel L, Yu A. Applied Biopharmaceutics and Pharmacokinetics. 7th ed. 2015.
3. Rowland M, Tozer TN. Clinical Pharmacokinetics and Pharmacodynamics - Concepts and
Applications. 4th ed. 2011.
4. Gibaldi M, Perrier D. Pharmacokinetics. 2nd ed. revised and expanded. 1982.
See Also
AUC, Interpol
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)

Interpol

Interpol

11

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 "Linear" or "Log" to indicate the way to interpolate

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 
See Also
IntAUC
Examples
x = 10:1 + 0.1
y = -2*x + 40.2
Interpol(x, y, 1.5)
Interpol(x, y, 1.5, down="Log")

12

LinAUC

LinAUC

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 
References
1. Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts
and Applications. 5th ed. 2016.
2. Shargel L, Yu A. Applied Biopharmaceutics and Pharmacokinetics. 7th ed. 2015.
3. Rowland M, Tozer TN. Clinical Pharmacokinetics and Pharmacodynamics - Concepts and
Applications. 4th ed. 2011.
4. Gibaldi M, Perrier D. Pharmacokinetics. 2nd ed. revised and expanded. 1982.
See Also
LogAUC, AUC
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

loadEXPC

13

Load EX and PC domain files in folders

loadEXPC

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 
See Also
help, readEX, readPC

LogAUC

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

14

NCA

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 
References
1. Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts
and Applications. 5th ed. 2016.
2. Shargel L, Yu A. Applied Biopharmaceutics and Pharmacokinetics. 7th ed. 2015.
3. Rowland M, Tozer TN. Clinical Pharmacokinetics and Pharmacodynamics - Concepts and
Applications. 4th ed. 2011.
4. Gibaldi M, Perrier D. Pharmacokinetics. 2nd ed. revised and expanded. 1982.
See Also
LinAUC,AUC
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")

NCA

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")

NCA

15

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 "Linear" or "Log" to indicate the way to calculate AUC

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 "Bolus" or "Infusion" or "Extravascular" to indicate drug administration mode

dur

infusion duration for constant infusion, otherwise 0. This can be a vector containing values for each subject in order.

report

either of "Table" or "Text" to specify the type of return value

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 IndiNCA 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

16

NCA
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

NCA0

17

Author(s)
Kyun-Seop Bae 
References
1. Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts
and Applications. 5th ed. 2016.
2. Shargel L, Yu A. Applied Biopharmaceutics and Pharmacokinetics. 7th ed. 2015.
3. Rowland M, Tozer TN. Clinical Pharmacokinetics and Pharmacodynamics - Concepts and
Applications. 4th ed. 2011.
4. Gibaldi M, Perrier D. Pharmacokinetics. 2nd ed. revised and expanded. 1982.
See Also
sNCA
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")

NCA0

NCA of SDTM data for single subject

Description
This performs Noncompartmental Analysis(NCA) for only one subject from the CDISC EX and PC
domain.
Usage
NCA0(EX0, PC0, fit="Linear")

18

pdfNCA

Arguments
EX0
PC0
fit

Data of one subject from EX domain
Data of one subject from PC domain
either of "Linear" or "Log" to indicate the way to calculate AUC and AUMC

Details
This calls IndiNCA function. This is called by rNCA function.
Value
This returns NCA results vector.
Author(s)
Kyun-Seop Bae 
See Also
help, rNCA, sNCA

pdfNCA

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
concData
colSubj
colTime
colConc
dose
adm
dur
doseUnit
timeUnit
concUnit
down
MW

file name to save
concentration data table
column name for subject ID
column name for time
column name for concentration
administered dose
one of "Bolus" or "Infusion" or "Extravascular" to indicate drug administration mode
duration of infusion
unit of dose
unit of time
unit of concentration
either of "Linear" or "Log" to indicate the way to calculate AUC and AUMC
molecular weight of drug

pdfNCA

19

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

20

plotFit
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 
See Also
help, txtNCA, rtfNCA
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")

plotFit

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 = "")

plotFit

21

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 "Bolus" or "Infusion" or "Extravascular" to indicate drug administration mode

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 
See Also
BestSlope
Examples
plotFit(Theoph, "Subject", "Time", "conc", ID="1")
plotFit(Indometh, "Subject", "time", "conc", adm="Bolus", ID="1")

22

plotPK

plotPK

Plot concentration vs. time curve for individuals and collectively.

Description
Generates individual and superposed concentration vs. time curve and save it in pdf files.
Usage
plotPK(concData, id, Time, conc, unitTime = "hr", unitConc = "ng/mL", trt = "",
fit = "Linear", dose = 0, adm = "Extravascular", dur = 0, outdir = "Output")
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 "Linear" or "Log" to indicate the way to calculate AUC

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 "Bolus" or "Infusion" or "Extravascular" to indicate drug administration mode

dur

infusion duration for constant infusion, otherwise 0. This can be a vector containing values for each subject in order.

outdir

name of the folder to be used for the output files

Details
This function generates plots for individual and summary concentration vs. time curve. This function calles NCA().
Value
This function saves pdf files and tiff files in the outdir folder.
Author(s)
Jee Eun Lee 
See Also
NCA

readEX

23

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)

Read EX domain files

readEX

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 
See Also
help, combXPT, loadEXPC

readPC

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

24

rNCA

Details
This calls combXPT function. This is called by loadEXPC function.
Value
This returns combined table of PC doamin.
Author(s)
Kyun-Seop Bae 
See Also
help, combXPT, loadEXPC

rNCA

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", "
See Also
help, NCA0, loadEXPC, foreNCA

Round Half Away from Zero

Round

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 
References
See wikipedia subject "Rounding"
Examples
(x = 1:10 - 0.5)
Round(x)
round(x) # compare with the above

26

RptCfg

RptCfg

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.
PPTESTCD a character vector of CDISC SDTM PPTESTCD
SYNONYM a character vector of CDISC SDTM PPTESTCD Synonym
NCI a character vector of NCI peferred terms
WNL a character vector of WinNonlin(R) software variables
ExtravascularDefault a numeric vector of ordering in report for extravascular administration,
Zero means exclusion in the report.
ExtravascularWNL a numeric vector of WinNonlin(R) style ordering in report for extravascular
administration, Zero means exclusion in the report.
BolusDefault a numeric vector of ordering in report for extravascular administration, Zero means
exclusion in the report.
BolusWNL a numeric vector of WinNonlin(R) style ordering in report for extravascular administration, Zero means exclusion in the report.
InfusionDefault a numeric vector of ordering in report for extravascular administration, Zero
means exclusion in the report.
InfusionWNL a 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.

rtfNCA

rtfNCA

27

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 "Bolus" or "Infusion" or "Extravascular" to indicate drug administration mode

dur

duration of infusion

doseUnit

unit of dose

timeUnit

unit of time

concUnit

unit of concentration

down

either of "Linear" or "Log" to indicate the way to calculate AUC and AUMC

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

28

rtfNCA
LAMZNPT
CORRXY
R2
R2ADJ
C0
AUCLST
AUCALL
AUCIFO
AUCIFOD
AUCIFP
AUCIFPD
AUCPEO
AUCPEP
AUCPBEO
AUCPBEP
AUMCLST
AUMCIFO
AUMCIFP
AUMCPEO
AUMCPEP
MRTIVLST
MRTIVIFO
MRTIVIFP
MRTEVLST
MRTEVIFO
MRTEVIFP
VZO
VZP
VZFO
VZFP
CLO
CLP
CLFO
CLFP
VSSO
VSSP

number of points for LAMZ
correlation of log(concentration) and time
R-squared
R-squared adjusted
back extrapolated concentration at time 0, for bolus intravascular administration
only
AUC from 0 to TLST
AUC using all the given points, including trailing zero concentrations
AUC infinity observed
AUCIFO / Dose
AUC infinity predicted using CLSTP instead of CLST
AUCIFP / Dose
AUC % extrapolation observed
AUC % extrapolated for AUCIFP
AUC % back extrapolation observed, for bolus IV administration only
AUC % back extrapolation predicted with AUCIFP, for bolus IV administration
only
AUMC to the TLST
AUMC infinity observed using CLST
AUMC infinity determined by CLSTP
AUMC % extrapolated observed
AUMC % extrapolated predicted
mean residence time (MRT) to TLST, for intravascular administration
mean residence time (MRT) infinity using CLST, for intravascular administration
mean residence time (MRT) infinity using CLSTP, for intravascular administration
mean residence time (MRT) to TLST, for extravascular administration
mean residence time (MRT) infinity using CLST, for extravascular administration
mean residence time (MRT) infinity using CLSTP, for extravascular administration
volume of distribution determined by LAMZ and AUCIFO, for intravascular
administration
volume of distribution determined by LAMZ and AUCIFP, for intravascular administration
VZO for extravascular administration, VZO/F, F is bioavailability
VZP for extravascular administration, VZP/F, F is bioavailability
clearance using AUCIFO, for intravascular administration
clearance using AUCIFP, for intravascular administration
CLO for extravascular administration, CLO/F, F is bioavailability
CLP for extravascular administration, CLP/F, F is bioavailability
volume of distribution at steady state using CLST, for intravascular administration only
volume of distribution at stead state using CLSTP, for intravascular administration only

Slope

29

Author(s)
Kyun-Seop Bae 
See Also
help, txtNCA, pdfNCA
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")

Slope

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

30

sNCA

Author(s)
Kyun-Seop Bae 
See Also
BestSlope
Examples
Slope(Indometh[Indometh$Subject==1, "time"], Indometh[Indometh$Subject==1, "conc"])

sNCA

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)
Arguments
x

usually time

y

usually concentration

dose

given amount

adm

one of "Bolus" or "Infusion" or "Extravascular" to indicate drug administration mode

dur

duration of infusion

doseUnit

unit of dose

timeUnit

unit of time

concUnit

unit of concentration

iAUC

interval AUCs to calculate

down

either of "Linear" or "Log" to indicate the way to calculate AUC and AUMC

MW

molecular weight of the drug

returnNA

if returnNA is TRUE, it returns NA values also.

Details
This will replace IndiNCA.

sNCA

31

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

32

sNCA
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 
References
Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts and
Applications. 5th ed. 2016.
See Also
help, tblNCA
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,
sNCA(x,
sNCA(x,
sNCA(x,

y/MW, dose=320, doseUnit="mg", concUnit="mmol/L", timeUnit="h")
y/MW, dose=320, doseUnit="mg", concUnit="mmol/L", timeUnit="h", MW=MW)
y, dose=320/MW, doseUnit="mmol", concUnit="mg/L", timeUnit="h", MW=MW)
y/MW, dose=320/MW, doseUnit="mmol", concUnit="mmol/L", timeUnit="h", MW=MW)

tblNCA

33

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

tblNCA

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 "Bolus" or "Infusion" or "Extravascular" to indicate drug administration mode

dur

duration of infusion

doseUnit

unit of dose

timeUnit

unit of time

concUnit

unit of concentration

down

method to calculate AUC, "Linear" or "Log"

MW

molecular weight of drug

returnNA

if returnNA is TRUE, it returns NA values also.

Value
Basically same with sNCA
Author(s)
Kyun-Seop Bae 

34

txtNCA

See Also
help, sNCA
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")

txtNCA

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 "Bolus" or "Infusion" or "Extravascular" to indicate drug administration mode

dur

duration of infusion

doseUnit

unit of dose

timeUnit

unit of time

concUnit

unit of concentration

iAUC

interval AUCs to calculate

down

either of "Linear" or "Log" to indicate the way to calculate AUC and AUMC

MW

molecular weight of the drug

returnNA

if returnNA is TRUE, it returns NA values also.

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

txtNCA

35

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

36

Unit
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 
See Also
help, pdfNCA, rtfNCA
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

Unit

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)

Unit

37

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 
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")

Index
∗Topic AUC
AUC, 3
IntAUC, 10
LinAUC, 12
LogAUC, 13
∗Topic Forest Plot
foreNCA, 6
∗Topic NCA
IndiNCA, 7
NCA, 14
NCA0, 17
pkr-package, 2
rNCA, 24
∗Topic Output Form
pdfNCA, 18
rtfNCA, 27
sNCA, 30
tblNCA, 33
txtNCA, 34
∗Topic Plot
plotFit, 20
plotPK, 22
∗Topic Slope
BestSlope, 4
∗Topic XPT
combXPT, 5
loadEXPC, 13
readEX, 23
readPC, 23
∗Topic datasets
RptCfg, 26
∗Topic interpolation
Interpol, 11
∗Topic interval AUC
IntAUC, 10
Interpol, 11
∗Topic noncompartmenal
IndiNCA, 7
∗Topic package
pkr-package, 2
∗Topic partial AUC
IntAUC, 10
Interpol, 11

∗Topic rounding
Round, 25
∗Topic round
Round, 25
∗Topic slope
Slope, 29
AUC, 3, 9, 10, 12, 14
BestSlope, 4, 9, 21, 30
combXPT, 5, 23, 24
foreNCA, 6, 25
help, 6, 13, 18, 20, 23–25, 29, 32, 34, 36
IndiNCA, 7
IntAUC, 10, 11
Interpol, 10, 11
LinAUC, 4, 12, 14
loadEXPC, 13, 23–25
LogAUC, 4, 12, 13
NCA, 14, 22
NCA0, 17, 25
pdfNCA, 18, 29, 36
pkr (pkr-package), 2
pkr-package, 2
plotFit, 20
plotPK, 22
readEX, 6, 13, 23
readPC, 6, 13, 23
rNCA, 6, 18, 24
Round, 25
RptCfg, 26
rtfNCA, 20, 27, 36

analysis

Slope, 5, 29
sNCA, 17, 18, 30, 33, 34
tblNCA, 32, 33
txtNCA, 20, 29, 34
Unit, 36
38



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.5
Linearized                      : No
Author                          : 
Create Date                     : 2018:06:04 19:18:30+09:00
Creator                         : LaTeX with hyperref package
Modify Date                     : 2018:06:04 19:18:30+09:00
PTEX Fullbanner                 : This is MiKTeX-pdfTeX 2.9.6354 (1.40.18)
Producer                        : pdfTeX-1.40.18
Subject                         : 
Title                           : 
Trapped                         : False
Page Mode                       : UseOutlines
Page Count                      : 38
EXIF Metadata provided by EXIF.tools

Navigation menu