Skip to content

Inference, logistic regression

5 messages · Andrew Rominger, Simon Blomberg, Manuel Spínola +1 more

#
Dear list,

Please pardon this beginner's-level question, I feel it's not quite up  
to the same caliber as recent discussions.

I'm working with a simple logistic regression model comparing the  
presence/absence of an insect species against an index of plant  
species turnover:
The term bout.psol$pres.de is binary 0,1; and bout.psol$index is continuous.

I'd like to use a likelihood ratio statistic to test the significance  
of this regression, but I'm a little uncertain as how to proceed.   
When I call summary(foo), I get...

Call:
glm(formula = bout.psol$pres.de ~ bout.psol$index,
     family = binomial)

Deviance Residuals:
     Min       1Q   Median       3Q      Max
-1.7180  -1.1289   0.6314   1.0323   1.7499

Coefficients:
                      Estimate Std. Error z value Pr(>|z|)
(Intercept)           0.30584    0.23095   1.324  0.18542
bout.psol.edit$index  0.04552    0.01439   3.163  0.00156 **
---
Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1

(Dispersion parameter for binomial family taken to be 1)

     Null deviance: 130.14  on 93  degrees of freedom
Residual deviance: 118.17  on 92  degrees of freedom
AIC: 122.17

Taking (Null dev) - (Redid dev), I get 11.97, which I assume to be  
equal to -2log(L,full/L,reduced).  That's the desired test statistic,  
so is it as simple as calling:
[1] 2.911346e-25          ?

That's an awfully small p-value, I think I'm interpreting something  
wrong.  Any advice would be very welcomed.

Thanks very much in advance
Andy Rominger
#
On Mon, 2008-06-02 at 21:38 -0700, Andrew Rominger wrote:
The degrees of freedom for the chisq test is 93 - 92 = 1.
 pchisq(11.97, 1, lower.tail=FALSE)
[1] 0.0005406394

Which is pretty close to the Wald test. Wald tests can sometimes be
misleading, since the estimate of the standard error in the denominator
can blow out and cause the test to be not significant even when there is
a big effect size, which is one reason to prefer the LR test. If you
want to get R to do the LR test, fit one model with and without the
covariate, and use anova.

fit.with <- glm(bout.psol$pres.de~bout.psol$index,family=binomial)
?
fit.without <- glm(bout.psol$pres.de~ 1 ,family=binomial)

anova(fit.without, fit.with)

Cheers,

Simon.
#
On Tue, 2008-06-03 at 16:06 +1000, Simon Blomberg wrote:

            
Oops. Should have been:

anova(fit.without, fit.with, test="Chisq")

I always forget that!

Cheers,

Simon.
#
Another twist will be to fit models with and without the covariate and 
use AICc values, delta AICc, and Akaike weights and interpret parameter 
estimates to assess the covariate merits and stay away from P values.
Best,

Manuel Sp?nola


Andrew Rominger escribi?:

  
    
6 days later
#
Slightly OT... can you be sure that absences were true absences, or is it
possible they were there and you missed them?
-----
David Hewitt
Research Fishery Biologist
USGS Klamath Falls Field Station (USA)