楼主: mathkkk
12708 10

[实际应用] 怎样在三线表中间加一条线 [推广有奖]

  • 0关注
  • 0粉丝

本科生

75%

还不是VIP/贵宾

-

威望
0
论坛币
1026 个
通用积分
8.0000
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
725 点
帖子
23
精华
0
在线时间
185 小时
注册时间
2014-11-7
最后登录
2022-1-4

楼主
mathkkk 学生认证  发表于 2017-11-6 10:28:50 |只看作者 |坛友微信交流群|倒序 |AI写论文
10论坛币
1509935063(1).png
怎样在第二行与第三行之间加一条横线?

关键词:三线表
沙发
vtalent 发表于 2017-11-6 10:32:20 |只看作者 |坛友微信交流群
贴到excel,添加表格框,再复制出来。

使用道具

藤椅
mathkkk 学生认证  发表于 2017-11-6 10:43:04 |只看作者 |坛友微信交流群
vtalent 发表于 2017-11-6 10:32
贴到excel,添加表格框,再复制出来。
需要SAS代码实现,您这样的方法不适合。不过还是谢谢您的热心帮助。

使用道具

板凳
lovexialulu 发表于 2017-11-6 10:52:58 |只看作者 |坛友微信交流群
加空行 比较常规吧 :break after ord / skip;

加横线 试试 :
compute after ord;
  line @1 "_";
    endcomp;
已有 1 人评分论坛币 收起 理由
admin_kefu + 10 热心帮助其他会员

总评分: 论坛币 + 10   查看全部评分

使用道具

报纸
vtalent 发表于 2017-11-6 10:56:04 |只看作者 |坛友微信交流群
mathkkk 发表于 2017-11-6 10:43
需要SAS代码实现,您这样的方法不适合。不过还是谢谢您的热心帮助。

使用道具

地板
mathkkk 学生认证  发表于 2017-11-6 10:59:40 |只看作者 |坛友微信交流群
lovexialulu 发表于 2017-11-6 10:52
加空行 比较常规吧 :break after ord / skip;

加横线 试试 :
您的意思是在第二行与第三行之间加一行空格,再按您的处理方法吗?

使用道具

7
lovexialulu 发表于 2017-11-6 11:19:10 |只看作者 |坛友微信交流群
mathkkk 发表于 2017-11-6 10:59
您的意思是在第二行与第三行之间加一行空格,再按您的处理方法吗?
那是两种方案,ord 是数值型变量(2,3行ord值应该是一样的)在proc report里面用

使用道具

8
mathkkk 学生认证  发表于 2017-11-6 13:10:45 |只看作者 |坛友微信交流群
lovexialulu 发表于 2017-11-6 11:19
那是两种方案,ord 是数值型变量(2,3行ord值应该是一样的)在proc report里面用
还是不行

使用道具

9
mathkkk 学生认证  发表于 2017-11-6 14:59:49 |只看作者 |坛友微信交流群
lovexialulu 发表于 2017-11-6 11:19
那是两种方案,ord 是数值型变量(2,3行ord值应该是一样的)在proc report里面用
proc sql;
        create table table_1 as
                select sex
                        ,mean(height) as m_h
                        ,std(height) as std_h
                        ,mean(weight) as m_w
                        ,std(weight) as std_w
                        ,mean(age) as m_a
                        ,std(age) as std_a
                from sashelp.class
                        group by sex
        ;
quit;

proc sql;
        create table table_2 as
                select
                        mean(height) as m_h
                        ,std(height) as std_h
                        ,mean(weight) as m_w
                        ,std(weight) as std_w
                        ,mean(age) as m_a
                        ,std(age) as std_a
                from sashelp.class
        ;
quit;

data table_3;
        set table_1 table_2;
run;

data table_4(keep=sex height weight age);
        set table_3;
        height=cats(put(m_h,4.1),"±",put(std_h,3.1));
        weight=cats(put(m_w,5.1),"±",put(std_w,4.1));
        age=cats(put(m_a,4.1),"±",put(std_a,3.1));

        if sex="男" then
                sex="男性";
        else if sex="女" then
                sex="女性";
        else if sex=" " then
                sex="合计";
run;

proc template;
        define style Styles.Threelines;
                parent = Styles.Default;
                replace fonts /
                        'TitleFont2' = ("Times New Roman",10pt)
                        'TitleFont' = ("Times New Roman",10pt)
                        'StrongFont' = ("Times New Roman",10pt)
                        'EmphasisFont' = ("Times New Roman",10pt)
                        'FixedEmphasisFont' = ("Times New Roman, Courier",10pt)
                        'FixedStrongFont' = ("Times New Roman, Courier",10pt)
                        'FixedHeadingFont' = ("Times New Roman, Courier",10pt)
                        'BatchFixedFont' = ("SAS Monospace, Times New Roman, Courier",10pt)
                        'FixedFont' = ("Times New Roman, Courier",10pt)
                        'headingEmphasisFont' = ("Times New Roman",10pt)
                        'headingFont' = ("Times New Roman",10pt)
                        'docFont' = ("Times New Roman",10pt);
                STYLE SystemTitle /
                        FONT_FACE = " Times New Roman, Comic Sans MS, Helvetica, sans-serif"
                        FONT_SIZE = 10pt
                        FONT_WEIGHT = bold
                        FONT_STYLE = roman
                        FOREGROUND = black
                        BACKGROUND = none;
                STYLE SystemFooter /
                        FONT_FACE = " Times New Roman, Comic Sans MS, Helvetica, sans-serif"
                        FONT_SIZE = 10pt
                        FONT_WEIGHT = bold
                        FONT_STYLE = italic
                        FOREGROUND = midnightblue
                        BACKGROUND = none;
                STYLE Header /
                        FONT_FACE = "Times New Roman, Helvetica, sans-serif"
                        FONT_SIZE = 10pt
                        FONT_WEIGHT = medium
                        FONT_STYLE = roman
                        FOREGROUND = black
                        BACKGROUND = none;
                STYLE RowHeader from header /
                        BACKGROUND = none;
                STYLE Data /
                        FONT_FACE = "Times New Roman, Helvetica, sans-serif"
                        FONT_SIZE = 10pt
                        FONT_WEIGHT = medium
                        FONT_STYLE = roman
                        FOREGROUND = black
                        CELLWIDTH=120
                        textalign = center
                        BACKGROUND = none;
                STYLE Table /
                        FOREGROUND = black
                        BACKGROUND = none
                        CELLSPACING = 0
                        CELLPADDING = 3

                        FRAME = HSIDES
                        RULES = groups;
                STYLE Body /
                        FONT_FACE = "Times New Roman, Arial, Helvetica, sans-serif"
                        FONT_SIZE = 10pt
                        FONT_WEIGHT = medium
                        FONT_STYLE = roman

                        FOREGROUND = black
                        BACKGROUND = none;
                STYLE SysTitleAndFooterContainer /
                        CELLSPACING=0;
        end;
run;

ods listing close;
options nodate nonumber;
ods tagsets.rtf  style=Threelines;
ods tagsets.rtf file = "C:\Users\Administrator\Desktop\table.rtf";

proc report data=table_4 nowindows headline headskip;
        column sex age height weight;
        define sex/display "";
        define age/display "年龄(岁)";
        define height/display "身高(英寸)";
        define weight/display "体重(磅)";
        title "不同性别学生的基本信息比较";
run;

ods tagsets.rtf close;
您能花一些时间在这个程序上改一下吗?就是在第二行与第三行之间加条线。谢谢。

使用道具

10
hahabird 发表于 2017-11-7 08:57:09 |只看作者 |坛友微信交流群
在word里做就行了,先添加最上和最下的你应该会,然后选中第一行,在表格属性——边框和底纹——添加就可以了。

使用道具

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

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

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

GMT+8, 2024-4-26 21:14