楼主: jibisha
4630 6

关于 proc tabulate 的问题 [推广有奖]

  • 1关注
  • 0粉丝

本科生

75%

还不是VIP/贵宾

-

威望
0
论坛币
439 个
通用积分
1.3500
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
3420 点
帖子
83
精华
0
在线时间
110 小时
注册时间
2010-10-27
最后登录
2023-7-29

楼主
jibisha 在职认证  发表于 2013-12-4 20:53:58 |只看作者 |坛友微信交流群|倒序 |AI写论文
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 ...
关键词:Tabulate Late Abu ATE tab 编写程序

回帖推荐

henryyhl 发表于5楼  查看完整内容

在 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 ...
沙发
henryyhl 发表于 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
It's not going to be easy, but it is going to be worth it.

使用道具

藤椅
jibisha 在职认证  发表于 2013-12-5 13:32:21 |只看作者 |坛友微信交流群
有没有知道的啊
10个币的赏啊

使用道具

板凳
jibisha 在职认证  发表于 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;
由此生成的数据集 你想怎么处理都行了啊哈哈

使用道具

报纸
jibisha 在职认证  发表于 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;
由此生成的数据集 你想怎么处理都行了啊哈哈

使用道具

地板
jibisha 在职认证  发表于 2013-12-13 10:12:49 |只看作者 |坛友微信交流群
henryyhl 发表于 2013-12-10 17:58
在 proc tabulate 后加上order=freq 不知道可否。sas帮助中的介绍如下:
ORDER=DATA | FORMATTED | FREQ ...
虽然我看不大懂但是看在你回复的份上 就你了 谢谢

使用道具

7
henryyhl 发表于 2013-12-13 12:52:20 |只看作者 |坛友微信交流群
jibisha 发表于 2013-12-13 10:12
虽然我看不大懂但是看在你回复的份上 就你了 谢谢
谢谢
It's not going to be easy, but it is going to be worth it.

使用道具

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

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

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

GMT+8, 2024-11-5 19:44