michael-franke / faintr

R package 'faintr' for interpretation of BRMS model fits for data from factorial design experiment
https://michael-franke.github.io/faintr/index.html
Other
2 stars 1 forks source link

[feature] support rstanarm models #9

Open n-kall opened 2 years ago

n-kall commented 2 years ago

I think we can probably also support rstanarm models. We can extract the design matrix with rstanarm::get_x(). I'll look into this further, but I don't think there is anything strictly necessary for faintr that we use in brms that is missing in rstanarm.

n-kall commented 2 years ago

I tried this out and it seems that it works well with minimal adjustments. Just had to change standata(...)$X to get_x(), and extraction of the variable names. With this in mind, I propose we refactor the code a bit to have generics and S3 methods for brmsfit and stanreg objects. Thoughts?

michael-franke commented 2 years ago

More general applicability is great. I currently do not see a downside to this, except perhaps maintainability. But overall, I'm in favor.

n-kall commented 2 years ago

Ok, I made a branch with basic functionality. I think there is an issue with extracting only fixed effects from a mixed-effects model, but it's a start.