楼主: slimdell
755 0

DD's SAS notes 18Sep2012 [推广有奖]

  • 0关注
  • 19粉丝

已卖:2049份资源

副教授

76%

还不是VIP/贵宾

-

TA的文库  其他...

移动医疗

大数据与可视化

医药行业分析

威望
0
论坛币
19053 个
通用积分
620.8039
学术水平
47 点
热心指数
58 点
信用等级
42 点
经验
7016 点
帖子
580
精华
0
在线时间
1266 小时
注册时间
2012-8-10
最后登录
2021-4-25

楼主
slimdell 发表于 2012-9-18 16:48:31 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
今天找到一篇09年SUGI上讲PROC TRANSPOSE 的入门文章

Paper 060-2009:

Zirbel, Douglas

Learn the Basics of PROC TRANSPOSE



Quick Reference Sheet – Proc Transpose
·  Proc Transpose changes multiple values in rows (for a column) into columns, and can also change multiple
columns’ values into multiple rows values for a single column
·  It knows how many columns to create for your output file based on the maximum number of values in a column
to be transposed (to do this with a Data Step is tedious)
·  ID statement names the column in the input file whose row values provide the column names in the output file.
There should only be one variable in an ID statement. Also, the column used for the ID statement cannot have
any duplicate values. For example, Mr. Black and Mr. White cannot both have cats. If this is the case, one
solution is to create a different input dataset by using Proc Means to sum the values so that there is only one row
for each pet. What if the values of ID are numeric and can’t be used as SAS column names? Then use the
prefix= option with the ID statement to create variables like “mile140”, “mile150”, etc.
·  VAR statement specifies which variables’ values are to be transposed; can be character and/or numeric
variables; if VAR is omitted, Transpose transposes all numeric vars
·  BY statement names row-identification variable(s) whose values are not transposed; it requires a preliminary
Proc Sort
·  Transpose includes some default variables in the output dataset such as _NAME_, _LABEL_. You can override
them with statement options or drop them in a dataset drop option
·  Prefix option provides a prefix to the transposed column names instead of COL1, COL2, etc
·  Name option provides the name for an output file column which tells which input variables were transposed
·  Transposing two times – it is sometimes necessary to transpose an input file two or more times, then merge
the output files together due to the only-1-ID-per-transpose limitation.
二维码

扫码加我 拉你入群

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

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

关键词:notes note not Preliminary Limitation multiple change number create single

知乎专栏/微信公号同名:煮酒烹茶读书

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

本版微信群
jg-xs1
拉您进交流群
GMT+8, 2026-1-11 15:48