Solved – Why is the probability of the chi square statistic equal to 0

chi-squared-testlogisticregression

Binary logistic regression in R

I have derived the chi square statistic and degrees of freedom for my model (200.7839, 8, respectively) however, when I attempt to determine the probability associated with the chi square statistic, I get a value of 0 with no decimal places – just "0". I was expecting a probability <0.05 so I can reject the null hypotheses. Please see my code below. Does anyone have any suggestions as to why R would return a value of 0 with no decimal places? or is the value simply 0.00000 etc and therefore significant? Cheers!

modelChi<-Model1.0$null.deviance - Model1.0$deviance
modelChi
chidf<-Model1.0$df.null - Model1.0$df.residual
chidf
chisq.prob<- 1 - c(modelChi, chidf)
chisq.prob

Best Answer

That Chi-squared statistic is gigantic. With 8 degrees of freedom, the a chi-squared statistic of 21.96 is associated with a p-value of 0.005. So a very large statistic like 200, with 8 degrees of freedom has a p-value so small that R returns zero, (i.e. close to zero). It is certainly less than .05, the level you are trying to test at, which is achieved with a chi-squared test statistic of only 2.73.

Related Question