Learn R Programming

JointAI (version 0.6.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(object, ...)

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

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

Arguments

object

object inheriting from class 'JointAI'

...

optional, additional arguments (currently not used)

var

name of variable that should be varying

length

number of values used in the sequence when var is continuous

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