get_model_matrix function

Extract or remake model matrix from model

Extract or remake model matrix from model

Extract or remake model matrix from model and potentially change the contrast coding

get_model_matrix(model, type = c("extract", "remake"), contrasts = "restore")

Arguments

  • model: an lm or lmerMod model object.
  • type: extract or remake model matrix?
  • contrasts: 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.

Returns

the model (or 'design') matrix.

Author(s)

Rune Haubo B Christensen

  • Maintainer: Rune Haubo Bojesen Christensen
  • License: GPL (>= 2)
  • Last published: 2020-10-23