
一眼瞬间 发表于 2010-3-19 15:56
RT.
Proc means
data=a
N nmiss range mean std min max median q1 q3 p1 p99;
var sa1 sa2 screvt sppent act;
output out=reffff;
run;
这样输出来只有其中五个基本统计量,怎么才能把所有的都输出来呢?
我不知道自己哪里错了
我尝试用
output out=reffff N nmiss range mean std min max median q1 q3 p1 p99;
然后结果巨怪异,只有一行数。。。。
bobguy 发表于 2010-3-20 09:10The syntax is wrong.一眼瞬间 发表于 2010-3-19 15:56
RT.
Proc means
data=a
N nmiss range mean std min max median q1 q3 p1 p99;
var sa1 sa2 screvt sppent act;
output out=reffff;
run;
这样输出来只有其中五个基本统计量,怎么才能把所有的都输出来呢?
我不知道自己哪里错了
我尝试用
output out=reffff N nmiss range mean std min max median q1 q3 p1 p99;
然后结果巨怪异,只有一行数。。。。
Here is an example with correct one.
data t1;
do i = 1 to 50;
x=rand('CHISQUARE', 3);
output;
end;
run;
proc means data=t1 noprint;
var x;
output out=stat n= nmiss= mean= min= max= range=
p1= p5= p10= p25= p50= p75= p90= p95= p99=/ autoname;
run;
proc print; run;
一眼瞬间 发表于 2010-3-20 16:07问题是我用了你的方法结果不行,不同之处是VAR 我有很多个变量bobguy 发表于 2010-3-20 09:10The syntax is wrong.一眼瞬间 发表于 2010-3-19 15:56
RT.
Proc means
data=a
N nmiss range mean std min max median q1 q3 p1 p99;
var sa1 sa2 screvt sppent act;
output out=reffff;
run;
这样输出来只有其中五个基本统计量,怎么才能把所有的都输出来呢?
我不知道自己哪里错了
我尝试用
output out=reffff N nmiss range mean std min max median q1 q3 p1 p99;
然后结果巨怪异,只有一行数。。。。
Here is an example with correct one.
data t1;
do i = 1 to 50;
x=rand('CHISQUARE', 3);
output;
end;
run;
proc means data=t1 noprint;
var x;
output out=stat n= nmiss= mean= min= max= range=
p1= p5= p10= p25= p50= p75= p90= p95= p99=/ autoname;
run;
proc print; run;
当VAR只有一个变量的时候显示是对的,
当我用多个VAR时,结果显示就是1行N列的一个不知道是什么的东西
一眼瞬间 发表于 2010-3-21 14:12Take a detail look if every bit of information is there.一眼瞬间 发表于 2010-3-20 16:07问题是我用了你的方法结果不行,不同之处是VAR 我有很多个变量bobguy 发表于 2010-3-20 09:10The syntax is wrong.一眼瞬间 发表于 2010-3-19 15:56
RT.
Proc means
data=a
N nmiss range mean std min max median q1 q3 p1 p99;
var sa1 sa2 screvt sppent act;
output out=reffff;
run;
这样输出来只有其中五个基本统计量,怎么才能把所有的都输出来呢?
我不知道自己哪里错了
我尝试用
output out=reffff N nmiss range mean std min max median q1 q3 p1 p99;
然后结果巨怪异,只有一行数。。。。
Here is an example with correct one.
data t1;
do i = 1 to 50;
x=rand('CHISQUARE', 3);
output;
end;
run;
proc means data=t1 noprint;
var x;
output out=stat n= nmiss= mean= min= max= range=
p1= p5= p10= p25= p50= p75= p90= p95= p99=/ autoname;
run;
proc print; run;
当VAR只有一个变量的时候显示是对的,
当我用多个VAR时,结果显示就是1行N列的一个不知道是什么的东西
data t1;
do i = 1 to 50;
x=rand('CHISQUARE', 3);
y=rand('CHISQUARE', 3);
output;
end;
run;
proc means data=t1
n nmiss mean min max range
p1 p5 p10 p25 p50 p75 p90 p95 p99 ;
var x y;
run;
proc means data=t1 noprint;
var x y;
output out=stat n= nmiss= mean= min= max= range=
p1= p5= p10= p25= p50= p75= p90= p95= p99=/ autoname;
run;
proc print; run;
The SAS System 09:22 Sunday, March 21, 2010 3
The MEANS Procedure
N
Variable N Miss Mean Minimum Maximum Range 1st Pctl
-----------------------------------------------------------------------------------------------
i 50 0 25.5000000 1.0000000 50.0000000 49.0000000 1.0000000
x 50 0 2.8525658 0.0350569 13.9483382 13.9132813 0.0350569
y 50 0 2.7263163 0.2704664 8.4346762 8.1642098 0.2704664
-----------------------------------------------------------------------------------------------
Variable 5th Pctl 10th Pctl 25th Pctl 50th Pctl 75th Pctl 90th Pctl
--------------------------------------------------------------------------------------------------
i 3.0000000 5.5000000 13.0000000 25.5000000 38.0000000 45.5000000
x 0.4656547 0.5165117 1.0960989 2.1619551 3.8743458 6.2263269
y 0.5077819 0.7163467 1.3167938 2.3590939 3.7653805 5.3385164
--------------------------------------------------------------------------------------------------
Variable 95th Pctl 99th Pctl
---------------------------------------
i 48.0000000 50.0000000
x 7.7285410 13.9483382
y 7.2153141 8.4346762
---------------------------------------
The SAS System 09:22 Sunday, March 21, 2010 4
Obs _TYPE_ _FREQ_ i_N x_N y_N i_NMiss x_NMiss y_NMiss i_Mean x_Mean y_Mean i_Min x_Min
1 0 50 50 50 50 0 0 0 25.5 2.85257 2.72632 1 0.035057
Obs y_Min i_Max x_Max y_Max i_Range x_Range y_Range i_P1 x_P1 y_P1 i_P5 x_P5
1 0.27047 50 13.9483 8.43468 49 13.9133 8.16421 1 0.035057 0.27047 3 0.46565
Obs y_P5 i_P10 x_P10 y_P10 i_P25 x_P25 y_P25 i_P50 x_P50 y_P50 i_P75 x_P75
1 0.50778 5.5 0.51651 0.71635 13 1.09610 1.31679 25.5 2.16196 2.35909 38 3.87435
Obs y_P75 i_P90 x_P90 y_P90 i_P95 x_P95 y_P95 i_P99 x_P99 y_P99
1 3.76538 45.5 6.22633 5.33852 48 7.72854 7.21531 50 13.9483 8.43468
bobguy 发表于 2010-3-21 21:28Thanks so much, bobguy.一眼瞬间 发表于 2010-3-21 14:12Take a detail look if every bit of information is there.一眼瞬间 发表于 2010-3-20 16:07问题是我用了你的方法结果不行,不同之处是VAR 我有很多个变量bobguy 发表于 2010-3-20 09:10The syntax is wrong.一眼瞬间 发表于 2010-3-19 15:56
RT.
Proc means
data=a
N nmiss range mean std min max median q1 q3 p1 p99;
var sa1 sa2 screvt sppent act;
output out=reffff;
run;
这样输出来只有其中五个基本统计量,怎么才能把所有的都输出来呢?
我不知道自己哪里错了
我尝试用
output out=reffff N nmiss range mean std min max median q1 q3 p1 p99;
然后结果巨怪异,只有一行数。。。。
Here is an example with correct one.
data t1;
do i = 1 to 50;
x=rand('CHISQUARE', 3);
output;
end;
run;
proc means data=t1 noprint;
var x;
output out=stat n= nmiss= mean= min= max= range=
p1= p5= p10= p25= p50= p75= p90= p95= p99=/ autoname;
run;
proc print; run;
当VAR只有一个变量的时候显示是对的,
当我用多个VAR时,结果显示就是1行N列的一个不知道是什么的东西
data t1;
do i = 1 to 50;
x=rand('CHISQUARE', 3);
y=rand('CHISQUARE', 3);
output;
end;
run;
proc means data=t1
n nmiss mean min max range
p1 p5 p10 p25 p50 p75 p90 p95 p99 ;
var x y;
run;
proc means data=t1 noprint;
var x y;
output out=stat n= nmiss= mean= min= max= range=
p1= p5= p10= p25= p50= p75= p90= p95= p99=/ autoname;
run;
proc print; run;
The SAS System 09:22 Sunday, March 21, 2010 3
The MEANS Procedure
N
Variable N Miss Mean Minimum Maximum Range 1st Pctl
-----------------------------------------------------------------------------------------------
i 50 0 25.5000000 1.0000000 50.0000000 49.0000000 1.0000000
x 50 0 2.8525658 0.0350569 13.9483382 13.9132813 0.0350569
y 50 0 2.7263163 0.2704664 8.4346762 8.1642098 0.2704664
-----------------------------------------------------------------------------------------------
Variable 5th Pctl 10th Pctl 25th Pctl 50th Pctl 75th Pctl 90th Pctl
--------------------------------------------------------------------------------------------------
i 3.0000000 5.5000000 13.0000000 25.5000000 38.0000000 45.5000000
x 0.4656547 0.5165117 1.0960989 2.1619551 3.8743458 6.2263269
y 0.5077819 0.7163467 1.3167938 2.3590939 3.7653805 5.3385164
--------------------------------------------------------------------------------------------------
Variable 95th Pctl 99th Pctl
---------------------------------------
i 48.0000000 50.0000000
x 7.7285410 13.9483382
y 7.2153141 8.4346762
---------------------------------------
The SAS System 09:22 Sunday, March 21, 2010 4
Obs _TYPE_ _FREQ_ i_N x_N y_N i_NMiss x_NMiss y_NMiss i_Mean x_Mean y_Mean i_Min x_Min
1 0 50 50 50 50 0 0 0 25.5 2.85257 2.72632 1 0.035057
Obs y_Min i_Max x_Max y_Max i_Range x_Range y_Range i_P1 x_P1 y_P1 i_P5 x_P5
1 0.27047 50 13.9483 8.43468 49 13.9133 8.16421 1 0.035057 0.27047 3 0.46565
Obs y_P5 i_P10 x_P10 y_P10 i_P25 x_P25 y_P25 i_P50 x_P50 y_P50 i_P75 x_P75
1 0.50778 5.5 0.51651 0.71635 13 1.09610 1.31679 25.5 2.16196 2.35909 38 3.87435
Obs y_P75 i_P90 x_P90 y_P90 i_P95 x_P95 y_P95 i_P99 x_P99 y_P99
1 3.76538 45.5 6.22633 5.33852 48 7.72854 7.21531 50 13.9483 8.43468
Yes, you are right. We can get solution by running the above code. Just the "stat" file does not look beautiful. There are only one obversation and N variables in the "stat" file, i.e. it's one line.
The format looks nice in the sas output window.
一眼瞬间 发表于 2010-3-22 02:00
Thanks so much, bobguy.
Yes, you are right. We can get solution by running the above code. Just the "stat" file does not look beautiful. There are only one obversation and N variables in the "stat" file, i.e. it's one line.
The format looks nice in the sas output window.
扫码加好友,拉您进群



收藏