<?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: How to force equal bin size in grouped histogram in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-force-equal-bin-size-in-grouped-histogram/m-p/528024#M22199</link>
    <description>&lt;P&gt;I really want to use proc sgplot, are you sure grouping is possible? Cant find example code for this in sgplot.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As for setting the binwidt, as I stated, I cant set this manually, as this is a macro that needs to show a sensible plot for any input data&lt;/P&gt;</description>
    <pubDate>Thu, 17 Jan 2019 13:52:37 GMT</pubDate>
    <dc:creator>Ullsokk</dc:creator>
    <dc:date>2019-01-17T13:52:37Z</dc:date>
    <item>
      <title>How to force equal bin size in grouped histogram</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-force-equal-bin-size-in-grouped-histogram/m-p/528018#M22197</link>
      <description>&lt;P&gt;I have a report that dynamically compares two groups distribution on the most relevant variables.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; ods graphics / NBINSMAX=100;&lt;BR /&gt;&lt;BR /&gt;proc sgplot data=combo ;
  histogram &amp;amp;var._1 / fillattrs=graphdata1 name='s' legendlabel='Group 1 transparency=0.5 ;
  histogram &amp;amp;var._0 / fillattrs=graphdata2 name='d' legendlabel='Group 2' transparency=0.5 ;
  keylegend 's' 'd' / location=inside position=topright across=1;
  xaxis display=(nolabel);
  run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I want max 100 bins, but I want both groups to have the same number of bins, so that it is easy to compare the distributions. With the following code, the two distributions can get wildy different bin sizes, as shown in the example below.&lt;/P&gt;&lt;P&gt;As this is&amp;nbsp;part of a macro, I cannot set the bin size manually for each plot, and just want each plot to have a uniform bin size for each group.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example.PNG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26345i70D5E29F7FF58B1A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Example.PNG" alt="Example.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 13:37:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-force-equal-bin-size-in-grouped-histogram/m-p/528018#M22197</guid>
      <dc:creator>Ullsokk</dc:creator>
      <dc:date>2019-01-17T13:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to force equal bin size in grouped histogram</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-force-equal-bin-size-in-grouped-histogram/m-p/528019#M22198</link>
      <description>&lt;P&gt;Use the BINWIDTH= option of the HISTOGRAM command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, use one HISTOGRAM statement with a GROUP= option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also consider using the DENSITY command instead of the HISTOGRAM command.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 13:52:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-force-equal-bin-size-in-grouped-histogram/m-p/528019#M22198</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-01-17T13:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to force equal bin size in grouped histogram</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-force-equal-bin-size-in-grouped-histogram/m-p/528024#M22199</link>
      <description>&lt;P&gt;I really want to use proc sgplot, are you sure grouping is possible? Cant find example code for this in sgplot.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As for setting the binwidt, as I stated, I cant set this manually, as this is a macro that needs to show a sensible plot for any input data&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 13:52:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-force-equal-bin-size-in-grouped-histogram/m-p/528024#M22199</guid>
      <dc:creator>Ullsokk</dc:creator>
      <dc:date>2019-01-17T13:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to force equal bin size in grouped histogram</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-force-equal-bin-size-in-grouped-histogram/m-p/528025#M22200</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/68234"&gt;@Ullsokk&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I really want to use proc sgplot, are you sure grouping is possible? Cant find example code for this in sgplot.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=grstatproc&amp;amp;docsetTarget=n0p7vdd69sgf3wn1479qxqxuryrt.htm&amp;amp;locale=en#n12ydifq7odra9n16dvrvz15klzjd" target="_blank"&gt;https://documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=grstatproc&amp;amp;docsetTarget=n0p7vdd69sgf3wn1479qxqxuryrt.htm&amp;amp;locale=en#n12ydifq7odra9n16dvrvz15klzjd&lt;/A&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;As for setting the binwidt, as I stated, I cant set this manually, as this is a macro that needs to show a sensible plot for any input data&lt;/P&gt;
&lt;HR /&gt;&amp;nbsp;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you are writing a general macro, you will know from the data the min and max values of the data, and so if you want k bins, you can figure out the width of each one of the k bins.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 13:56:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-force-equal-bin-size-in-grouped-histogram/m-p/528025#M22200</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-01-17T13:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to force equal bin size in grouped histogram</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-force-equal-bin-size-in-grouped-histogram/m-p/528030#M22201</link>
      <description>I have no idea how I missed that, thanks a bunch&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Jan 2019 14:03:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-force-equal-bin-size-in-grouped-histogram/m-p/528030#M22201</guid>
      <dc:creator>Ullsokk</dc:creator>
      <dc:date>2019-01-17T14:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to force equal bin size in grouped histogram</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-force-equal-bin-size-in-grouped-histogram/m-p/528037#M22202</link>
      <description>&lt;P&gt;And consider using the DENSITY command instead of the HISTOGRAM command.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 14:11:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-force-equal-bin-size-in-grouped-histogram/m-p/528037#M22202</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-01-17T14:11:33Z</dc:date>
    </item>
  </channel>
</rss>

