# fit a JointAI model
mod <- lm_imp(y ~ C1 + C2 + M2, data = wideDF, n.iter = 100)
# generate a data frame with varying "C2" and reference values for all other
# variables in the model
newDF <- predDF(mod, vars = ~ C2)
head(newDF)
newDF2 <- predDF(mod, vars = ~ C2 + M2,
C2 = seq(-0.5, 0.5, 0.25),
M2 = levels(wideDF$M2)[2:3])
newDF2
Run the code above in your browser using DataLab