楼主: dolphinfish
1706 2

Simple Transpose [推广有奖]

  • 0关注
  • 0粉丝

讲师

24%

还不是VIP/贵宾

-

威望
0
论坛币
2753 个
通用积分
0.4550
学术水平
1 点
热心指数
4 点
信用等级
1 点
经验
13027 点
帖子
150
精华
0
在线时间
679 小时
注册时间
2009-8-26
最后登录
2021-5-29

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
Program:
data score;
   input Student $ StudentID $ Section $ Test1 Test2 Final;
   datalines;
Capalleti 0545 1  94 91 87
Dubose    1252 2  51 65 91
Engles    1167 1  95 97 97
Grant     1230 2  63 75 80
Krupski   2527 2  80 76 71
Lundsford 4860 1  92 40 86
McBane    0674 1  75 78 72
;
proc transpose data=score out=score_transposed;
run;


proc print data=score_transposed noobs;
    title 'Student Test Scores in Variables';
run;

Output:
                                Student Test Scores in Variables                              
                                                                   21:24 Saturday, March 9, 2002

                 _NAME_    COL1    COL2    COL3    COL4    COL5    COL6    COL7

                 Test1      94      51      95      63      80      92      75
                 Test2      91      65      97      75      76      40      78
                 Final      87      91      97      80      71      86      72

My question: Why are Char columns excluded from output???  How come only the three Num columns are transposed?

Thanks!
二维码

扫码加我 拉你入群

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

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

关键词:Transpose simple Trans pose ans Transpose simple

沙发
jingju11 发表于 2010-3-9 22:00:15 |只看作者 |坛友微信交流群
dolphinfish 发表于 2010-3-9 21:42
Program:
data score;
   input Student $ StudentID $ Section $ Test1 Test2 Final;
   datalines;
Capalleti 0545 1  94 91 87
Dubose    1252 2  51 65 91
Engles    1167 1  95 97 97
Grant     1230 2  63 75 80
Krupski   2527 2  80 76 71
Lundsford 4860 1  92 40 86
McBane    0674 1  75 78 72
;
proc transpose data=score out=score_transposed;
run;


proc print data=score_transposed noobs;
    title 'Student Test Scores in Variables';
run;

Output:
                                Student Test Scores in Variables                              
                                                                   21:24 Saturday, March 9, 2002

                 _NAME_    COL1    COL2    COL3    COL4    COL5    COL6    COL7

                 Test1      94      51      95      63      80      92      75
                 Test2      91      65      97      75      76      40      78
                 Final      87      91      97      80      71      86      72

My question: Why are Char columns excluded from output???  How come only the three Num columns are transposed?

Thanks!
The two questions actually are the same. If VAR statement is not specified, only those numeric variables will be transposed by SAS default.

使用道具

藤椅
醉_清风 发表于 2010-3-10 09:15:19 |只看作者 |坛友微信交流群
进来温故而知新
从来不需要想起 永远也不会忘记

使用道具

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

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

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

GMT+8, 2024-4-30 21:01