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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.