Hi there,
Is there a way to combine proc means with proc ttest across several variables to create a single table that gives mean, sd, median and iqr for different groups as well as a ttest.
This creates an approximation of what I want:
proc means data=sashelp.cars n mean stddev median q1 q3 prt;
class origin;
var msrp invoice MPG_Highway;run;
The difference is that I want origin as columns and the ttest to compare means and medians across origins:
| Asia | | | | | | Europe | | | | | | USA | | | | | | | |
Variable | N | Mean | Std Dev | Median | Lower Quartile | Upper Quartile | N | Mean | Std Dev | Median | Lower Quartile | Upper Quartile | N | Mean | Std Dev | Median | Lower Quartile | Upper Quartile | Pr > |t| MEDIAN | Pr > |t| MEAN |
MSRP | 158 | 24741.32 | 11321.07 | 23032.5 | 17200 | 28800 | 123 | 48349.8 | 25318.6 | 40590 | 33780 | 56595 | 147 | 28377.44 | 11711.98 | 25520 | 20310 | 33995 | p | p |
Invoice | 158 | 22602.18 | 9842.98 | 20949.5 | 16265 | 26660 | 123 | 44395.08 | 23080.37 | 37575 | 31187 | 51815 | 147 | 25949.34 | 10518.72 | 23217 | 18881 | 30846 | p | p |
MPG_Highway | 158 | 28.26582 | 6.770503 | 27 | 25 | 31 | 123 | 26.00813 | 4.167588 | 26 | 24 | 29 | 147 | 26.01361 | 5.396582 | 26 | 22 | 29 | p | p |
Many thanks