Add Covariate into PML models

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 is Forward. Interpolate is only applicable to Type == "Continuous".

Center

A character string (None, Mean or Median) or numeric value representing the center of the Covariate. Default is None. Valid only if Type == "Continuous".

Categories

A numeric vector representing the categories (at least two) of the covariate. Applicable only if Type is either Occasion or Categorical. 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 get_PMLParametersSets().

Value

An updated list of PML models (PMLModels class instance) matching the specified options.

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 with modify_Omega().

See also

Examples

PMLParametersSets <- get_PMLParametersSets()

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