# Chi-squared test and logistic regression

Is there a relation between chi-squared test and logistic regression model in a similar manner between ANOVA and linear regression?

• @Jeremy can you show a small example? I wouldn't expect it to be actually true (except approximately) and I can't seem to generate an example that shows it. I'd have expected that maybe it could happen with the G-test rather than the ordinary chi-square. – Glen_b Sep 17 '14 at 22:53

If the setting is a $$r\times 2$$ contingency table, crossclassifying a binary variable with an (unordered) factor with $$r$$ levels, you can use binary logistic regression or a chi-squared test, and you will get very similar answers.
The logistic regression will give the likelihood-ratio test, and the Pearson Chi-square is the corresponding score test. Details: G-test vs Pearson's chi-squared test. For an $$r\times c$$ contingency table (both factors unordered) much the same will be true replacing multinomial logistic regression. So logistic regression can be a good starting point if you need some extensions/generalizations to these chi-squared tests.