Extract or remake model matrix from model and potentially change the contrast coding
get_model_matrix(model, type = c("extract", "remake"), contrasts = "restore")
an lm
or lmerMod
model object.
extract or remake model matrix?
contrasts settings. These may be restored to those in the
model or they may be changed. If a length one character vector (e.g.
"contr.SAS"
) this is applied to all factors in the model, but it can
also be a list naming factors for which the contrasts should be set as specified.
the model (or 'design') matrix.