Add Covariate into PML models
add_Covariate.Rd
Add Covariate into PML models
Usage
add_Covariate(
PMLParametersSets,
Name,
Type = "Continuous",
StParmNames = NULL,
State = "Present",
Direction = "Forward",
Center = "None",
Categories = c(),
PMLStructures = NULL
)
Arguments
- PMLParametersSets
A list of PML parameters sets (
PMLModels
class instance).- Name
A character string representing the name of the covariate to be added.
- Type
A character specifying the type of the covariate. Possible values are:
Continuous
A covariate can take values on a continuous scale.Categorical
A covariate can only take a finite number of values.Occasion
The associated PK parameter may vary within an individual from one event to the next, called interoccasion variability.
- StParmNames
Character or character vector specifying names of structural parameters to which covariates should be added. Can be set to
NULL
or not specified, for such case, covariate will be added to all structural parameters.- State
A character string representing the presence of the covariate on the structural parameters. Possible values are:
None
The covariate does not have an effect on any structural parameter.Present
The covariate has an effect on the structural parameters (the default).Searched
The effect of the covariate on structural parameters is searched.
- Direction
A character string representing the direction of the Covariate. Options are
Forward
,Backward
,Interpolate
. Default isForward
.Interpolate
is only applicable toType == "Continuous"
.- Center
A character string (
None
,Mean
orMedian
) or numeric value representing the center of the Covariate. Default isNone
. Valid only ifType == "Continuous"
.- Categories
A numeric vector representing the categories (at least two) of the covariate. Applicable only if
Type
is eitherOccasion
orCategorical
. The first category is set to the reference category for categorical covariate.- PMLStructures
Character or character vector specifying names of PML structures to which the covariate will be added. For the naming covention of PMLStructures, see Details section of
create_ModelPK()
for PK models andcreate_ModelPD()
for PD models.
Details
If Covariate already exists, it will be substituted with a new instance with given properties. New covariate will have default bound omegas/thetas. The user can change thetas with
modify_Theta()
and omegas withmodify_Omega()
.The current functionality does not support adding or modifying custom covariates that are defined within the PML code of custom model spaces.
See also
list_Covariates()
modify_Theta()
modify_Omega()
Functions used for Covariate specification:
Covariate()
,
create_ModelPD()
,
create_ModelPK()
,
remove_Covariate()
Examples
PMLParametersSets <- create_ModelPK()
PMLParametersSetsWT <-
add_Covariate(PMLParametersSets,
Name = "WT",
Type = "Continuous",
State = "Present",
Direction = "Forward",
Center = 70)
PMLParametersSetsWTCL <-
add_Covariate(PMLParametersSets = PMLParametersSetsWT,
Name = "Race",
Type = "Categorical",
State = "Searched",
Direction = "Backward",
Categories = c(1,2,3),
StParmNames = "Cl",
PMLStructure = "PK1IVC")