<?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 do I make this graph? I am getting too many outputs: in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-make-this-graph-I-am-getting-too-many-outputs/m-p/708150#M26562</link>
    <description>&lt;P&gt;With proper syntax:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format; value weight
low-3000 = "Low"
3000-3500 = "Below Average"
3500-4000 = "Above Average"
4000-high = "High"; 
Run;

proc sgplot data=sashelp.bweight;
format weight weight.;
hbar weight / response=cigsperday group=momedlevel groupdisplay=cluster 
    stat=mean limitstat=stderr limits=upper;
xaxis label="Cigarettes Per Day" grid gridattrs=(color=gray66)
    values=(0 to 4 by 1) offsetmax=0.15;
yaxis label="Infant Birth Weight";
keylegend / position = bottom;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PGStats_0-1608847978307.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53019iA3C7A206E1F12314/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PGStats_0-1608847978307.png" alt="PGStats_0-1608847978307.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Dec 2020 22:13:15 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2020-12-24T22:13:15Z</dc:date>
    <item>
      <title>How do I make this graph? I am getting too many outputs:</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-make-this-graph-I-am-getting-too-many-outputs/m-p/708144#M26561</link>
      <description>&lt;P&gt;I was trying to categorize values in sashelp.bweight like below so I can make this graph:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ccpday.png" style="width: 620px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53016i9D34B34FDA3D3566/image-size/large?v=v2&amp;amp;px=999" role="button" title="ccpday.png" alt="ccpday.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Infant Weight Category Definition:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Value range&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Category Label&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Less than 3000 g&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;low&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Between 3000 g and 3500 g (inclusively)&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;below average&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Greater than 3500 g and less than or equal to 4000 g&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;above average&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Over 4000 g&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;high&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attempted this code, but I got too many outputs and it was not as clean as the graph I was aiming for above. Is there a way to improve this code or an easier code to try?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc format; value weight&lt;BR /&gt;low-&amp;lt;3000= "Low"&lt;BR /&gt;3000&amp;lt;=x&amp;lt;=3500= "Below Average"&lt;BR /&gt;3500&amp;gt;=90000= "Above Average"&lt;BR /&gt;4000&amp;gt;high "High"; Run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc freq data=sashelp.bweight; table weight*cigsperday;&lt;BR /&gt;format weight weight. cigsperday cigsperday.;&lt;BR /&gt;ods output CrossTabFreqs=work.sasbweight; run;&lt;BR /&gt;ods listing;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sgplot data=sashelp.bweight;&lt;BR /&gt;ods graphics on/discretemax=2500;&lt;BR /&gt;hbar weight. / response=cigsperday. group=momedlevel groupdisplay=cluster;&lt;BR /&gt;xaxis label="Cigarettes Per Day" grid gridattrs=(color=gray66)&lt;BR /&gt;values=(0 to 4 by 1);&lt;BR /&gt;yaxis label="Infant Birth Weight";&lt;BR /&gt;keylegend / position = bottom;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2020 21:17:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-make-this-graph-I-am-getting-too-many-outputs/m-p/708144#M26561</guid>
      <dc:creator>cvilme1998</dc:creator>
      <dc:date>2020-12-24T21:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make this graph? I am getting too many outputs:</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-make-this-graph-I-am-getting-too-many-outputs/m-p/708150#M26562</link>
      <description>&lt;P&gt;With proper syntax:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format; value weight
low-3000 = "Low"
3000-3500 = "Below Average"
3500-4000 = "Above Average"
4000-high = "High"; 
Run;

proc sgplot data=sashelp.bweight;
format weight weight.;
hbar weight / response=cigsperday group=momedlevel groupdisplay=cluster 
    stat=mean limitstat=stderr limits=upper;
xaxis label="Cigarettes Per Day" grid gridattrs=(color=gray66)
    values=(0 to 4 by 1) offsetmax=0.15;
yaxis label="Infant Birth Weight";
keylegend / position = bottom;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PGStats_0-1608847978307.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53019iA3C7A206E1F12314/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PGStats_0-1608847978307.png" alt="PGStats_0-1608847978307.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2020 22:13:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-make-this-graph-I-am-getting-too-many-outputs/m-p/708150#M26562</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-12-24T22:13:15Z</dc:date>
    </item>
  </channel>
</rss>

