全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2081 4
2013-04-18
想在不同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



二维码

扫码加我 拉你入群

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

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

全部回复
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;
这个算吗
二维码

扫码加我 拉你入群

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

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

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!
二维码

扫码加我 拉你入群

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

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

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;
二维码

扫码加我 拉你入群

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

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

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
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群