You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The offsets don't work right in stan_gamm4. The example here is for a gaussian family, but it is particularly harmful in poisson regression.
Description:
Specifying an offset inside the formula or as argument to the function does not work if the offset referred to is a column inside the data frame. This is also problematic when predicting.
Reproducible Steps:
## example from gamm
library(rstanarm)
dat <- mgcv::gamSim(1, n = 400, scale = 2) ## simulate 4 term additive truth
#> Gu & Wahba 4 term additive model
## Now add 20 level random effect `fac'...
dat$fac <- fac <- as.factor(sample(1:20, 400, replace = TRUE))
dat$y <- dat$y + model.matrix(~ fac - 1) %*% rnorm(20) * .5
br <- stan_gamm4(y ~ s(x0) + x1 + s(x2) + offset(f2), data = dat, random = ~ (1 | fac),
chains = 1, iter = 200) # for example speed
Thanks for reporting. Not sure what the problem is but will look into it. It might work if you use the offset argument instead of putting it in the formula.
Summary:
The offsets don't work right in stan_gamm4. The example here is for a gaussian family, but it is particularly harmful in poisson regression.
Description:
Specifying an offset inside the formula or as argument to the function does not work if the offset referred to is a column inside the data frame. This is also problematic when predicting.
Reproducible Steps:
RStanARM Version:
2.17.2
R Version:
3.4.3
Operating System:
Your operating system (e.g., OS X 10.11.3)
The text was updated successfully, but these errors were encountered: