Skip to contents

The structure of the object returned by stats::model.frame() could slightly differ for certain types of models. model_get_model_frame() will always return an object with the same data structure or NULL if it is not possible to compute model frame from model.

Usage

model_get_model_frame(model)

# Default S3 method
model_get_model_frame(model)

# S3 method for class 'coxph'
model_get_model_frame(model)

# S3 method for class 'survreg'
model_get_model_frame(model)

# S3 method for class 'biglm'
model_get_model_frame(model)

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

# S3 method for class 'fixest'
model_get_model_frame(model)

Arguments

model

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

Examples

lm(hp ~ mpg + factor(cyl), mtcars) |>
  model_get_model_frame() |>
  head()
#>                    hp  mpg factor(cyl)
#> Mazda RX4         110 21.0           6
#> Mazda RX4 Wag     110 21.0           6
#> Datsun 710         93 22.8           4
#> Hornet 4 Drive    110 21.4           6
#> Hornet Sportabout 175 18.7           8
#> Valiant           105 18.1           6