[R-sig-ME] How to estimate the standard error of every single random intercept in a mixed linear model?
Phillip Alday
Phillip.Alday at unisa.edu.au
Fri Nov 4 06:29:36 CET 2016
Dear Chen,
have you tried entering the following in the R command line?
> library(arm)
> se.ranef
That will output the source code for arm::se.ranef. It's surprisingly simple and is basically the square root of the diagonal of variance-covariance RE matrix.
Best,
Phillip
> On 24 Oct 2016, at 20:38, Chen Chun <talischen at hotmail.com> wrote:
>
> Dear all,
>
>
> I am running a mixed linear model with group (a_i) as random intercept:
>
>
> y_ij=mu + a_i + e_ij
>
>
> By using lmer() function, the model outputs an estimated variance of a_i (i.e. var_hat(a)), and it is the sum of (1) the variance of the estimated group mean (i.e. between group variance) and (2) the sum of variance for each estimated group mean a_i_hat, (i.e. sum of within group variance).
>
>
> for (1) I can compute it as var(ranef(model)$group). However, I dont know how to compute (2), which is the SE of the estimated random intercept for each group. I know that using se.ranef() function in arm package can help me to extract such variance. But I would like to know how these variance are computed? it's relations to residuals and number of observations per group?
>
>
> Thanks
>
>
> Chen
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
More information about the R-sig-mixed-models
mailing list