1
$\begingroup$

I have a binary response variable (0s and 1s), the distribution of which that I want to compare to chance. I understand I could use logistic regression or a chi-square test to do this and that these should be equivalent but my results are slightly different when I use one versus the other and I'm wondering why.

Specifically, there are 44 1s and 14 0s and the expected distribution would be chance (30 1s, 30 0s). When I run a logistic regression with this code:

model<-glm(df$var ~ 1, family=binomial("logit"))

I get a z value of 3.465, which converts to a Wald statistic of 12, and p = .00053.

When I run a chi-square test I get X-squared = 13.067, df = 1, p-value = 0.0003006.

Can someone explain to me where exactly these tests differ such that they yield different results?

$\endgroup$
1
1
$\begingroup$

The Pearson $\chi^2$ test, the Wald test, (the likelihood ratio test, Rao's score test, ...) are all approximate. If you have an infinite sample, then they will be exactly the same, but in smaller samples you will find differences.

$\endgroup$
2
  • $\begingroup$ Thanks. In that case, is there any reason to prefer one over the other here? $\endgroup$
    – PanPsych
    May 18 '16 at 14:16
  • $\begingroup$ The Pearson $\chi^2$ test tends to perform badly when your expected counts are small. $\endgroup$ May 18 '16 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.