楼主: 乐天天12300
1459 3

[有偿编程] SAS如何制作以下格式的制作统计表格 [推广有奖]

  • 0关注
  • 3粉丝

已卖:352份资源

讲师

96%

还不是VIP/贵宾

-

威望
0
论坛币
4875 个
通用积分
360.1222
学术水平
60 点
热心指数
70 点
信用等级
42 点
经验
9962 点
帖子
243
精华
0
在线时间
1004 小时
注册时间
2016-11-28
最后登录
2025-5-3

楼主
乐天天12300 发表于 2021-12-31 16:00:24 |AI写论文
50论坛币
  1. proc template;
  2.    define style styles.myrtf;
  3.    style table from table/
  4.        frame = hsides
  5.        rules = groups     
  6.        cellspacing = 0pt
  7.        cellpadding = 3pt
  8.       bordertopwidth=3
  9.       borderbottomwidth=3;
  10.    end;
  11. run;

  12. ods rtf file="test.rtf" style=myrtf;
  13. proc report data=sashelp.class;
  14.     column sex ("指标" (weight height));
  15.    define sex/group;
  16. run;
  17. ods rtf close;
复制代码
上面的程序生成的表格为
下载.png

我想在上述程序的基础上实现制作以下格式的统计表格:性别单元格和上面合并居中,指标下加了一条线
下载 (1).png


最佳答案

whymath 查看完整内容

你自己几乎就要完成了:
关键词:统计表 proc report Template SASHELP spacing

沙发
whymath 发表于 2021-12-31 16:00:25
你自己几乎就要完成了:
  1. ods rtf file="test.rtf" style=myrtf;
  2. proc report data=sashelp.class;
  3.     column sex ("(*ESC*)S={borderbottomcolor=black borderbottomwidth=0}指标" (weight height));
  4.    define sex/group;
  5. run;
  6. ods rtf close;
复制代码

藤椅
hti7146627 发表于 2022-1-2 22:12:14
一般这种使用RTF 语言实现,一般表示方法 "~R/RTF'\ql\brdrb\brdrs\brdrwr{指标}'" 注意的是 ~ 是定义的转移字符 需要根据实际转移字符调整

板凳
popodan 在职认证  发表于 2022-1-6 09:47:34
proc report 不提供合并单元格功能。你可以使用proc tabulate 的box来实现你需要的:

ods rtf file="D:\test.rtf" style=myrtf;

proc report data=sashelp.class nowd split='*';
column sex ('Index'  height weight);
define sex /Group;
run;

proc tabulate data=sashelp.class;
  class sex;
  var  height weight;
  table sex='', sum='Index'* (height weight)/  box='sex';

run;
ods rtf close;

example.png (23.71 KB)

example.png

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-8 22:59