Java Mailing List Archive

http://www.r-help.com/

Home » Home (12/2007) » R Help for Statistical Computing »

[R] ERROR NaNs produced;
 when comparing two logistic regression models with the ANOVA
 CHI test

Jan Verbesselt

2005-02-22

Replies:

Dear R-list,

*When comparing two logistic regression models with the anova CHi test, I
obtain the following error: (there are no NA's in the time series). How can
this be solved such that I can compare two models on the same dataset were
different explanatory variables are used?


  l.KBDI <- glm(zna.arson2 ~ zna.KBDI,family = binomial)
  l.NDWI <- glm(zna.arson2 ~ zna.NDWI,family = binomial)

anova(l.KBDI,l.NDWI, test = "Chi")


Analysis of Deviance Table

Model 1: zna.arson2 ~ zna.KBDI
Model 2: zna.arson2 ~ zna.NDWI
Resid. Df Resid. Dev Df Deviance P(>|Chi|)
1     110   123.227              
2     110   113.593  0   9.635      
Warning message:
NaNs produced in: pchisq(q, df, lower.tail, log.p)


*Is this caused by the non-linearity of the data?
*How can I obtain a p-value?


Thanks,
Jan

_______________________________________________________________________
ir. Jan Verbesselt
Research Associate
Lab of Geomatics and Forest Engineering K.U. Leuven
Vital Decosterstraat 102. B-3000 Leuven Belgium
Tel:+32-16-329750  Fax: +32-16-329760
http://gloveg.kuleuven.ac.be/

______________________________________________
R-help@(protected)
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
©2008 r-help.com - Jax Systems, LLC, U.S.A.