data1.xls
(13.5 KB)
x "cd d:\docs";
proc import datafile="data1.xls"
out=data1 replace;
/* sheet='sheet1';*/
getnames=yes;
run;
proc sort; by Share Date;
run;
proc means data = data1;
class share date;
output out=stat1
mean=avg_turnover std=std_turnover
max=max_turnover min=min_turnover;
var turnover;
run;
proc print data=stat1 noobs;
run;
data total_mean goup_mean;
set stat1;
if share=.
then output total_mean;
else output goup_mean;
run;
/*------------------The result in the output window---------------*/
avg_ std_ max_ min_
Share Date _TYPE_ _FREQ_ turnover turnover turnover turnover
. . 0 16 39.75 20.62 86 11
. 2000Q1 1 8 42.75 16.60 64 12
. 2000Q2 1 8 36.75 24.81 86 11
1 . 2 8 35.75 20.26 64 11
2 . 2 8 43.75 21.55 86 12
1 2000Q1 3 4 41.00 23.00 64 12
1 2000Q2 3 4 30.50 18.84 55 11
2 2000Q1 3 4 44.50 10.27 53 31
2 2000Q2 3 4 43.00 31.26 86 12
/*The 1st line show the mean, std, max, min of turnover for all the share and all the periods*/
/*The 2nd and 3rd lines show those statistics for all the share and the period of 2000Q1, 2000Q2 etc.*/
/*The 4th and 5th lines show those for share 1, 2 etc and all the periods.*/
/*The 6th-9th lines show those for share 1, 2 etc and the period of 2000Q1, 2000Q2 etc.*/


雷达卡



京公网安备 11010802022788号







