| make.formulas.saturated | R Documentation |
formulas ArgumentThis helper function creates a valid formulas object.
The formulas object is an argument to the mice::mice function.
It is a list of formulas that specifies the target variables and the predictors
by means of the standard ~ operator. In contrast to mice::make.formulas,
which creates main effects formulas, make.formulas.saturated
creates formulas including interaction effects.
make.formulas.saturated(
data,
blocks = mice::make.blocks(data),
predictorMatrix = NULL,
d = NULL
)
data |
A |
blocks |
An optional specification for blocks of variables in the rows. The default assigns each variable in its own block. |
predictorMatrix |
A |
d |
maximum depth of interactions to be considered (1=no interactions, 2=two-way interactions, etc.) |
A list of formulas.
A modification of mice::make.formulas by Stef van Buuren et al.
mice::make.formulas
## main effects model:
data(nhanes)
f1 <- make.formulas(nhanes)
f1
## saturated model:
f2 <- make.formulas.saturated(nhanes)
f2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.