<?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 Using more graphics options in proc freq in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-more-graphics-options-in-proc-freq/m-p/713488#M220127</link>
    <description>&lt;P&gt;I am producing multiple charts and tables weekly for a Covid Response and Recovery Unit.&amp;nbsp; The views are created from ARIAS (which is a Microsoft product).&amp;nbsp; Right now the graphics/charts/tabular analysis is in a beta stage in that leadership haven't decided upon what to use.&amp;nbsp; Once that is decided the presentations will go over to Tableau.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, I am producing a lot of charts and plots/graphics on the fly not worrying about the bells and whistles.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have found that proc freq has enough graphics options so I can produce weekly reports with some presentable graphics.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But there are little things that present a challenge. The attached code is to create a simple horizontal chart of number of contacts by county.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics on;

proc freq data = SASCDC_2.Arias_County_RC_ETHNICITY_A;
     table county_1 / plots (only) = freqplot (orient = horizontal scale = freq);
run;

ods graphics off;
                                            &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The problem is how do I control the font size and also be sure that all 36 county names are shown on the y-axis.&amp;nbsp; Right now every other county name is printed.&amp;nbsp; So I have to make the font size a bit smaller or maybe stretch the axis a little.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wlierman_0-1611350973126.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53814i549B3E82C56C666E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="wlierman_0-1611350973126.png" alt="wlierman_0-1611350973126.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Also how can I include the number of contacts for each county at the end of the horizontal bars?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Wlierman&lt;/P&gt;</description>
    <pubDate>Fri, 22 Jan 2021 21:31:19 GMT</pubDate>
    <dc:creator>wlierman</dc:creator>
    <dc:date>2021-01-22T21:31:19Z</dc:date>
    <item>
      <title>Using more graphics options in proc freq</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-more-graphics-options-in-proc-freq/m-p/713488#M220127</link>
      <description>&lt;P&gt;I am producing multiple charts and tables weekly for a Covid Response and Recovery Unit.&amp;nbsp; The views are created from ARIAS (which is a Microsoft product).&amp;nbsp; Right now the graphics/charts/tabular analysis is in a beta stage in that leadership haven't decided upon what to use.&amp;nbsp; Once that is decided the presentations will go over to Tableau.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, I am producing a lot of charts and plots/graphics on the fly not worrying about the bells and whistles.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have found that proc freq has enough graphics options so I can produce weekly reports with some presentable graphics.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But there are little things that present a challenge. The attached code is to create a simple horizontal chart of number of contacts by county.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics on;

proc freq data = SASCDC_2.Arias_County_RC_ETHNICITY_A;
     table county_1 / plots (only) = freqplot (orient = horizontal scale = freq);
run;

ods graphics off;
                                            &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The problem is how do I control the font size and also be sure that all 36 county names are shown on the y-axis.&amp;nbsp; Right now every other county name is printed.&amp;nbsp; So I have to make the font size a bit smaller or maybe stretch the axis a little.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wlierman_0-1611350973126.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53814i549B3E82C56C666E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="wlierman_0-1611350973126.png" alt="wlierman_0-1611350973126.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Also how can I include the number of contacts for each county at the end of the horizontal bars?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Wlierman&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 21:31:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-more-graphics-options-in-proc-freq/m-p/713488#M220127</guid>
      <dc:creator>wlierman</dc:creator>
      <dc:date>2021-01-22T21:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using more graphics options in proc freq</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-more-graphics-options-in-proc-freq/m-p/713500#M220134</link>
      <description>&lt;P&gt;This may be the time to start using the actual graphing procedures to have more control.&lt;/P&gt;
&lt;P&gt;Here is an example with a data set you should have:&lt;/P&gt;
&lt;PRE&gt;proc sgplot data=sashelp.cars;
   hbar make /stat=freq  
             datalabel datalabelpos=data
             DATALABELFITPOLICY=NONE
   ;
   yaxis type=discrete fitpolicy=none ;
run;&lt;/PRE&gt;
&lt;P&gt;You may want to use the ODS GRAPHICS&amp;nbsp; options height= and width= to provide a bit more room as well.&lt;/P&gt;
&lt;P&gt;The above procedure lets you control the axis Valueattrs (color and font options for the tick mark text appearance)&lt;/P&gt;
&lt;P&gt;There are lots of options to control order of bars such as:&lt;/P&gt;
&lt;PRE&gt;proc sgplot data=sashelp.cars;
   hbar make /stat=freq  
             datalabel datalabelpos=data
             DATALABELFITPOLICY=NONE
             categoryorder=respdesc
   ;
   yaxis type=discrete fitpolicy=none ;
run;&lt;/PRE&gt;
&lt;P&gt;Which has the data ordered with higher counts at the top .&lt;/P&gt;
&lt;P&gt;Or subgroups of records:&lt;/P&gt;
&lt;PRE&gt;proc sgplot data=sashelp.cars;
   hbar make /stat=freq  
              group=type  
             datalabel datalabelpos=data
             DATALABELFITPOLICY=NONE
             categoryorder=respdesc
   ;
   yaxis type=discrete fitpolicy=none ;
run;&lt;/PRE&gt;
&lt;P&gt;For your purpose think confirmed/presumed positive test, no vaccination/ first shot/ completed vaccination (if two shots needed)&lt;/P&gt;
&lt;P&gt;or similar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 22:02:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-more-graphics-options-in-proc-freq/m-p/713500#M220134</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-22T22:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using more graphics options in proc freq</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-more-graphics-options-in-proc-freq/m-p/713522#M220143</link>
      <description>&lt;P&gt;Thank you sir for your suggestions.&amp;nbsp; I will move to using proc sgplot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I appreciate the examples provided.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Take care.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;wlierman&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 23:15:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-more-graphics-options-in-proc-freq/m-p/713522#M220143</guid>
      <dc:creator>wlierman</dc:creator>
      <dc:date>2021-01-22T23:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Using more graphics options in proc freq</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-more-graphics-options-in-proc-freq/m-p/713525#M220145</link>
      <description>And as a quick FYI - you can play around with ODS style templates to get different default presentations without too much fussing around that are better than the default SAS BLUE. You control that with the STYLE= on your ODS statement.&lt;BR /&gt;&lt;BR /&gt;Meadow, Seaside, Journal are a couple of the templates that I use, if I don't have time to customize my graphics. &lt;BR /&gt;There's also an Edward Tufte version someone created that's on here somewhere.&lt;BR /&gt;&lt;BR /&gt;ods pdf ... style = meadow;&lt;BR /&gt;&lt;BR /&gt;Some examples of the different styles are here:&lt;BR /&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=odsadvug&amp;amp;docsetTarget=p14qidvs5xf7omn14ommvsuhvmzn.htm&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=odsadvug&amp;amp;docsetTarget=p14qidvs5xf7omn14ommvsuhvmzn.htm&amp;amp;locale=en&lt;/A&gt;</description>
      <pubDate>Fri, 22 Jan 2021 23:38:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-more-graphics-options-in-proc-freq/m-p/713525#M220145</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-01-22T23:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using more graphics options in proc freq</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-more-graphics-options-in-proc-freq/m-p/713537#M220149</link>
      <description>&lt;P&gt;Thank you Reeza for your help. You have provided some effective time-saving solutions in the past.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will explore the documentation link that you provided.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Take care.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;wlierman&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2021 00:20:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-more-graphics-options-in-proc-freq/m-p/713537#M220149</guid>
      <dc:creator>wlierman</dc:creator>
      <dc:date>2021-01-23T00:20:13Z</dc:date>
    </item>
  </channel>
</rss>

