Description Usage Arguments Value See Also Examples
This helper function creates a valid formulas
object. The
formulas
object is an argument to the mice
function.
It is a list of formula's that specifies the target variables and
the predictors by means of the standard ~
operator.
1 | make.formulas(blocks, predictorMatrix)
|
blocks |
An optional specification for blocks of variables in the rows. The default assigns each variable in its own block. |
predictorMatrix |
A |
data |
A |
A list of formula's.
make.blocks
, make.predictorMatrix
1 2 3 4 5 6 7 8 9 10 11 12 | f1 <- make.formulas(nhanes)
f1
f2 <- make.formulas(nhanes, blocks = make.blocks(nhanes, "collect"))
f2
# for editing, it may be easier to work with the character vector
c1 <- as.character(f1)
c1
# fold it back into a formula list
f3 <- name.formulas(lapply(c1, as.formula))
f3
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.