details |
I believe, based on some reasonably careful testing,
that quasi- fits are incorrectly scaling the reported
random effects variance by the error (residual) variance.
A detailed discussion is given by:
http://www.zoology.ufl.edu/bolker/glmm/quasitest.Rnw
http://www.zoology.ufl.edu/bolker/glmm/quasitest.pdf
-- essentially, I generate some simulated data
and show that quasi- are inflating the block variances
inappropriately.
I believe the following patch fixes the problem:
--- lmer.R (revision 279)
+++ lmer.R (working copy)
@@ -938,14 +938,19 @@
else "sigmaML"]
})
+is.glmm <- function(object) {
+ length(object@muEta)>0
+}
+
setMethod("VarCorr", signature(x = "mer"),
function(x, ...)
### Create the VarCorr object of variances and covariances
{
- sc <- sigma(x)
+ tsc <- sc <- sigma(x)
+ if (is.glmm(x)) tsc <- 1 ## DON'T scale GLMM var-corr by
ans <- lapply(cc <- .Call(mer_ST_chol, x),
function(ch) {
- val <- crossprod(sc * ch) # variance-covariance
+ val <- crossprod(tsc * ch) # variance-covariance
stddev <- sqrt(diag(val))
correl <- t(val / stddev)/stddev
diag(correl) <- 1
| 2012-03-17 22:35 | bbolker |