全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
4770 6
2013-12-04
悬赏 10 个论坛币 已解决
大家好,我想问一下,proc tabulate 做出的表格 我想按照 prcn或 prcsum或 n 或sum   排序输出显示  请问怎样编写程序

最佳答案

henryyhl 查看完整内容

在 proc tabulate 后加上order=freq 不知道可否。sas帮助中的介绍如下: ORDER=DATA | FORMATTED | FREQ | UNFORMATTED specifies the sort order to create the unique combinations of the values of the class variables, which form the headings of the table, according to the specified order. DATA orders values according to their order in the input data set. Interaction: If you use PRELOADFMT in ...
二维码

扫码加我 拉你入群

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

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

全部回复
2013-12-4 20:53:59
jibisha 发表于 2013-12-10 11:41
呵呵 经过我多日的研究发现, 对生成的html结果集输出时 同时生成数据集就可以了
proc tabulate data=a  ...
在 proc tabulate 后加上order=freq 不知道可否。sas帮助中的介绍如下:
ORDER=DATA | FORMATTED | FREQ | UNFORMATTED
specifies the sort order to create the unique combinations of the values of the class variables, which form the headings of the table, according to the specified order.

DATA
orders values according to their order in the input data set.

Interaction: If you use PRELOADFMT in the CLASS statement, then the order for the values of each class variable matches the order that PROC FORMAT uses to store the values of the associated user-defined format. If you use the CLASSDATA= option, then PROC TABULATE uses the order of the unique values of each class variable in the CLASSDATA= data set to order the output levels. If you use both options, then PROC TABULATE first uses the user-defined formats to order the output. If you omit EXCLUSIVE, then PROC TABULATE appends after the user-defined format and the CLASSDATA= values the unique values of the class variables in the input data set in the same order in which they are encountered.
Tip: By default, PROC FORMAT stores a format definition in sorted order. Use the NOTSORTED option to store the values or ranges of a user defined format in the order that you define them.

FORMATTED
orders values by their ascending formatted values. If no format has been assigned to a numeric class variable, then the default format, BEST12., is used. This order depends on your operating environment.

Alias: FMT | EXTERNAL

FREQ
orders values by descending frequency count.

Interaction: Use the ASCENDING option in the CLASS statement to order values by ascending frequency count.

UNFORMATTED
orders values by their unformatted values, which yields the same order as PROC SORT. This order depends on your operating environment. This sort sequence is particularly useful for displaying dates chronologically.

Alias: UNFMT | INTERNAL

Default: UNFORMATTED
Interaction: If you use the PRELOADFMT option in the CLASS statement, then PROC TABULATE orders the levels by the order of the values in the user-defined format.
Featured in: Understanding the Order of Headings with ORDER=DATA
二维码

扫码加我 拉你入群

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

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

2013-12-5 13:32:21
有没有知道的啊
10个币的赏啊
二维码

扫码加我 拉你入群

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

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

2013-12-10 11:40:30
呵呵 经过我多日的研究发现, 对生成的html结果集输出时 同时生成数据集就可以了
proc tabulate data=a out=j;
class agent;
var amount;
table agent,amount(n pctn sum pctsum);
run;
由此生成的数据集 你想怎么处理都行了啊哈哈
二维码

扫码加我 拉你入群

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

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

2013-12-10 11:41:03

呵呵 经过我多日的研究发现, 对生成的html结果集输出时 同时生成数据集就可以了
proc tabulate data=a out=j;
class agent;
var amount;
table agent,amount(n pctn sum pctsum);
run;
由此生成的数据集 你想怎么处理都行了啊哈哈
二维码

扫码加我 拉你入群

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

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

2013-12-13 10:12:49
henryyhl 发表于 2013-12-10 17:58
在 proc tabulate 后加上order=freq 不知道可否。sas帮助中的介绍如下:
ORDER=DATA | FORMATTED | FREQ ...
虽然我看不大懂但是看在你回复的份上 就你了 谢谢
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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