Skip to contents

Convenience helper to construct a model matrix using subject-level covariates already attached to a plan via with_col_data() or stored in a realised GDS.

Usage

model_matrix(x, formula)

Arguments

x

A gds or gds_plan (or an object coercible via as_plan())

formula

Model formula (or string convertible via stats::as.formula)

Value

A numeric model matrix