Skip to contents

Get contrasts used in the model

Usage

model_get_contrasts(model)

# S3 method for class 'model_fit'
model_get_contrasts(model)

# S3 method for class 'zeroinfl'
model_get_contrasts(model)

# S3 method for class 'hurdle'
model_get_contrasts(model)

# S3 method for class 'betareg'
model_get_contrasts(model)

Arguments

model

(a model object, e.g. glm)
A model object.

Examples

glm(
  am ~ mpg + factor(cyl),
  data = mtcars,
  family = binomial,
  contrasts = list(`factor(cyl)` = contr.sum)
) |>
  model_get_contrasts()
#> $`factor(cyl)`
#>   [,1] [,2]
#> 4    1    0
#> 6    0    1
#> 8   -1   -1
#>