Creates a PK model
pkmodel.RdUse to create a PK model
Usage
pkmodel(
isPopulation = TRUE,
parameterization = "Clearance",
absorption = "Intravenous",
numCompartments = 1,
isClosedForm = TRUE,
isTlag = FALSE,
hasEliminationComp = FALSE,
isFractionExcreted = FALSE,
isSaturating = FALSE,
infusionAllowed = FALSE,
isDuration = FALSE,
isStdevFrozen = FALSE,
data = NULL,
columnMap = TRUE,
modelName = "",
workingDir = "",
...
)Arguments
- isPopulation
Is this a population model
TRUEor individual modelFALSE?- parameterization
Type of parameterization. Options are
"Clearance","Micro","Macro", or"Macro1".- absorption
Type of absorption. Options are
"Intravenous","FirstOrder","Gamma","InverseGaussian","Weibull".- numCompartments
Value of either
1,2, or3.- isClosedForm
Set to
TRUEto convert model from a differential equation to close form.- isTlag
Set to
TRUEto add a lag time parameter to the model.- hasEliminationComp
Set to
TRUEto add an elimination compartment to the model.- isFractionExcreted
Set to
TRUEif elimination compartment (hasEliminationComp = TRUE) contains a fraction excreted parameter.- isSaturating
Set to
TRUEto use Michaelis-Menten kinetics for elimination. Only applicable to models withparamteterization = "Clearance"- infusionAllowed
Set to
TRUEif infusions allowed.- isDuration
Set to
TRUEif infusions use duration instead of rate (must also setinfusionAllowed = TRUE).- isStdevFrozen
Set to
TRUEto freeze value of standard deviation of residual error variable.- data
Input dataset
- columnMap
If
TRUE(default) column mapping arguments are required. Set toFALSEto manually map columns after defining model usingcolMapping.- modelName
Model name for subdirectory created for model output in current working directory.
- workingDir
Working directory to run the model. Current working directory will be used if
workingDirnot specified.- ...
Arguments passed on to
pkmodel_MappingParametersIDColumn mapping argument for input dataset column(s) that identify individual data profiles. Only applicable to population models
isPopulation = TRUE.TimeColumn mapping argument that represents the input dataset column for the relative time used in a study and only applicable to time-based models.
A1Column mapping argument that represents the input dataset column for the amount of drug administered. Only applicable to the following types of models:
Models with
absorption = "Intravenous"and parameterization set to either"Clearance","Micro", or"Macro"Models with
absorptionset to either"Gamma","InverseGaussian", or"Weibull"
AaColumn mapping argument that represents the input dataset column for the amount of drug administered and only applicable to models with
absorption = "FirstOrder".AColumn mapping argument that represents the input dataset column for the amount of drug administered and only applicable to models with
absorption = "Intravenous"andparameterization = "Macro1".A1_RateColumn mapping argument that represents the input dataset column for the rate of drug administered. Only applicable to the following types of models:
Models with
absorption = "Intravenous",infusionAllowed = TRUEand parameterization set to either"Clearance","Micro"or"Macro"Models with
absorptionset to either"Gamma","InverseGaussian", or"Weibull"andinfusionAllowed = TRUE
A1_DurationColumn mapping argument that represents the input dataset column for the duration of drug administered. Only applicable to the following types of models:
Models with
absorption = "Intravenous",infusionAllowed = TRUEwithisDuration = TRUEand parameterization set to either"Clearance","Micro"or"Macro"Models with
absorptionset to either"Gamma","InverseGaussian", or"Weibull"andinfusionAllowed = TRUEwithisDuration = TRUE
Aa_RateColumn mapping argument that represents the input dataset column for the rate of drug administered and only applicable to models with
absorption = "FirstOrder",infusionAllowed = TRUE.Aa_DurationColumn mapping argument that represents the input dataset column for the duration of drug administered and only applicable to models with
absorption = "FirstOrder",infusionAllowed = TRUE, andisDuration = TRUE.A_RateColumn mapping argument that represents the input dataset column for the rate of drug administered and only applicable to models with
absorption = "Intravenous",infusionAllowed = TRUE, andparameterization = "Macro1".A_DurationColumn mapping argument that represents the input dataset column for the duration of drug administered and only applicable to models with
absorption = "Intravenous",infusionAllowed = TRUE,isDuration = TRUE, andparameterization = "Macro1".A1StripColumn mapping argument that represents the input dataset column for the stripping dose and only applicable to models with
parameterization = "Macro".CObsColumn mapping argument that represents the input dataset column for the observations of drug concentration in the central compartment and only applicable to models with
parameterizationbeing either set to either"Clearance"or"Micro".C1ObsColumn mapping argument that represents the input dataset column for the observations of drug concentration in the central compartment and only applicable to models with
parameterizationbeing either set to either"Macro"or"Macro1".A0ObsColumn mapping argument that represents the input dataset column for the observed amount of drug in the elimination compartment. (
hasEliminationComp = TRUE).
Column mapping
Note that quoted and unquoted column names are supported. Please see colMapping.
Examples
model <- pkmodel(
parameterization = "Clearance",
numCompartments = 2,
data = pkData,
ID = "Subject",
Time = "Act_Time",
A1 = "Amount",
CObs = "Conc",
workingDir = tempdir()
)
# View the model as well as its associated column mappings
print(model)
#>
#> Model Overview
#> -------------------------------------------
#> Model Name : Model_25_11_14_15_37
#> Working Directory : C:\Users\jcraig\AppData\Local\Temp\Rtmp8e5XX3
#> Is population : TRUE
#> Model Type : PK
#>
#> PK
#> -------------------------------------------
#> Parameterization : Clearance
#> Absorption : Intravenous
#> Num Compartments : 2
#> Dose Tlag? : FALSE
#> Elimination Comp ?: FALSE
#> Infusion Allowed ?: FALSE
#> Sequential : FALSE
#> Freeze PK : FALSE
#>
#> PML
#> -------------------------------------------
#> test(){
#> cfMicro(A1,Cl/V, Cl2/V, Cl2/V2)
#> dosepoint(A1)
#> C = A1 / V
#> error(CEps=0.1)
#> observe(CObs=C * ( 1 + CEps))
#> stparm(V = tvV * exp(nV))
#> stparm(Cl = tvCl * exp(nCl))
#> stparm(V2 = tvV2 * exp(nV2))
#> stparm(Cl2 = tvCl2 * exp(nCl2))
#> fixef( tvV = c(,1,))
#> fixef( tvCl = c(,1,))
#> fixef( tvV2 = c(,1,))
#> fixef( tvCl2 = c(,1,))
#> ranef(diag(nV,nCl,nV2,nCl2) = c(1,1,1,1))
#> }
#>
#> Structural Parameters
#> -------------------------------------------
#> V Cl V2 Cl2
#> -------------------------------------------
#> Observations:
#> Observation Name : CObs
#> Effect Name : C
#> Epsilon Name : CEps
#> Epsilon Type : Multiplicative
#> Epsilon frozen : FALSE
#> is BQL : FALSE
#> -------------------------------------------
#> Column Mappings
#> -------------------------------------------
#> Model Variable Name : Data Column name
#> id : Subject
#> time : Act_Time
#> A1 : Amount
#> CObs : Conc
#>