Hi,
I want to create a table where each column is a variable.
Rows are Mean, Median, percentile 15, percentile 85, percentile x.
For mean and median, I can do it as below.
However, when it come to percentile, I can't specify the output name as for mean and median so I am kind of stuck.
Can you please help?
Thank you,
HHC
data have;
input v0 v1 v2 v3 v4 v5;
datalines;
1 1 0 5 6 0
1 1 0 5 7 1
2 1 0 5 7 0
4 1 1 5 6 1
5 1 0 5 6 0
6 1 1 5 9 0
7 1 0 5 2 -1
8 2 1 5 4 -1
9 2 1 5 1 0
;run;
proc univariate data=have noprint;
var v0-v5;
output out=stat_1
mean=v0-v5;run;
data stat_1; set stat_1;
statistic = 'MEAN';run;
proc univariate data=have noprint;
var v0-v5;
output out=stat_2
median=v0-v5;run;
data stat_2; set stat_2;
statistic = 'MEDIAN';run;
*I can stack one on top of the other as name are the same;
data summary; set stat_1 stat_2;run;
proc univariate data=have noprint;
var v0-v5;
output out=stat_2
pctlpts= 15
pctlname=v0-v5; *this doesn't work;
run;
... View more