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.
make.formulas(data, blocks = make.blocks(data), predictorMatrix = 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 |
A list of formula's.
f1 <- make.formulas(nhanes) f1#> $age #> age ~ 0 + bmi + hyp + chl #> <environment: 0x7fe182d25318> #> #> $bmi #> bmi ~ 0 + age + hyp + chl #> <environment: 0x7fe182d25318> #> #> $hyp #> hyp ~ 0 + age + bmi + chl #> <environment: 0x7fe182d25318> #> #> $chl #> chl ~ 0 + age + bmi + hyp #> <environment: 0x7fe182d25318> #>#> $collect #> age + bmi + hyp + chl ~ 0 #> <environment: 0x7fe182c51e08> #>#> [1] "age ~ 0 + bmi + hyp + chl" "bmi ~ 0 + age + hyp + chl" #> [3] "hyp ~ 0 + age + bmi + chl" "chl ~ 0 + age + bmi + hyp"#> $age #> age ~ 0 + bmi + hyp + chl #> <environment: 0x7fe1829b09b0> #> #> $bmi #> bmi ~ 0 + age + hyp + chl #> <environment: 0x7fe1829b09b0> #> #> $hyp #> hyp ~ 0 + age + bmi + chl #> <environment: 0x7fe1829b09b0> #> #> $chl #> chl ~ 0 + age + bmi + hyp #> <environment: 0x7fe1829b09b0> #>