<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Colouring proc tabulate columns by column classification value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Colouring-proc-tabulate-columns-by-column-classification-value/m-p/458014#M116201</link>
    <description>&lt;P&gt;Thanks Cynthia!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moving the mean to nest beneath the SEX column, is a perfect solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, my example rather understated&amp;nbsp;my real task, in which I have a range of different statistics (including pctsum&amp;lt;denominator&amp;gt; types) to apply to a multitude of analysis variables, so making a Proc Tabulate solution impossible, I think.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I might just&amp;nbsp;have to accept defeat - or consider a re-write with Proc Report. &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;again though.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jerry&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Apr 2018 03:31:54 GMT</pubDate>
    <dc:creator>JerryLeBreton</dc:creator>
    <dc:date>2018-04-27T03:31:54Z</dc:date>
    <item>
      <title>Colouring proc tabulate columns by column classification value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Colouring-proc-tabulate-columns-by-column-classification-value/m-p/457986#M116193</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to colour the cells of a column based on the value of the class variable. &amp;nbsp;In spite of the zillion posts and papers on the subject I can't find the answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a simplified illustration of the task:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc format;
  value $sex
  'M'='lightblue'
  'F'='lightpink';
 run;
 
proc tabulate data=sashelp.class ;
class sex ;
classlev sex / style=[background=$sex.];
var weight height ;
table 
weight*mean height*mean
,
sex
;
run;&lt;/PRE&gt;&lt;P&gt;This changes the colour of the column heading background just fine, but I want the whole column to be the same colour too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Having the analysis variables in the row dimension is a bit unusual but the format of my real world task is dictated by people way above my pay grade. &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TIA, &amp;nbsp;Jerry&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 23:03:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Colouring-proc-tabulate-columns-by-column-classification-value/m-p/457986#M116193</guid>
      <dc:creator>JerryLeBreton</dc:creator>
      <dc:date>2018-04-26T23:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Colouring proc tabulate columns by column classification value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Colouring-proc-tabulate-columns-by-column-classification-value/m-p/458000#M116194</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Have a look at page 18 of this document: &lt;A href="https://support.sas.com/resources/papers/stylesinprocs.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/stylesinprocs.pdf&lt;/A&gt;. You need&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;style=&amp;lt;parent&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;with PROC TABULATE -- note that snippet is put into a code box because frequently the &amp;lt; + word + &amp;gt; gets messed up in the forum posting. What you want to do is possible.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="style_parent_tabulate.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20198i75D7701FF86218EB/image-size/large?v=v2&amp;amp;px=999" role="button" title="style_parent_tabulate.png" alt="style_parent_tabulate.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Unfortunately, to get what you want, you have to do what you specifically said you didn't want to do. You have to move the statistic into the COL dimension TABULATE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I can think of a few ways of getting around this, but they basically involve pre-summarizing the data -- and not using TABULATE. So here's something done with PROC REPORT:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hilite_proc_report.png" style="width: 242px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20199i9E700F7D4D8AEF3B/image-size/large?v=v2&amp;amp;px=999" role="button" title="hilite_proc_report.png" alt="hilite_proc_report.png" /&gt;&lt;/span&gt; &lt;/P&gt;
&lt;P&gt;Instead of pre-summarizing the data, I just created a DATALINES and added Gender to show a different statistic. Here's that code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data example;
  infile datalines;
  input varname $ Statname $ Fstat Mstat;
return;
datalines;
Weight Mean 90.11 108.95 
Height Mean 60.59 63.91 
Gender   N    9 10
;
run;

proc report data=example;
  column varname statname ('Sex' Fstat Mstat);
  define varname / "Variable" display style(column)=Header;
  define statname / "Statistic" display style(column)=Header;
  define Fstat / 'F' display f=6.2
         style(header column)={background=lightpink};
  define Mstat / 'M' display f=6.2 
         style(header column)={background=lightblue};
  compute Mstat;
     if varname = 'Gender' then do;
	    call define('Fstat','format','6.0');
		call define('Mstat','format','6.0');
	 end;
  endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps point you someplace useful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 00:53:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Colouring-proc-tabulate-columns-by-column-classification-value/m-p/458000#M116194</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-04-27T00:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: Colouring proc tabulate columns by column classification value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Colouring-proc-tabulate-columns-by-column-classification-value/m-p/458014#M116201</link>
      <description>&lt;P&gt;Thanks Cynthia!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moving the mean to nest beneath the SEX column, is a perfect solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, my example rather understated&amp;nbsp;my real task, in which I have a range of different statistics (including pctsum&amp;lt;denominator&amp;gt; types) to apply to a multitude of analysis variables, so making a Proc Tabulate solution impossible, I think.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I might just&amp;nbsp;have to accept defeat - or consider a re-write with Proc Report. &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;again though.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jerry&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 03:31:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Colouring-proc-tabulate-columns-by-column-classification-value/m-p/458014#M116201</guid>
      <dc:creator>JerryLeBreton</dc:creator>
      <dc:date>2018-04-27T03:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Colouring proc tabulate columns by column classification value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Colouring-proc-tabulate-columns-by-column-classification-value/m-p/458184#M116250</link>
      <description>&lt;P&gt;Hi:&lt;BR /&gt;&amp;nbsp; Well, the nice thing about PROC REPORT is that you can calculate just about any numbers with any formula and not just pctsum&amp;lt;denom&amp;gt;. &lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; Here are a bunch of PROC REPORT and ODS papers that might help you:&lt;BR /&gt;Booth, Allison McMahill. 2010. "Evolve from a Carpenter’s Apprentice to a Master Woodworker: Creating a Plan for Your Reports and Avoiding Common Pitfalls in REPORT Procedure Coding." &amp;nbsp;&lt;BR /&gt;Link: &lt;A href="http://support.sas.com/resources/papers/proceedings10/133-2010.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings10/133-2010.pdf&lt;/A&gt;. &lt;BR /&gt;Booth, Allison McMahill. 2011. "Beyond the Basics: Advanced REPORT Procedure Tips and Tricks Updated for SAS 9.2." &amp;nbsp;&lt;BR /&gt;Link: &lt;A href="http://support.sas.com/resources/papers/proceedings11/246-2011.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings11/246-2011.pdf&lt;/A&gt;. &lt;BR /&gt;Booth, Allison McMahill. 2012. "PROC REPORT Unwrapped: Exploring the Secrets behind One of the Most Popular Procedures in Base SAS Software."&amp;nbsp; &amp;nbsp;&lt;BR /&gt;Link: &lt;A href="http://www.pharmasug.org/proceedings/2012/TF/PharmaSUG-2012-TF20-SAS.pdf" target="_blank"&gt;http://www.pharmasug.org/proceedings/2012/TF/PharmaSUG-2012-TF20-SAS.pdf&lt;/A&gt;.&lt;BR /&gt;Booth, Allison McMahill. 2007. "Beyond the Basics: Advanced PROC REPORT Tips and Tricks." &amp;nbsp;&lt;BR /&gt;Link: &lt;A href="http://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf" target="_blank"&gt;http://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf&lt;/A&gt;. &lt;BR /&gt;&lt;BR /&gt;Eslinger, Jane. 2015.&amp;nbsp; "The REPORT Procedure: A Primer for the Compute Block." &amp;nbsp;&lt;BR /&gt;Link: &lt;A href="https://support.sas.com/resources/papers/proceedings15/SAS1642-2015.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings15/SAS1642-2015.pdf&lt;/A&gt;. &lt;BR /&gt;Zender, Cynthia L. 2008. "Creating Complex Reports." &lt;BR /&gt;&amp;nbsp;Link: &lt;A href="http://www2.sas.com/proceedings/forum2008/173-2008.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/forum2008/173-2008.pdf&lt;/A&gt;. &lt;BR /&gt;&lt;BR /&gt;Zender, Cynthia L., and Allison M. Booth. 2013. "Turn Your Plain Report into a Painted Report Using ODS Styles." &lt;BR /&gt;Link: &lt;A href="http://support.sas.com/resources/papers/proceedings13/366-2013.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings13/366-2013.pdf&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;Zender, Cynthia L. 2014. "Paper SAS388-2014, Sailing Over the ACROSS Hurdle in PROC REPORT." &lt;BR /&gt;Link: &lt;A href="http://support.sas.com/resources/papers/proceedings14/SAS388-2014.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings14/SAS388-2014.pdf&lt;/A&gt;. &lt;BR /&gt;&lt;BR /&gt;Zender, Cynthia L. 2008. "Creating Complex Reports." &amp;nbsp;&lt;BR /&gt;Link:&amp;nbsp; &lt;A href="http://www2.sas.com/proceedings/forum2008/173-2008.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/forum2008/173-2008.pdf&lt;/A&gt;&lt;BR /&gt;Zender, Cynthia L. 2017. "Paper SAS431-2017 Go Ahead and _BREAK_-down: Advanced COMPUTE Block Examples"&lt;BR /&gt;Link: &lt;A href="https://support.sas.com/resources/papers/proceedings17/SAS0431-2017.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings17/SAS0431-2017.pdf&lt;/A&gt; &lt;BR /&gt;Zender, Cynthia L. 2014. "That's All Right: More Complex Reports"&lt;BR /&gt;Link: &lt;A href="http://support.sas.com/resources/papers/proceedings16/SAS5762-2016.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings16/SAS5762-2016.pdf&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cynthia&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 16:46:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Colouring-proc-tabulate-columns-by-column-classification-value/m-p/458184#M116250</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-04-27T16:46:44Z</dc:date>
    </item>
  </channel>
</rss>

