Learn R Programming

RItools (version 0.3-3)

model_matrix: Model matrices along with compact encodings of data availability/missingness

Description

Grow a model matrix while at the same time compactly encoding missingness patterns in RHS variables of a model frame.

Usage

model_matrix(object, data = environment(object), remove.intercept = TRUE, ...)

Value

ModelMatrixPlus, i.e. model matrix enriched with missing data info

Arguments

object

Model formula or terms object (as in `model.matrix`)

data

data.frame, as in `model.matrix()` but has to have ‘(weights)’ column

remove.intercept

logical

...

passed to `model.matrix.default` (and further)

Author

Ben B Hansen