Function to return data of normalized covariates
normalizedData(data, covarsVec, replace = TRUE)
data
: a dataframe with covariates to normalizecovarsVec
: a list of covariate names (parameters) that need to be estimatesreplace
: replace the original covariate data with normalized data for easier updated model.data frame with all normalized covariates
d <- nlmixr2data::theo_sd d$SEX <-0 d$SEX[d$ID<=6] <-1 covarsVec <- c("WT") # Normalized covariate (replaced) df1 <- normalizedData(d,covarsVec,replace=TRUE) # Normalized covariate (without replacement) df2 <- normalizedData(d,covarsVec,replace=FALSE)
Vishal Sarsani
Useful links