turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Comparions/P-value/right test in sas

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-26-2012 12:17 PM

Hi,

I have a dataset that looks like the following,

variable x :1 = very worried, 2 = slightly worried ,3 = Not worried

variable y : 1 = more likely, 2 = no change ,3 = less likely

I would like to comparsion the factor variable x and outcome variable y.

Which 's test inside sas will give the right p-value?

Thanks.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-26-2012 12:43 PM

A good general purpose test for the relationship between two categorical variables is Fisher's exact test. If your number of observations is not too large ( < 100 say), use the following :

proc freq data=myData;

tables x*y;

exact Fisher / maxtime=20;

run;

If the computation doesn't terminate within 20 seconds, add the MC option to the EXACT statement.

PG

PG

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-03-2012 10:33 AM

Christina,

"Right" is a very slippery term in this sort of analysis. There is probably no single answer. There is a huge literature on testing association among ordered variables.

The Fisher's Exact Test that PG recommended is a general purpose test that could be used, but it is known to be conservative. If your sample size is larger, then you could use the Chi-Squared test that is part of PROC FREQ to address general association.

Neither of these tests take advantage of the inherent ordering of the two variables. I prefer Kendall's Tau-b (also part of FREQ).

Doc Muhlbaier

Duke