[R-sig-ME] observation level random effects; estimated variance of variance component estimates
Ben Bolker
bolker at ufl.edu
Thu Feb 19 23:24:00 CET 2009
I have a hacked version of lme4 that comments out the
error you are hitting (in the C code), and gets a plausible fit (at
least the fixed effects look pretty similar to Breslow and
Clayton 1993) -- see below.
Don't know about your second question --
============================
> fit
Generalized linear mixed model fit by the Laplace approximation
Formula: update(formula1, . ~ . + (1 | id) + (1 | rand))
Data: dat
AIC BIC logLik deviance
499.7 527.4 -241.9 483.7
Random effects:
Groups Name Variance Std.Dev.
rand (Intercept) 0.12747 0.35702
id (Intercept) 0.21097 0.45932
Number of obs: 236, groups: rand, 236; id, 59
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.41194 1.16349 -1.214 0.2249
Base 0.88034 0.12910 6.819 9.17e-12 ***
Trt -0.94857 0.39521 -2.400 0.0164 *
I(Trt * Base) 0.34922 0.20027 1.744 0.0812 .
Age 0.49015 0.34162 1.435 0.1514
V4TRUE -0.10312 0.08583 -1.201 0.2296
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) Base Trt I(T*B) Age
Base -0.163
Trt 0.047 0.595
I(Trt*Base) -0.119 -0.653 -0.930
Age -0.976 -0.038 -0.192 0.254
V4TRUE -0.018 -0.003 0.002 0.000 0.001
> sessionInfo()
R version 2.8.1 (2008-12-22)
i486-pc-linux-gnu
locale:
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C
attached base packages:
[1] splines stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] glmmAK_1.2 mvtnorm_0.9-4 coda_0.13-4
smoothSurv_0.3-12
[5] survival_2.34-1 lme4_0.999375-28 Matrix_0.999375-20
lattice_0.17-20
loaded via a namespace (and not attached):
[1] grid_2.8.1 rjags_1.0.3-4 tools_2.8.1
Youyi Fong wrote:
> Dear lmers,
>
> I have two questions regarding fitting GLMM using maximum likelihood method.
> The first one arises from trying repeat an analysis in the Breslow and
> Clayton 1993 JASA paper. Model 3 of the epileptic dataset has two random
> effects, one subject specific, and one observation specific. Thus if we
> count random effects, there are more parameters than observations. When I
> try to run the following code, I get an error saying: "Error in
> mer_finalize(ans) : q = 295 > n = 236".
>
> require (lme4)
> require (glmmAK)
> data(epilepticBC)
> dat = epilepticBC
> dat$rand=1:nrow(dat)
> dat$V4=dat$visit==4
> formula1 = Seizure ~ Base + Trt + I(Trt*Base) + Age + V4
> fit=lmer (update (formula1, .~. + (1|id) + (1|rand)), family=poisson,
> data=dat, nAGQ=1)
>
> Is it true that there is no way to fit such a model in an ML analysis? In
> other words, is there a way to approximate the likelihood of fixed effects
> and variance components without relying on estimates of random effects?
>
> The second question is that when it is possible to obtain MLE of a GLMM
> model, how can I obtain an estimated variance of the variance component
> estimates using lmer or other functions?
>
> Thank you very much for your help!
>
> Youyi Fong
>
> -------------------------------------------------------------------------------------
> Youyi Fong, Graduate Student, Department of Biostatistics
> University of Washington, Box 357232, Seattle, WA 98195
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
--
Ben Bolker
Associate professor, Biology Dep't, Univ. of Florida
bolker at ufl.edu / www.zoology.ufl.edu/bolker
GPG key: www.zoology.ufl.edu/bolker/benbolker-publickey.asc
More information about the R-sig-mixed-models
mailing list