Hello,
I want to test for each age category if there is a significant difference by year, and I'm forgetting what statistically test I would use.
Year | Age_1 | Age_2 | Age_3 | Age_4 | Age_5 | Age_6 | Age_7 |
2019 | 38 | 544 | 1582 | 1330 | 886 | 536 | 134 |
2020 | 38 | 508 | 1765 | 1522 | 824 | 531 | 153 |
2021 | 34 | 495 | 1955 | 1843 | 1122 | 711 | 209 |
Thank you
Significant difference of what? The means? For AGE_1, you want to compare 38 to 38 to 34? Are these three numbers the means?
I'm afraid you can't do any statistical testing unless you have the raw data and multiple data points for each AGE/Year combination — or — you have the standard deviations and number of data points in each cell.
/*
You could try TREND Analysis by PROC FREQ,
Some dummy code like this,Or check the Doc of PROC FREQ.
*/
/*Code not tested*/
proc transpose data=have out=want;
by year;
var age_:;
run;
proc freq data=want;
table year*_name_/trend measure ci ;
weight col1;
run;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.