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;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.