Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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.

Author(s)

Rune Haubo B Christensen


lmerTest

Tests in Linear Mixed Effects Models

v3.1-3
GPL (>= 2)
Authors
Alexandra Kuznetsova [aut], Per Bruun Brockhoff [aut, ths], Rune Haubo Bojesen Christensen [aut, cre], Sofie Pødenphant Jensen [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.