[R-sig-ME] Development version of the lme4 package on the R-forge web site
Douglas Bates
bates at stat.wisc.edu
Thu Dec 20 00:10:51 CET 2007
I have been struggling for a long time with a part of the code for
generalized linear mixed models in the new formulation for lmer
objects. This has taken much longer than I ever anticipated it would
but I think I have finally gotten past this log jam. I believe the
development version now on R-forge is producing the proper estimates
of the parameters.
The current version is incomplete. To get the estimates of variance
components you must use the optional argument verbose = TRUE and be
able to decipher the values of the parameters being optimized. Also,
the standard errors of the fixed effects are not currently being
calculated - they are arbitrarily set to 1.
All of these "infelicities" are straightforward to fix and I will do
so after I finish grading exams. Right now I would appreciate it if a
few brave testers could try out some model fits using this version
and tell me if the answers are consistent with those from earlier
versions of lme4 or from other software to which you may have access.
Here is a sample run
> example(cbpp)
cbpp> ## response as a matrix
cbpp> (m1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
cbpp+ cbpp, binomial, verbose = TRUE))
0: 101.94202: 0.845154 -1.26902 -1.17076 -1.30141 -1.78228
1: 100.53027: 0.673606 -1.31464 -1.12352 -1.26457 -1.75616
2: 100.30572: 0.574054 -1.37591 -1.02938 -1.17669 -1.68180
3: 100.19154: 0.686359 -1.39110 -0.949652 -1.09270 -1.58420
4: 100.11118: 0.651201 -1.40779 -0.962929 -1.10154 -1.58146
5: 100.09935: 0.637395 -1.40425 -0.990891 -1.12134 -1.56147
6: 100.09784: 0.647778 -1.39980 -0.988828 -1.12366 -1.56676
7: 100.09623: 0.640796 -1.39918 -0.987904 -1.12854 -1.57632
8: 100.09598: 0.643683 -1.39963 -0.990595 -1.12789 -1.57733
9: 100.09598: 0.640981 -1.39885 -0.992325 -1.12640 -1.57935
10: 100.09588: 0.642623 -1.39874 -0.992076 -1.12758 -1.57972
11: 100.09587: 0.642176 -1.39887 -0.992048 -1.12803 -1.57981
12: 100.09586: 0.642561 -1.39857 -0.992080 -1.12844 -1.57994
13: 100.09586: 0.642118 -1.39821 -0.992232 -1.12857 -1.58018
14: 100.09586: 0.642238 -1.39849 -0.992317 -1.12864 -1.58022
15: 100.09586: 0.642248 -1.39853 -0.992324 -1.12866 -1.58032
16: 100.09586: 0.642264 -1.39853 -0.992327 -1.12866 -1.58032
17: 100.09586: 0.642260 -1.39854 -0.992335 -1.12868 -1.58031
Generalized linear mixed model fit using Laplace
Formula: cbind(incidence, size - incidence) ~ period + (1 | herd)
Data: cbpp
Family: binomial(logit link)
AIC BIC logLik deviance
110.1 120.2 -50.05 100.1
Random effects:
Groups Name Variance Std.Dev.
herd (Intercept) 0.0079327 0.089066
Residual 0.0192308 0.138675
Number of obs: 56, groups: herd, 15
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.3985 1.0000 -1.3985 0.162
period2 -0.9923 1.0000 -0.9923 0.321
period3 -1.1287 1.0000 -1.1287 0.259
period4 -1.5804 1.0000 -1.5804 0.114
Correlation of Fixed Effects:
(Intr) perid2 perid3
period2 0.000
period3 0.000 0.000
period4 0.000 0.000 0.000
Don't pay attention to the reported estimates of the variance
components. The important numbers are in the verbose output. The
first number is the Laplace approximation to the deviance (negative
twice the log-likelihoood) and the second is the relative standard
deviation of the random effects. For a binomial model there is no
separate scale factor in the variance of the responses so the relative
standard deviation is the standard deviation (in other words, it is
"relative to unity"). The next four numbers are, as you can see, the
fixed effects.
If you do have a chance to run a test I would appreciate learning of
the results. The source package on R-forge should be updated tonight.
I'm not sure when the Windows binary version is updated. If you
install the development version of the package please try to reproduce
the example shown above before you run your own tests.
This version will fit GLMMs for the binomial family with logit or
probit links and for the Poisson family. Other families will be added
as needed. General capabilities for using a user-defined family will
take longer.
More information about the R-sig-mixed-models
mailing list