Learn R Programming

lmerTest (version 3.1-3)

get_model_matrix: Extract or remake model matrix from model

Description

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

Usage

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.

Value

the model (or 'design') matrix.