全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
3539 6
2009-06-11

code 如下:

proc means data=dataset n nmiss min p5 p10 p25 p50 p75 p90 p95 max mean std;
var _numeric_;
output out=dataset2;
run;

新生成的dataset2 和sas 程序跑出来的output 不一样,dataset2 里只有 N min max mean median std, 缺少p5 p10 p25 等等

如何让生产的dataset  和跑出来的output 一样?

请各位热心的朋友解答一下,谢谢!

二维码

扫码加我 拉你入群

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

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

全部回复
2009-6-11 21:04:00

data dataset;

dataset;

input x y;

x y;

cards;

1 2

1 2

1 3

;

;

1 2

1 2

1 3

;

proc means data=dataset n nmiss min p5 p10 p25 p50 p75 p90 p95 max mean std;

means data=dataset n nmiss min p5 p10 p25 p50 p75 p90 p95 max mean std;

var _numeric_;

_numeric_;

output out=dataset2 n=n nmiss=nmiss min=min p5=p5 p10=p10 p25=p25 p50=p50 p75=p75 p90=p90 p95=p95 max=max mean=mean std=std;

out=dataset2 n=n nmiss=nmiss min=min p5=p5 p10=p10 p25=p25 p50=p50 p75=p75 p90=p90 p95=p95 max=max mean=mean std=std;

run;

;

*there, if without specifying anything in output statement, dataset2 would only include the default statistics, which is nothing to do with your

specification in means statement;note that, the name of statistics is arbitrary, for example, you can say, n=sample p25=q1, and so on;

*thanks;

二维码

扫码加我 拉你入群

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

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

2009-6-11 21:16:00

i find that all my replies are not exactly shown the same as I hoped. please take your own judgement for that.

basically,

proc means data=dataset; *you don't need to write those statistics here;
  var _numeric_;
  output out=datasets
            n=sample nmiss=Nmissing min=minimum max=max p5=p5 p10=p10 p25=q1 p75=q3 p50=median p90=p90 mean=average std=std;
            *you have to list all what you want here otherwise you will get the default statistics about which you were complaining;
            *arbitrary names,but you have to correctly spell the statistic names;
run;

thanks,

二维码

扫码加我 拉你入群

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

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

2009-6-12 04:53:00
学习了
二维码

扫码加我 拉你入群

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

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

2009-6-12 04:55:00
谢谢。 知道了
二维码

扫码加我 拉你入群

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

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

2009-6-12 10:53:00
大哥这个运行出来只有一行啊,请高手再解答下吧.
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群