Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_modelmatrix() fails for brms models with monotonic effects mo #908

Closed
DominiqueMakowski opened this issue Jul 22, 2024 · 1 comment · Fixed by #909
Closed

get_modelmatrix() fails for brms models with monotonic effects mo #908

DominiqueMakowski opened this issue Jul 22, 2024 · 1 comment · Fixed by #909
Assignees
Labels
Bug 🐛 Something isn't working

Comments

@DominiqueMakowski
Copy link
Member

library(brms)

m <- brm(mpg ~ mo(gear), data = mtcars, refresh=0)

insight::get_modelmatrix(m)
#> Error in model.frame.default(object, data, xlev = xlev): invalid type (list) for variable 'mo(gear)'

Created on 2024-07-22 with reprex v2.0.2

@strengejacke
Copy link
Member

library(brms)
#> Loading required package: Rcpp
#> Loading 'brms' package (version 2.21.0). Useful instructions
#> can be found by typing help('brms'). A more detailed introduction
#> to the package is available through vignette('brms_overview').
#> 
#> Attaching package: 'brms'
#> The following object is masked from 'package:stats':
#> 
#>     ar
m <- brm(mpg ~ mo(gear), data = mtcars, refresh=0)
#> Compiling Stan program...
#> Start sampling
insight::get_modelmatrix(m)
#>                     (Intercept) gear
#> Mazda RX4                     1    4
#> Mazda RX4 Wag                 1    4
#> Datsun 710                    1    4
#> Hornet 4 Drive                1    3
#> Hornet Sportabout             1    3
#> Valiant                       1    3
#> Duster 360                    1    3
#> Merc 240D                     1    4
#> Merc 230                      1    4
#> Merc 280                      1    4
#> Merc 280C                     1    4
#> Merc 450SE                    1    3
#> Merc 450SL                    1    3
#> Merc 450SLC                   1    3
#> Cadillac Fleetwood            1    3
#> Lincoln Continental           1    3
#> Chrysler Imperial             1    3
#> Fiat 128                      1    4
#> Honda Civic                   1    4
#> Toyota Corolla                1    4
#> Toyota Corona                 1    3
#> Dodge Challenger              1    3
#> AMC Javelin                   1    3
#> Camaro Z28                    1    3
#> Pontiac Firebird              1    3
#> Fiat X1-9                     1    4
#> Porsche 914-2                 1    5
#> Lotus Europa                  1    5
#> Ford Pantera L                1    5
#> Ferrari Dino                  1    5
#> Maserati Bora                 1    5
#> Volvo 142E                    1    4
#> attr(,"assign")
#> [1] 0 1

Created on 2024-07-22 with reprex v2.1.1

@strengejacke strengejacke added the Bug 🐛 Something isn't working label Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants