# [R-sig-ME] Between and within variance in a GLMM

Renwick, A. R. a.renwick at abdn.ac.uk
Thu Nov 27 15:15:36 CET 2008

```Sorry I missed an earlier posting on a similar question which answers my problem - see link below
https://stat.ethz.ch/pipermail/r-sig-mixed-models/2008q3/001175.html

-----Original Message-----
From: r-sig-mixed-models-bounces at r-project.org [mailto:r-sig-mixed-models-bounces at r-project.org] On Behalf Of Renwick, A. R.
Sent: 26 November 2008 11:12
To: 'r-sig-mixed-models at r-project.org'
Subject: [R-sig-ME] Between and within variance in a GLMM

I have a wee query regarding the variation explained by the random effect in a GLMM using lme4 package.  In the model output I was under the assumption that the value given as Std Dev is the VARIANCE BETWEEN the random factor and the VARIANCE WITHIN could be calculated using the following equation:

Variance WITHIN = ST value x Variance BETWEEN.
Therefore, Variance WITHIN = ST value x Std Dev value in model output.

However, the ST value is always equal to the Std Dev given in model output so can someone clarify how to calulate the within and between variance of the random effect.

EXAMPLE:

Generalized linear mixed model fit by the Laplace approximation
Formula: fleapresence ~ sex + width + sess + Nhat + alt + width:sess +      (1 | LocTran)
Data: flea
AIC  BIC logLik deviance
1797 1863 -886.7     1773
Random effects:
Groups  Name        Variance Std.Dev.
LocTran (Intercept) 0.10512  0.32422
Number of obs: 1697, groups: LocTran, 14

..@ ST      :List of 1
.. ..\$ : num [1, 1] 0.324

Thanks
Anna

Anna Renwick
Institute of Biological & Environment Sciences University of Aberdeen Zoology Building Tillydrone Avenue Aberdeen
AB24 2TZ

The University of Aberdeen is a charity registered in Scotland, No SC013683.

_______________________________________________
R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

The University of Aberdeen is a charity registered in Scotland, No SC013683.

```