Solved
New Contributor
Posts: 4

Chi Square test or logistic regression for the kinds of categorical variables?

I was wanting some assistance with knowing how to create a contingency tables or find chisquare statistics for an independent variable such as smoking status coded as 0,1 ( yes, no) and another variable that has more than two levels such as education level,

0=None, 1=Primary, 2=Secondary, 3=Technical, and 4= Four year college university and beyond.

I know that if both variables had two levels I could do a chi square test, but was not sure if there were two variables and one had more levels as to what to do? I would like to see the significance between level of education and smoking status.

Thank you

Accepted Solutions
Solution
‎12-01-2014 02:20 PM
Super User
Posts: 20,781

Re: Chi Square test or logistic regression for the kinds of categorical variables?

You can still do a chi square test if one variable has more than two levels.

If the cell counts get low you may want to use a Fisher's Exact test instead.

All Replies
Solution
‎12-01-2014 02:20 PM
Super User
Posts: 20,781

Re: Chi Square test or logistic regression for the kinds of categorical variables?

You can still do a chi square test if one variable has more than two levels.

If the cell counts get low you may want to use a Fisher's Exact test instead.

New Contributor
Posts: 4

Thank you!

New Contributor
Posts: 4

Re: Chi Square test or logistic regression for the kinds of categorical variables?

Also I had another question, if I wanted to see if there are significant differences in the levels of one categorical variable, what type of test would I conduct?

Thank you.

SAS Employee
Posts: 310

Re: Chi Square test or logistic regression for the kinds of categorical variables?

Since your predictor (education) is ordinal, you would generally want to do a trend test.  This can be done without fitting a model using the TREND option in PROC FREQ.  For this and other ways, see the Trend test for ordered alternatives item in the list Frequently Asked-for Statistics (FASTats).

New Contributor
Posts: 4