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
- /
- SAS Programming
- /
- General Programming
- /
- How to compare the difference between each two gro...

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

05-15-2013 09:01 AM

Dear SAS users,

I have the following data set created by a data procedure, what analysis method should I use so that I can know whether there is significant difference between each 2 groups regard to the performance (3 lelvels as Good, Mediate and Bad)?

Since the data is frequency data at each performance level in each group, thus I have no idea.

data result;

input performance $ group $ frequency@@;

datalines;

Good Gp1 10 Mediate Gp1 15 Bad Gp1 6

Good Gp2 12 Mediate Gp2 13 Bad Gp2 6

Good Gp3 10 Mediate Gp3 10 Bad Gp3 11

;

run;

Thanks for your help.

Frank Green

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

05-15-2013 09:40 AM

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

05-15-2013 12:46 PM

Seems like a chi-squared test in PROC FREQ will answer the question.

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

05-16-2013 12:02 AM

I am afraid, I can't agree with you. If you think freq procedure works, please let me check your code. Per my understanding, we can't use Freq to do this.

Anyway, still thanks for your reply.

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

05-16-2013 01:51 AM

That would not. chi-squared test is used to check relations between column and row variables.

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

05-16-2013 04:13 AM

Hi!

I am not a statistician, so I should probably stay out of this thread... Read this with a pinch of salt...

If we have the null hypothesis than there is no difference in the distribution of performance between groups, the code below will give us a p-value of 0.49. So, there is no significant difference between groups.

proc freq data=result;

table group*performance / chisq;

weight frequency;

run;

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

05-16-2013 06:25 AM

"the code below will give us a p-value of 0.49. So, there is no significant difference between groups."

That maybe should said there is no significant relative between groups and performance .

Dr. **SteveDenham ** may give us the exact answer .

Ksharp

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

05-16-2013 08:17 AM

Also you can do (and test with exact trend if you have combine performance into two level):

ods graphics on;

proc freq data=result;

weight frequency;

tables performance*group / chisq cmh measures cl

plots=freqplot(twoway=stacked);

test smdrc;

run;

ods graphics off;

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

05-16-2013 09:52 AM

The follow-up pairwise comparisons are the only tricky issue. Note that the overall test is not significant, so the p values for pair-wise comparisons are bound to be liberal. My thought is to use exact frequency methods, so I don't understand the objection to PROC FREQ, unless there are other factors involved.

First, the overall test:

proc freq data=result;

weight frequency;

tables performance*group /all;

exact fishers agree;

run;

Then the pair-wise comparisons:

proc freq data=result;

where group in ('Gp1',' Gp2');

weight frequency;

tables performance*group /all;

exact fishers agree;

run;

proc freq data=result;

where group in ('Gp1',' Gp3');

weight frequency;

tables performance*group /all;

exact fishers agree;

run;

proc freq data=result;

where group in ('Gp2',' Gp3');

weight frequency;

tables performance*group /all;

exact fishers agree;

run;

However, there is nothing significant in any of the tests here.

Steve Denham