楼主: vieri32
2046 4

Proc tabulate 加顏色 [推广有奖]

  • 1关注
  • 0粉丝

硕士生

22%

还不是VIP/贵宾

-

威望
0
论坛币
7 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
1062 点
帖子
88
精华
0
在线时间
110 小时
注册时间
2009-12-6
最后登录
2021-7-12

楼主
vieri32 发表于 2013-4-18 18:48:42 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
想在不同column之間加上不同顏色,能做到嗎? 再怎麼做都只是column heading 和row heading 變色.
以下圖所示. Expected 和Actual要不同顏色.
以下tabulate應該怎麼改? 十分感謝

proc tabulate data=SummaryA3;
class company ;
var Expected Actual diff;
table Company='' all'Total',(A='Expected' B='Actual' diff='Diff')*(sum=''*f=best12.);
run;

table.PNG



二维码

扫码加我 拉你入群

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

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

关键词:Tabulate Late Abu ATE tab company

沙发
Eternal0601 发表于 2013-4-18 20:01:07
ods listing close;
ods rtf file="c:\tabulate.rtf"   ;
proc tabulate data=sashelp.class ;
class sex ;
var Age Height Weight;
table  sex='' all ='Total',(Age="Expected"*{style={background=red}}    Height='Actual'*{style={background=blue}}    Weight='Diff')*(sum=''*f=best12.);
run;
ods rtf close;
ods listing;
这个算吗

藤椅
vieri32 发表于 2013-4-19 00:24:19
Eternal0601 发表于 2013-4-18 20:01
ods listing close;
ods rtf file="c:\tabulate.rtf"   ;
proc tabulate data=sashelp.class ;
thank you!

板凳
bobguy 发表于 2013-4-19 07:26:51
You can use the customized format to conditional coding the cell colors.

Here is an example.
data t1;

  do r='r1','r2','r3';

   do c='c1','c2','c3','c4';

      do i = 1 to 30;

         x=ranuni(123) +  2* (r='r1') + 2* (c='c1');

         output;

        end;

        end;

        end;

run;



proc print;run;





proc format;

value custfmt low-1='cx006600'

1<-3='cxFF9900'

3<-high='cxCC0000';

run;



ODS HTML FILE='c:\temp\tables.htm';



proc tabulate data=t1;

class r c ;

var x;

table r='row', c='col '*x='xvar '*mean='xmean '*[ STYLE=[BACKGROUND=custfmt. ]];;

run;

报纸
vieri32 发表于 2013-4-19 10:02:42
bobguy 发表于 2013-4-19 07:26
You can use the customized format to conditional coding the cell colors.

Here is an example.
Thank you

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

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