全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1825 7
2015-11-08
悬赏 50 个论坛币 已解决
data如下:
78 70 79 78 77 78 69 72 73 75
79 76 66 80 76 78 68 77 71 77 83
78 76 70 72 75 72 76 73 72
66 66 74 64 69 67 70 75 70 68 69
64 72 65 66 70 75 81 70 66 76 71 70 75 73 72
74 81 79 76 71 81 70 75 77 75 72 73 90 65
83 80 84 84 84 82 82 84 82 81 79 81 76 81
85 85 87 85 96 85 86 85 85 95 84 85 84


每一行应该是15个数字,一共八行,每一行代表不同的含义:

Row 1 is the satisfaction of males flying Delta airlines

Row 2 isthe satisfaction of females flying Delta airlines      

Row 3 is the satisfaction of males flyingSouthwest airlines

Row 4 is the satisfaction offemales flying Southwest airlines

Row 5 is the satisfaction of males flyingAmerican airlines

Row 6 isthe satisfaction of females flying American airlines

Row 7 is the satisfaction of malesflying United airlines

Row 8 isthe satisfaction of females flying United airlines


然后要用loop进行整理把数据变成univariate,理想情况应该是

航空公司名字,性别,满意度


楼主写的code是这样的:

Data airline;

Infile 'C:\Users\Downloads\airline.txt' DLM='' missover;

do carrier="delta airlines","southwest airlines","american airlines","united airlines";

do sex="males","females";

do subj=1 to 15;

input rating @;

If rating=. then delete else output;

output;

end;

end;

end;

run;

proc print data=airline;

run;



但是运行出来全部变成了一个航空公司一个性别。。。



不知道code应该怎么改??

请懂的大神指教一下~~

谢谢~~


最佳答案

二维码

扫码加我 拉你入群

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

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

全部回复
2015-11-8 04:15:16
复制代码
二维码

扫码加我 拉你入群

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

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

2015-11-8 12:07:26
In your code, try @@ (you had one @); also I think you have duplicates in output. Do you have missing values?
二维码

扫码加我 拉你入群

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

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

2015-11-8 12:33:25
Did you try?
二维码

扫码加我 拉你入群

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

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

2015-11-8 13:45:20
johnpark1 发表于 2015-11-8 12:07
In your code, try @@ (you had one @); also I think you have duplicates in output. Do you have missin ...
thank you for you reply.
I tried @@ but didn't work.
Maybe sth wrong with missing variable
二维码

扫码加我 拉你入群

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

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

2015-11-8 13:45:55
teqel 发表于 2015-11-8 09:30
谢谢,现在电脑上没有sas明天早上运行试试看!!
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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