bbolker/broom.mixed

feature request: exponentiate coefficients from stanreg

graemeblair opened this issue · 3 comments

Just like for some of the other models, it would be helpful to be able to exponentiate coefficients in the tidy function for stanreg objects with the exponentiate argument to tidy.stanreg, e.g.:

library(rstanarm)
library(broom.mixed)
dat <- structure(list(ID = c("067", "083", "098"), age = c(64L, 70L, 6L), S = c(1, 1, 1)), row.names = c(67L, 83L, 98L), class = "data.frame")
fit <- 
  stan_glm(age ~ 1,
           family = gaussian(link = "log"),
           prior_intercept = normal(50, 5),
           data = dat)

tidy(fit, exponentiate = TRUE) # does not exponentiate (goes to ...)

Thanks so much for a terrifically useful package!

This seems like fairly low-hanging fruit/a good idea, although I'll have to look at the guts. In any case there should be a ...-checker in there to warn (or error) if arguments are ignored ...

Just adding on that request. The tidy() method is used in many places. exponentiate is a common arg regarding that method. It would be relevant to implement it here.

And when it is not relevant to use it, it should return an error.

More generally, it could be worth to consider adding rlang::check_dots_used() in such methods.

added in 9601528