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 – 34 | 9.03 | 8.66 |
35 – 54 | 9.45 | 7.56 |
55+ | 8.75 | 6.65 |
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.
Do you have the original data generating these means?
Then consider looking at an ANOVA
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;
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.
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!
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.
Got it! It worked!
Thank you so much!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.