An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20080108/74a6fe32/attachment.pl>
testing fixed effects in binomial lmer...again?
7 messages · Achaz von Hardenberg, Douglas Bates, Dimitris Rizopoulos +4 more
On Jan 8, 2008 5:38 AM, Achaz von Hardenberg <fauna at pngp.it> wrote:
Dear all,
I know that this may be a already debated topic, but even searching the R-help and the r-sig-mixed-models archives I can not find a reply to my doubts...(but see Ben Bolkers' reply to my similar quest in r- help).
I am performing a binomial glmm analysis using the lmer function in the lme4 package (last release, just downloaded). I am using the "Laplace method".
Yes, that is the best choice in lmer. (In the development version it is, in fact, the only choice.)
However, I am not sure about what I should do to test for the significance of fixed effects in the binomial case: Is it correct to test a full model against a model from which I remove the fixed effect I want to test using the anova(mod1.lmer, mod2.lmer) method and then relying on the model with the lower AIC (or on the Log- likelihood test?)?
The change in the log-likelihood between two nested models is, in my opinion, the most sensible test statistic for comparing the models. However, it is not clear how one should convert this test statistic to a p-value. The use of the chi-squared distribution is based on asymptotic results and can give an "anti-conservative" (i.e. lower than would be obtained through a randomization test or via simulation) p-value for small samples. As far as I can see, the justification for the use of AIC as a comparison criterion is even more vague. For linear fixed-effects models one can compensate for small samples by changing from z-tests to t-tests and from chi-squared tests to F tests. The exact theory breaks down for mixed-effects models or for generalized linear models and is even more questionable for generalized linear mixed models. As Ben Bolker mentioned, I think that one way to deal with the hypothesis testing question while preserving the integrity of the model is to base inferences on a Markov-chain Monte Carlo sample from the (Bayesian) posterior distribution of the parameters. Code for MCMC samples for parameters in GLMMs is not yet fully developed (or documented). In the meantime I would use the likelihood ratio tests but exercise caution in reporting p-values for small-sample cases.
Would you advice me to use the glmmML function instead? (I am not sure where the differences are with lmer) I thank in advance for your help! best regards, Achaz von Hardenberg Ben Bolker wrote:
>The short answer is that testing fixed effects in GLMMs >is difficult and dangerous. Likelihood ratio tests on fixed >effect differences [which is generally what anova() does] >in a random-effects model are unreliable >(see Pinheiro and Bates 2000). Most of the world does >F tests with various corrections on the denominator >degrees of freedom, but this is contentious (in particular, >Doug Bates, the author of lme4, disagrees). lme4 will >eventually let you use an MCMC sampling method to test >fixed effects but that may or may not be working >in the current version.
>I would try this question again on the r-sig-mixed >mailing list.
> good luck, > Ben Bolker
Dr. Achaz von Hardenberg
------------------------------------------------------------------------
--------------------------------
Centro Studi Fauna Alpina - Alpine Wildlife Research Centre
Servizio Sanitario e della Ricerca Scientifica
Parco Nazionale Gran Paradiso, Degioz, 11, 11010-Valsavarenche (Ao),
Italy
------------------------------------------------------------------------
--------------------------------
[[alternative HTML version deleted]]
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
----- Original Message ----- From: "Douglas Bates" <bates at stat.wisc.edu> To: "Achaz von Hardenberg" <fauna at pngp.it> Cc: <r-sig-mixed-models at r-project.org> Sent: Tuesday, January 08, 2008 3:10 PM Subject: Re: [R-sig-ME] testing fixed effects in binomial lmer...again?
On Jan 8, 2008 5:38 AM, Achaz von Hardenberg <fauna at pngp.it> wrote:
Dear all,
I know that this may be a already debated topic, but even searching the R-help and the r-sig-mixed-models archives I can not find a reply to my doubts...(but see Ben Bolkers' reply to my similar quest in r- help).
I am performing a binomial glmm analysis using the lmer function in the lme4 package (last release, just downloaded). I am using the "Laplace method".
Yes, that is the best choice in lmer. (In the development version it is, in fact, the only choice.)
However, I am not sure about what I should do to test for the significance of fixed effects in the binomial case: Is it correct to test a full model against a model from which I remove the fixed effect I want to test using the anova(mod1.lmer, mod2.lmer) method and then relying on the model with the lower AIC (or on the Log- likelihood test?)?
The change in the log-likelihood between two nested models is, in my opinion, the most sensible test statistic for comparing the models. However, it is not clear how one should convert this test statistic to a p-value. The use of the chi-squared distribution is based on asymptotic results and can give an "anti-conservative" (i.e. lower than would be obtained through a randomization test or via simulation) p-value for small samples. As far as I can see, the justification for the use of AIC as a comparison criterion is even more vague. For linear fixed-effects models one can compensate for small samples by changing from z-tests to t-tests and from chi-squared tests to F tests. The exact theory breaks down for mixed-effects models or for generalized linear models and is even more questionable for generalized linear mixed models. As Ben Bolker mentioned, I think that one way to deal with the hypothesis testing question while preserving the integrity of the model is to base inferences on a Markov-chain Monte Carlo sample from the (Bayesian) posterior distribution of the parameters. Code for MCMC samples for parameters in GLMMs is not yet fully developed (or documented). In the meantime I would use the likelihood ratio tests but exercise caution in reporting p-values for small-sample cases.
What about Bootstrap (parametric or not)? Would it be useful in this
case?
(For instance, something along the following lines:
library(lme4)
form.null <- # formula under null
form.altr <- # formula under alternative
fm1 <- lmer(form.null, family = binomial, data = data)
fm2 <- lmer(form.altr, family = binomial, data = data)
# observed value of the LRT
Tobs <- anova(fm1, fm2)$Chisq[2]
B <- 199
Tvals <- numeric(B)
# 'id' is the grouping variable
unq.ids <- unique(data$id)
for (b in 1:B) {
dat.new <- # a sample with replacement from the original subjects
fm1 <- lmer(form.null, family = binomial, data = data.new)
fm2 <- lmer(form.altr, family = binomial, data = data.new)
Tvals[b] <- anova(fm1, fm2)$Chisq[2]
}
# estimated p-value
(1 + sum(Tvals >= Tobs)) / (B + 1)
if the estimated p-value is near the significance level, 'B' can be
increased accordingly.)
Best,
Dimitris
Would you advice me to use the glmmML function instead? (I am not sure where the differences are with lmer) I thank in advance for your help! best regards, Achaz von Hardenberg Ben Bolker wrote:
>The short answer is that testing fixed effects in GLMMs >is difficult and dangerous. Likelihood ratio tests on fixed >effect differences [which is generally what anova() does] >in a random-effects model are unreliable >(see Pinheiro and Bates 2000). Most of the world does >F tests with various corrections on the denominator >degrees of freedom, but this is contentious (in particular, >Doug Bates, the author of lme4, disagrees). lme4 will >eventually let you use an MCMC sampling method to test >fixed effects but that may or may not be working >in the current version.
>I would try this question again on the r-sig-mixed >mailing list.
> good luck, > Ben Bolker
Dr. Achaz von Hardenberg
------------------------------------------------------------------------
--------------------------------
Centro Studi Fauna Alpina - Alpine Wildlife Research Centre
Servizio Sanitario e della Ricerca Scientifica
Parco Nazionale Gran Paradiso, Degioz, 11, 11010-Valsavarenche
(Ao),
Italy
------------------------------------------------------------------------
--------------------------------
[[alternative HTML version deleted]]
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
On Tue, 8 Jan 2008, Dimitris Rizopoulos wrote:
On Jan 8, 2008 5:38 AM, Achaz von Hardenberg <fauna at pngp.it> wrote:
However, I am not sure about what I should do to test for the significance of fixed effects in the binomial case
What about Bootstrap (parametric or not)? Would it be useful in this case?
The only problem is specifying a bootstrap mechanism that respects the structure of the random effects. So for time series data, your bootstrap samples have to remain AR1 or whatever (ie you don't want gaps appearing that aren't in the observed data), and for genetic type data (the kind I have), that pseudosample people are appropriately related to one another. Resampling clusters works for that kind of data, though I think you need many clusters. There are several papers in the area of genetic linkage analysis that have validated bootstrapping for a test that a variance component is zero. But for testing simple hypotheses about particular fixed effects, a permutation/randomization test should work, I think. David Duffy.
| David Duffy (MBBS PhD) ,-_|\ | email: davidD at qimr.edu.au ph: INT+61+7+3362-0217 fax: -0101 / * | Epidemiology Unit, Queensland Institute of Medical Research \_,-._/ | 300 Herston Rd, Brisbane, Queensland 4029, Australia GPG 4D0B994A v
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
David Duffy wrote:
| On Tue, 8 Jan 2008, Dimitris Rizopoulos wrote:
|>> On Jan 8, 2008 5:38 AM, Achaz von Hardenberg <fauna at pngp.it> wrote:
|>> |>>> However, I am not sure about what I should do to test for the |>>> significance of fixed effects in the binomial case |> What about Bootstrap (parametric or not)? Would it be useful in this |> case? |> | | The only problem is specifying a bootstrap mechanism that respects the | structure of the random effects. So for time series data, your bootstrap | samples have to remain AR1 or whatever (ie you don't want gaps appearing that | aren't in the observed data), and for genetic type data (the kind I have), | that pseudosample people are appropriately related to one another. Resampling | clusters works for that kind of data, though I think you need many clusters. | There are several papers in the area of genetic linkage analysis that have | validated bootstrapping for a test that a variance component is zero. | | But for testing simple hypotheses about particular fixed effects, | a permutation/randomization test should work, I think. | | David Duffy. ~ My favorite solution (which worked in nlme, I think, but might take some time to get for lme4 ...) would to be able to generate posterior simulations from the reduced model, then use these to generate a null distribution for F statistics (or whatever) for the model comparison. This seems as though it would actually be a relatively straightforward extension of mcmcsamp, once it exists -- although arguably once you have mcmcsamp you wouldn't need it any more ... ~ Ben Bolker -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHg/drc5UpGjwzenMRAgtdAJ9iill9KFLLGOAUnLyXvCRVEWthEQCdFLb9 s+A2eFe1JfDrAy/0zW9MFhA= =Aitb -----END PGP SIGNATURE-----
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20080109/2d29b8cc/attachment.pl>
5 days later
On 09/01/2008, at 10:45 AM, Reinhold Kliegl wrote:
Not sure it applies exactly to the cases discussed so far here, but there is analytical and simulation evidence against using BLUP-based residuals of mixed models for bootstrapping. See:Morris, J.S. (2002). The BLUPs are not "best" when it comes to bootstrapping. Statistics & Probability Letters 56, 425-450. A PDF is available on his website. Reinhold
A solution to this problem is Carpenter, JR; Goldstein, H; Rasbash, J "A novel bootstrap procedure for assessing the relationship between class size and achievement", JOURNAL OF THE ROYAL STATISTICAL SOCIETY SERIES C-APPLIED STATISTICS, 52: 431-443 Part 4 2003 but I expect that parametric bootstrapping is enough for most problems. Ken