Programming the statistical procedures from SAS

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

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

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: 18,528

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.

View solution in original post


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

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

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

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: 240

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

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

Thank you for your help. I want to understand this correctly. You conduct a chi square test to see if there is an association between your independent and dependent ( response ) variable first. If it is found to be significant, this means an association is supported between these two variables? To investigate deeper into as where the significance is observed, in what level it is observed, let's say level of education in the previous example, would I then have to do a logistic model to see the significance among each level in correspondence to the dependent variable?

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 349 views
  • 1 like
  • 3 in conversation