请选择 进入手机版 | 继续访问电脑版
楼主: 一眼瞬间
16780 13

proc means output怎么才能把所有统计量都输出来? [推广有奖]

  • 0关注
  • 1粉丝

讲师

50%

还不是VIP/贵宾

-

威望
0
论坛币
730 个
通用积分
0.0001
学术水平
0 点
热心指数
4 点
信用等级
0 点
经验
903 点
帖子
376
精华
0
在线时间
309 小时
注册时间
2010-3-14
最后登录
2023-8-19

一眼瞬间 发表于 2010-3-19 15:56:03 |显示全部楼层 |坛友微信交流群

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
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;
然后结果巨怪异,只有一行数。。。。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:output outpu means mean ROC output means proc 统计量

回帖推荐

bobguy 发表于2楼  查看完整内容

The syntax is wrong. 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;

本帖被以下文库推荐

bobguy 发表于 2010-3-20 09:10:57 |显示全部楼层 |坛友微信交流群
一眼瞬间 发表于 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;
然后结果巨怪异,只有一行数。。。。
The syntax is wrong.

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;
已有 1 人评分经验 论坛币 收起 理由
bakoll + 3 + 3 精彩帖子

总评分: 经验 + 3  论坛币 + 3   查看全部评分

使用道具

一眼瞬间 发表于 2010-3-20 16:07:39 |显示全部楼层 |坛友微信交流群
bobguy 发表于 2010-3-20 09:10
一眼瞬间 发表于 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;
然后结果巨怪异,只有一行数。。。。
The syntax is wrong.

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;
But when I'm doing:
Proc means
     data=a
     N nmiss range mean std min max median q1 q3 p1 p99;
     var sa1 sa2 screvt sppent act;
run;

I still get the result at the output window. I didn't get what the problem is here.

使用道具

一眼瞬间 发表于 2010-3-20 16:57:31 |显示全部楼层 |坛友微信交流群
据说是因为“如果用output out=这个语句,只能得到一个OBS(由于样本量<2000)”

使用道具

bobguy 发表于 2010-3-21 07:30:54 |显示全部楼层 |坛友微信交流群
一眼瞬间 发表于 2010-3-20 16:57
据说是因为“如果用output out=这个语句,只能得到一个OBS(由于样本量
We are talking about a computer language. You have to follow the rules. Otherwise the results could be nonsanse at all.

使用道具

windlove 发表于 2010-3-21 08:50:52 |显示全部楼层 |坛友微信交流群
proc means data =  ...   noprint;

"noprint" statement will not output the results in the output window.

使用道具

一眼瞬间 发表于 2010-3-21 14:12:07 |显示全部楼层 |坛友微信交流群
一眼瞬间 发表于 2010-3-20 16:07
bobguy 发表于 2010-3-20 09:10
一眼瞬间 发表于 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;
然后结果巨怪异,只有一行数。。。。
The syntax is wrong.

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只有一个变量的时候显示是对的,
当我用多个VAR时,结果显示就是1行N列的一个不知道是什么的东西

使用道具

bobguy 发表于 2010-3-21 21:28:38 |显示全部楼层 |坛友微信交流群
一眼瞬间 发表于 2010-3-21 14:12
一眼瞬间 发表于 2010-3-20 16:07
bobguy 发表于 2010-3-20 09:10
一眼瞬间 发表于 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;
然后结果巨怪异,只有一行数。。。。
The syntax is wrong.

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只有一个变量的时候显示是对的,
当我用多个VAR时,结果显示就是1行N列的一个不知道是什么的东西
Take a detail look if every bit of information is there.


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

使用道具

一眼瞬间 发表于 2010-3-22 02:00:26 |显示全部楼层 |坛友微信交流群
bobguy 发表于 2010-3-21 21:28
一眼瞬间 发表于 2010-3-21 14:12
一眼瞬间 发表于 2010-3-20 16:07
bobguy 发表于 2010-3-20 09:10
一眼瞬间 发表于 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;
然后结果巨怪异,只有一行数。。。。
The syntax is wrong.

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只有一个变量的时候显示是对的,
当我用多个VAR时,结果显示就是1行N列的一个不知道是什么的东西
Take a detail look if every bit of information is there.


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
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.

使用道具

一眼瞬间 发表于 2010-3-22 02:09:02 |显示全部楼层 |坛友微信交流群
一眼瞬间 发表于 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.
I think it's the way computer do things.
BTW, I'm sorry if I'm a little annoying by asking this kind of detail :)

Have a good day!

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-16 22:03