[Lme4-commits] r1570 - pkg/lme4Eigen/tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Feb 6 23:28:51 CET 2012


Author: bbolker
Date: 2012-02-06 23:28:50 +0100 (Mon, 06 Feb 2012)
New Revision: 1570

Added:
   pkg/lme4Eigen/tests/varcorr.R
Log:

 added tests for VarCorr extraction/printing



Added: pkg/lme4Eigen/tests/varcorr.R
===================================================================
--- pkg/lme4Eigen/tests/varcorr.R	                        (rev 0)
+++ pkg/lme4Eigen/tests/varcorr.R	2012-02-06 22:28:50 UTC (rev 1570)
@@ -0,0 +1,22 @@
+library(lme4Eigen)
+data(Orthodont, package="nlme")
+fm1 <- lmer(distance ~ age + (age|Subject), data = Orthodont)
+VarCorr(fm1)
+
+fm2ML <- lmer(diameter ~ 1 + (1|plate) + (1|sample), Penicillin, REML=0)
+VarCorr(fm2ML)
+
+gm1 <- glmer(cbind(incidence,size-incidence) ~ period + (1|herd),data=cbpp,
+             family=binomial)
+VarCorr(gm1)
+
+cbpp$obs <- factor(seq(nrow(cbpp)))
+gm2 <- update(gm1,.~.+(1|obs))
+VarCorr(gm2)
+
+if (FALSE) {
+  ## testing lme4/lme4Eigen incompatibility
+  library(lme4)
+  VarCorr(fm1)
+  lme4Eigen:::VarCorr.merMod(fm1) ## OK
+}



More information about the Lme4-commits mailing list