bbolker/broom.mixed

`glance.brmsfit` without group effects does not work despite commit cd22fbd

vincentarelbundock opened this issue · 2 comments

This issue was first noted by @andrewheiss on Twitter.

A recent commit allowed tidy.brmsfit to work with models without group effects: cd22fbd

Unfortunately, glance.brmsfit still does not work in github master as of 3d12088

library(brms)
library(broom.mixed)
dat <- ggplot2::mpg

mod <- brm(cty ~ displ + drv, data=dat)

broom.mixed:::glance.brmsfit(mod)
#> Error: No group-level effects detected. Call method 'fixef' to access population-level effects.

The sigma function from stats is called by glance_stan when it is fed a brmsfit object, but it produces the same error:

stats::sigma(mod)

In turn, stats::sigma seems to trigger this method, which again produces the same error message:

rstanarm::sigma(mod)

Do you have a sense of what the best strategy to fix this would be?

Thanks!

This should be fixed in 88ff386; feel free to re-install and check. The problem was that there wasn't a sigma.brmsfit method, so the sigma call fell through to sigma.default(), which is bogus but produces a harmless NULL rather than an error when the model has random effects ...

Works great! Thanks a lot of the super quick fix!