JointAI (version 0.5.1)

predDF: Create a new dataframe for prediction

Description

Build a data.frame for prediction, where one variable varies and all other variables are set to the reference value (median for continuous variables).

Usage

predDF(...)

# S3 method for JointAI predDF(object, var, ...)

# S3 method for formula predDF(formula, dat, var, ...)

Arguments

...

optional, additional arguments (currently not used)

object

object inheriting from class 'JointAI'

var

name of variable that should be varying

formula

a two sided model formula (see formula)

dat

original data

See Also

predict.JointAI, lme_imp, glm_imp, lm_imp

Examples

Run this code
# NOT RUN {
# fit a JointAI model
mod <- lm_imp(y~C1 + C2 + M2, data = wideDF, n.iter = 100)

# generate a dataframe with varying "C2" and reference values for all other variables in the model
newDF <- predDF(mod, var = "C2")

head(newDF)

# }

Run the code above in your browser using DataLab