BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
LALRJ15
Calcite | Level 5

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

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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

5 REPLIES 5
Reeza
Super User

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.

LALRJ15
Calcite | Level 5

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.

StatDave
SAS Super FREQ

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).

LALRJ15
Calcite | Level 5

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?

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

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