Adding covariate to a given variable in an nlmixr model expression

addCovVar(
  fitobject,
  varName,
  covariate,
  norm = c("median", "mean", "autoscale"),
  norm_type = c("mul", "div", "sub", "add", "autoscale"),
  categorical = FALSE,
  isHS = FALSE,
  initialEst = 0,
  initialEstLB = -Inf,
  initialEstUB = Inf
)

Arguments

fitobject

an nlmixr 'fit' object

varName

a string giving the variable name to which covariate needs to be added

covariate

a string giving the covariate name; must be present in the data used for 'fit'

norm

the kind of normalization to be used while normalizing covariates; must be either 'mean' or 'median'

norm_type

a string defining operator to be used for transforming covariates using 'norm'; must be one among 'mul', 'div', 'sub', 'add'

categorical

a boolean indicating if the 'covariate' is categorical

isHS

a boolean indicating if 'covariate' is of Hockey-stick kind

initialEst

the initial estimate for the covariate parameters to be estimated; default is 0

initialEstLB

a lower bound for the covariate parameters to be estimated; default is -Inf

initialEstUB

an upper bound for the covariate parameters to be estimated; default is Inf

Value

a list with the updated model expression and data with columns corresponding to normalized covaraite(s) appended

Author

Vipul Mann, Matthew Fidler