Hi, I need some help getting the summary statistics for table A to the format of table B. I have tried the following code but that is not sufficient (test table), I will require stats such as mode and median too. AND how do I format the data to look like the one in B.
proc means data=work.t2;
var gindex;
class year;
output out=work.t2
run;
Test
Analysis Variable : Index | ||||||
Year | N Obs | N | Mean | Std Dev | Minimum | Maximum |
2008 | ||||||
2009 | ||||||
2010 | ||||||
2011 |
Table A
Year | Index |
2008 | 4 |
2008 | 8 |
2008 | 7 |
2009 | 5 |
2009 | 8 |
2010 | 11 |
2010 | 14 |
2010 | 5 |
2011 | 6 |
Table B
2008 | 2009 | 2010 | 2011 | |
Min | ||||
Mean | ||||
Median | ||||
Mode | ||||
Max | ||||
Stand Dev |
Try this.
proc tabulate data=TableA;
class year;
var index;
table (n min mean median mode max stddev),year*index=' ';
run;
Try this.
proc tabulate data=TableA;
class year;
var index;
table (n min mean median mode max stddev),year*index=' ';
run;
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 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.