| construct.blocks {mice} | R Documentation |
Construct blocks from formulas and predictorMatrix
Description
This helper function attempts to find blocks of variables in the
specification of the formulas and/or predictorMatrix
objects. Blocks specified by formulas may consist of
multiple variables. Blocks specified by predictorMatrix are
assumed to consist of single variables. Any duplicates in names are
removed, and the formula specification is preferred.
predictorMatrix and formulas. When both arguments
specify models for the same block, the model for the
predictMatrix is removed, and priority is given to the
specification given in formulas.
Usage
construct.blocks(formulas = NULL, predictorMatrix = NULL)
Arguments
formulas |
A named list of formula's, or expressions that
can be converted into formula's by |
predictorMatrix |
A numeric matrix of |
Value
A blocks object.
See Also
Examples
form <- name.formulas(list(bmi + hyp ~ chl + age, chl ~ bmi))
pred <- make.predictorMatrix(nhanes[, c("age", "chl")])
construct.blocks(formulas = form, pred = pred)