d <- nlmixr2data::theo_sd
d$SEX <-0
d$SEX[d$ID<=6] <-1
covarsVec <- c("WT")
# Stratified cross-validation data with CMT
df1 <- foldgen(d, nfold=5, stratVar="CMT")
# Stratified cross-validation data with ID (individual)
df2 <- foldgen(d, nfold=5, stratVar=NULL)
Run the code above in your browser using DataLab