Hi all! I have a question regarding a 2-level hierarchical model I’m fitting. I want to estimate a slope and an intercept from the same group: spp (species) with the following model:
stan_lmer(
y ~
(1|site_fac) +
(gdd | spp_fac),
data = emp,
chains = 4,
iter = 4000,
cores = 4
)
When I fit my data, and return the random effects, I get this:
> ranef(fitlmer_partialpooling3)
$site_fac
(Intercept)
1 -0.2326
2 -0.3119
3 0.0955
4 0.4740
$spp_fac
(Intercept) gdd
1 0.0007 0.02289
2 -0.0102 -0.04361
3 -0.0021 -0.00521
4 0.0111 0.07815
with conditional variances for “site_fac” “spp_fac”
Now, I believe rstanarm applies a covariance matrix for the parameters estimated from the same group for models with stan_glmer and stan_lmer. My question is: is this covariance matrix already applied internally by rstanarm, or do I need to apply it manually to the full posterior distribution of my parameters?