|
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应该怎么改?? 请懂的大神指教一下~~ 谢谢~~
|