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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.