Add Covariate into PML models
add_Covariate.RdAdd 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 (
PMLModelsclass 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:
ContinuousA covariate can take values on a continuous scale.CategoricalA covariate can only take a finite number of values.OccasionThe 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
NULLor 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:
NoneThe covariate does not have an effect on any structural parameter.PresentThe covariate has an effect on the structural parameters (the default).SearchedThe 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.Interpolateis only applicable toType == "Continuous".- Center
A character string (
None,MeanorMedian) 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
Typeis eitherOccasionorCategorical. The first category is set to the reference category for categorical covariate. If a named vector is used, the names are used as labels for the given dataset,- 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")