楼主: uwo2009
3575 6

[求助]如何让生成的dataset和output一致呢? [推广有奖]

  • 0关注
  • 0粉丝

学前班

30%

还不是VIP/贵宾

-

威望
0
论坛币
13 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
68 点
帖子
3
精华
0
在线时间
2 小时
注册时间
2009-6-11
最后登录
2009-11-4

楼主
uwo2009 发表于 2009-6-11 17:26:00 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币

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 一样?

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

二维码

扫码加我 拉你入群

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

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

关键词:dataset output outpu DataS Data output dataset

回帖推荐

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

data dataset; dataset;input x y; x y;cards;1 21 21 3;;1 21 21 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=nmi ...

本帖被以下文库推荐

沙发
jingju11 发表于 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;

藤椅
jingju11 发表于 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,

已有 1 人评分经验 论坛币 收起 理由
bakoll + 3 + 3 精彩帖子

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

板凳
monicawang 发表于 2009-6-12 04:53:00
学习了

报纸
freeseaman 发表于 2009-6-12 04:55:00
谢谢。 知道了

地板
yz830215 发表于 2009-6-12 10:53:00
大哥这个运行出来只有一行啊,请高手再解答下吧.

7
uwo2009 发表于 2009-6-12 11:10:00

Thanks for your reply, however your code seems not slove my problem. I want the new dataset has all the numeric variables with their min p5 p10 p25 ....etc.  Using your codes, I just get one row in my new dataset, and this new dataset is still different from my output.

Please give your further suggesiton, thanks!

[em10]

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-9 06:51