BookmarkSubscribeRSS Feed
LucasL
Calcite | Level 5

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!

2 REPLIES 2
SAS_Rob
SAS Employee

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;

Ksharp
Super User
What kind of test do you want to do ?
If it is two way contingency table ,you need symbol '*' .

Proc Freq data=filea;
tables Variable1*Variable2
/chisq fisher agree ;
run;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 542 views
  • 2 likes
  • 3 in conversation