我的程序
proc sql;
create table mean as
select a.age,a.m_h format=5.2,a.m_w format=5.2,b.w_h format=5.2,b.w_w format=5.2
from (select distinct age,mean(height) as m_h,mean(weight) as m_w from sashelp.class
where sex='M' group by age) as a left join
(select distinct age,mean(height) as w_h,mean(weight) as w_w from sashelp.class
where sex='F' group by age) as b on a.age=b.age;
quit;
data mean;
set mean;
_empty=' ';
run;
ods escapechar='^';
ods rtf file='E:\example1_1.rtf' startpage=no bodytitle;
title ' ';
options nodate nonumber center ;
proc report nowd data=mean
style(report)=[rules=group frame=hsides outputwidth=7 in]
style(header)=[background=white borderbottomcolor=black borderbottomwidth=4
background=_undef_ font_size=10.5pt font_face="宋体" font_weight=medium]
style(column)=[ just=center font_size=10.5pt font_face="宋体" font_weight=medium];
title '表X 不同年龄组不同性别身高体重统计描述' ;
column (('^S={borderbottomcolor=white borderbottomwidth=2 just=center} 'age)
('^S={_row_ borderbottomcolor=black borderbottomwidth=2 just=center} 男'm_h m_w)
('^S={borderbottomcolor=white borderbottomwidth=2}'_empty)
('^S={_row_ borderbottomcolor=black borderbottomwidth=2 just=center} 女' w_h w_w));
define age/'年龄' style(column)={cellwidth=0.5 in };
define m_w/'体重' style(column)={cellwidth=0.5 in };
define m_h/'身高' style(column)={cellwidth=0.5 in };
define w_w/'体重' style(column)={cellwidth=0.5 in };
define w_h/'身高' style(column)={cellwidth=0.5 in };
define _empty/' ' style(column)={cellwidth=1% borderrightcolor=white
borderrightwidth=5};
compute after _page_ / style={bordertopcolor=black font_size=9pt font_face="宋体" font_weight=medium bordertopwidth=4 just=left};
line '^{super ***}身高单位(cm)^{super ***}体重单位(斤)';
endcomp;
run;
ods rtf close;
做如来的表如图
想在男和女下面再加一条线 不知道怎么加
('^S={_row_ borderbottomcolor=black borderbottomwidth=2 just=center} 女' w_h w_w));上面程序这句话 错误在哪 请大家指正
先谢谢大家了!!