[R-sig-eco] Inference, logistic regression
Andrew Rominger
rominger at stanford.edu
Tue Jun 3 06:38:17 CEST 2008
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:
> foo<-glm(bout.psol$pres.de~bout.psol$index,family=binomial)
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:
> pchisq(11.97,df=92)
[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
More information about the R-sig-ecology
mailing list