Re: [R] Likelihood ratio test between glm and glmer fits

2008-07-19 Thread Göran Broström
This particular case with a random intercept model can be handled by glmmML, by bootstrapping the p-value. Best, Göran On Thu, Jul 17, 2008 at 1:29 PM, Douglas Bates [EMAIL PROTECTED] wrote: On Thu, Jul 17, 2008 at 2:50 AM, Rune Haubo [EMAIL PROTECTED] wrote: 2008/7/16 Dimitris Rizopoulos

Re: [R] Likelihood ratio test between glm and glmer fits

2008-07-17 Thread Rune Haubo
2008/7/16 Dimitris Rizopoulos [EMAIL PROTECTED]: well, for computing the p-value you need to use pchisq() and dchisq() (check ?dchisq for more info). For model fits with a logLik method you can directly use the following simple function: lrt - function (obj1, obj2) { L0 - logLik(obj1)

Re: [R] Likelihood ratio test between glm and glmer fits

2008-07-17 Thread Douglas Bates
On Thu, Jul 17, 2008 at 2:50 AM, Rune Haubo [EMAIL PROTECTED] wrote: 2008/7/16 Dimitris Rizopoulos [EMAIL PROTECTED]: well, for computing the p-value you need to use pchisq() and dchisq() (check ?dchisq for more info). For model fits with a logLik method you can directly use the following

[R] Likelihood ratio test between glm and glmer fits

2008-07-16 Thread COREY SPARKS
Dear list, I am fitting a logistic multi-level regression model and need to test the difference between the ordinary logistic regression from a glm() fit and the mixed effects fit from glmer(), basically I want to do a likelihood ratio test between the two fits. The data are like this: My

Re: [R] Likelihood ratio test between glm and glmer fits

2008-07-16 Thread Dimitris Rizopoulos
well, for computing the p-value you need to use pchisq() and dchisq() (check ?dchisq for more info). For model fits with a logLik method you can directly use the following simple function: lrt - function (obj1, obj2) { L0 - logLik(obj1) L1 - logLik(obj2) L01 - as.vector(- 2 * (L0