This is mostly just a wrapper for model.frame.

extract_model_data(model)

Arguments

model

The mixed model.

Value

A tibble of the data used in the model.

Note

For whatever reason, nlme class objects do not save the model data, so this will throw an error stating as much. lme objects do save the data so are fine.

Examples

library(lme4)
library(mixedup)

lmer_1 <- lmer(Reaction ~ Days + (1 | Subject), data = sleepstudy)
extract_model_data(lmer_1)
#> # A tibble: 180 × 3
#>    Reaction  Days Subject
#>       <dbl> <dbl> <fct>  
#>  1     250.     0 308    
#>  2     259.     1 308    
#>  3     251.     2 308    
#>  4     321.     3 308    
#>  5     357.     4 308    
#>  6     415.     5 308    
#>  7     382.     6 308    
#>  8     290.     7 308    
#>  9     431.     8 308    
#> 10     466.     9 308    
#> # … with 170 more rows