Create PK linear model
pklinearmodel.RdUse to create a PK/PD model with PD described by either constant, linear, or quadratic model
Usage
pklinearmodel(
isPopulation = TRUE,
parameterization = "Clearance",
absorption = "Intravenous",
numCompartments = 1,
isClosedForm = TRUE,
isTlag = FALSE,
hasEliminationComp = FALSE,
isFractionExcreted = FALSE,
isSaturating = FALSE,
infusionAllowed = FALSE,
isDuration = FALSE,
isSequential = FALSE,
isPkFrozen = FALSE,
hasEffectsCompartment = FALSE,
linearType = "Constant",
isLinearFrozen = 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).- isSequential
Set to
TRUEto freeze PK fixed effects and convert the corresponding random effects into covariates as well as remove the PK observed variable from the model.- isPkFrozen
Set to
TRUEto freeze PK fixed effects and remove the corresponding random effects as well as the PK observed variable from the model.- hasEffectsCompartment
Set to
TRUEto include an effect compartment into the model.- linearType
Type of PD model; Options are
"Constant","Linear","Quadratic".- isLinearFrozen
Set to
TRUEto freeze PD fixed effects and remove the corresponding random effects as well as the PD observed variable from the model.- 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
pkindirectmodel_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).EObsColumn mapping argument that represents the input dataset column for the observed drug effect.
nVIf
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnV.nV2If
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnV2.nV3If
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnV3.nClIf
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnCl.nCl2If
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnCl2.nCl3If
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnCl3.nKaIf
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnKa.nAIf
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnA.nAlphaIf
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnAlpha.nBIf
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnB.nBetaIf
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnBeta.nCIf
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnC.nGammaIf
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnGamma.nKeIf
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnKe.nK12If
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnK12.nK21If
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnK21.nK13If
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnK13.nK31If
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnK31.nTlagIf
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnTlag.nKmIf
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnKm.nVmaxIf
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnVmax.nFeIf
isSequential = TRUEandisFractionExcreted = TRUE, mapped to the input dataset column that lists the values for random effectnFe.nMeanDelayTimeIf
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnMeanDelayTime.nShapeParamIf
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnShapeParam.nShapeParamMinusOneIf
isSequential = TRUE, mapped to the input dataset column that lists the values for random effectnShapeParamMinusOne.
Column mapping
Note that quoted and unquoted column names are supported. Please see colMapping.
Examples
model <- pklinearmodel(
parameterization = "Clearance",
linearType = "Constant",
data = pkpdData,
ID = "ID",
Time = "Time",
A1 = "Dose",
CObs = "CObs",
EObs = "EObs"
)
# View the model as well as its associated column mappings
print(model)
#>
#> Model Overview
#> -------------------------------------------
#> Model Name : Model_25_08_06_07_13
#> Working Directory : C:/Repos/R-RsNLME/docs/reference/Model_25_08_06_07_13
#> Is population : TRUE
#> Model Type : PK_LINEAR
#>
#> PK
#> -------------------------------------------
#> Parameterization : Clearance
#> Absorption : Intravenous
#> Num Compartments : 1
#> Dose Tlag? : FALSE
#> Elimination Comp ?: FALSE
#> Infusion Allowed ?: FALSE
#> Sequential : FALSE
#> Freeze PK : FALSE
#>
#> Linear
#> -------------------------------------------
#> Linear Type : E = EAlpha
#> Linear Frozen : FALSE
#> Effect Compartment: FALSE
#>
#> PML
#> -------------------------------------------
#> test(){
#> cfMicro(A1,Cl/V)
#> dosepoint(A1)
#> C = A1 / V
#> E = EAlpha
#> error(EEps=1)
#> observe(EObs=E + EEps)
#> error(CEps=0.1)
#> observe(CObs=C * ( 1 + CEps))
#> stparm(V = tvV * exp(nV))
#> stparm(Cl = tvCl * exp(nCl))
#> stparm(EAlpha = tvEAlpha * exp(nEAlpha))
#> fixef( tvV = c(,1,))
#> fixef( tvCl = c(,1,))
#> fixef( tvEAlpha = c(,1,))
#> ranef(diag(nV,nCl,nEAlpha) = c(1,1,1))
#> }
#>
#> Structural Parameters
#> -------------------------------------------
#> V Cl EAlpha
#> -------------------------------------------
#> Observations:
#> Observation Name : EObs
#> Effect Name : E
#> Epsilon Name : EEps
#> Epsilon Type : Additive
#> Epsilon frozen : FALSE
#> is BQL : FALSE
#> -------------------------------------------
#> 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 : ID
#> time : Time
#> A1 : Dose
#> EObs : EObs
#> CObs : CObs
#>