[R] CI for Ratios of Variance components in lme?

Douglas Bates bates at stat.wisc.edu
Thu Apr 14 16:21:44 CEST 2005


Berton Gunter wrote:
> My apologies if this is obvious:
> 
> Is there a simple way (other than simulation or bootstrapping) to obtain a
> (approximate)confidence interval for the ratio of 2 variance components in a
> fitted lme model? -- In particular, if there are only 2 components (1
> grouping factor). I'm using nlme but lme4 would be fine, too.

Sorry for being so late in responding.  I'm way behind in reading R-help.

This particular calculation can be done for an lme fit.  At present it 
is difficult to do this for an lmer fit.

An lme fit of a model like this has a component apVar which is an 
approximate variance-covariance matrix for the parameter estimates in 
the random effects component.  The first parameter is the natural 
logarithm of the relative variance (ratio of the variance component to 
the residual variance).


 > bert <- data.frame(grp = factor(rep(1:5, c(3, 9, 8, 28, 34))), resp = 
scan("/tmp/bert.txt"))
Read 82 items
 > fm1 <- lme(resp ~ 1, bert, ~ 1|grp)
 > fm1$apVar
              reStruct.grp      lSigma
reStruct.grp 3.611912e+02 0.002383590
lSigma       2.383590e-03 0.006172887
attr(,"Pars")
reStruct.grp       lSigma
   -5.7476114   -0.6307136
attr(,"natural")
[1] TRUE

You may want to look at some of the code in the lme S3 method for the 
intervals generic to see how this is used.




More information about the R-help mailing list