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

model_get_model_matrix

Get the model matrix of a model


Description

The structure of the object returned by stats::model.matrix() could slightly differ for certain types of models. model_get_model_matrix() will always return an object with the same structure as stats::model.matrix.default().

Usage

model_get_model_matrix(model, ...)

## Default S3 method:
model_get_model_matrix(model, ...)

## S3 method for class 'multinom'
model_get_model_matrix(model, ...)

## S3 method for class 'clm'
model_get_model_matrix(model, ...)

## S3 method for class 'brmsfit'
model_get_model_matrix(model, ...)

Arguments

model

a model object

...

additional arguments passed to stats::model.matrix()

See Also

Examples

lm(hp ~ mpg + factor(cyl), mtcars) %>%
  model_get_model_matrix() %>%
  head()

broom.helpers

Helpers for Model Coefficients Tibbles

v1.3.0
GPL-3
Authors
Joseph Larmarange [aut, cre] (<https://orcid.org/0000-0001-7097-700X>), Daniel D. Sjoberg [aut] (<https://orcid.org/0000-0003-0862-2018>)
Initial release

We don't support your browser anymore

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