Hello,
I am struggling with running tests on two dichotomous variables. I don't think I'm doing it correctly and I don't know how to interpret my output. My advisor said to do Chi-Square. When I do Chi square, I end up with info like this:
chi square test for equal proportions
chi square: 703.7583
DF: 1
PR>ChiSq: <.0001
This is my code:
Proc Freq data=filea;
tables Variable1 Variable2
/chisq;
run;
Thank you for any help you can provide!
The way you have it set up now, you will get two separate Chi-Square tests. Each test will test whether the proportions for the two groups are the same. Assuming that the output you posted was for Variable1, it is testing whether P(Variable1=Level 1)=P(Variable1=Level 2).
It might be that your intention is to test the equality of independent proportions, in which case you need to cross the two variables on the TABLES statement.
tables Variable1*Variable2/chisq;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.