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;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.