Open n-kall opened 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?
More general applicability is great. I currently do not see a downside to this, except perhaps maintainability. But overall, I'm in favor.
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.
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.