BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
einstein
Quartz | Level 8

I have the average of two rating catgories among 3 age groups.

 

Is there a way to test if the means in Rating 1 are statistically different among the three age groups (is 9.03 statistically different from 9.45 and 8.75)?

 

And if there is also a way to test if the mean for rating 1 is statistically different from the mean for rating 2?

 

Thanks!

 Rating 1 (1-10)Rating 2(1-10)
Age  
   18 – 349.038.66
   35 – 549.457.56
   55+8.756.65
1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

Suppose you create a variable rating_diff = rating_1 - rating_2 then

 

proc univariate data=myData;
by age;
var rating_diff;
run;

 

and look for the location test results in the report.

PG

View solution in original post

8 REPLIES 8
PeterClemmensen
Tourmaline | Level 20

Do you have the original data generating these means?

einstein
Quartz | Level 8
Yes, I have the original data that is computing these means.
Reeza
Super User

Then consider looking at an ANOVA

einstein
Quartz | Level 8

Then consider looking at an ANOVA

 

 

I don't want to be dense, but if I use ANOVA, is this the correct way to get I what I need?

Be able to compare rating_1 vs. rating_2 for each age grouping?

 

proc anova;
class rating_1 rating_2;
model age=rating_1 rating_2 rating_1*rating_2;
means rating_1 rating_2 /t tukey sidak;
means rating_1*rating_2 /t tukey sidak;
format age age. ;
run;

PGStats
Opal | Level 21

Since your ratings have a finite range [1-10], you should consider using non parametric tests such as the Kruskal-Wallis test available with option Wilcoxon in proc npar1way.

 

If rating 1 and rating 2 have been measured on the same individual, you should consider testing rating 1 - rating 2 against zero with one of the location tests available in proc univariate such as the Wilcoxon signed rank test.

PG
einstein
Quartz | Level 8

Since your ratings have a finite range [1-10], you should consider using non parametric tests such as the Kruskal-Wallis test available with option Wilcoxon in proc npar1way.

 

I just tried this and I think it worked! Assuming I am understanding this correct, this is letting me compare if the values within the age groupings for rating_1 and rating_2 are statistically significant from each other.  Thanks!

 

 

  proc npar1way wilcoxon correct=no data=tables;
      class age;
      var rating_1 rating_2;
      exact wilcoxon;
      format age age. ;
   run;

 

This one below I'm not quite sure how to implement - would you happen to have some sample code to do this?

If rating 1 and rating 2 have been measured on the same individual, you should consider testing rating 1 - rating 2 against zero with one of the location tests available in proc univariate such as the Wilcoxon signed rank test.

 

Thanks!

 

 

PGStats
Opal | Level 21

Suppose you create a variable rating_diff = rating_1 - rating_2 then

 

proc univariate data=myData;
by age;
var rating_diff;
run;

 

and look for the location test results in the report.

PG
einstein
Quartz | Level 8

Got it!  It worked!

 

Thank you so much!

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
  • 8 replies
  • 2211 views
  • 2 likes
  • 4 in conversation