<?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: Creating a VBAR using a variable as weight for each value of another variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-VBAR-using-a-variable-as-weight-for-each-value-of/m-p/704433#M215946</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Adhuna - to build off of what ghosh responded, below is the code I would use to achieve this &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VBAR StateCd / RESPONSE = ColPercent&lt;BR /&gt;FILLATTRS = (COLOR = LIGHTSALMON)&lt;BR /&gt;DATALABEL = COLPercent;&lt;BR /&gt;FORMAT COLPercent 6.4;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Dec 2020 16:01:33 GMT</pubDate>
    <dc:creator>AnnaWoolery</dc:creator>
    <dc:date>2020-12-08T16:01:33Z</dc:date>
    <item>
      <title>Creating a VBAR using a variable as weight for each value of another variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-VBAR-using-a-variable-as-weight-for-each-value-of/m-p/704024#M215780</link>
      <description>&lt;P&gt;Hello SAS Communities,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following table:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;StateCd&lt;/TD&gt;&lt;TD&gt;HypRelDeathInd&lt;/TD&gt;&lt;TD&gt;Frequency&lt;/TD&gt;&lt;TD&gt;ColPercent&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Iowa&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;1.53&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Mississippi&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;2.90&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Utah&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;1.18&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=" dgrid-row ui-state-default dgrid-row-even dgrid-selected ui-state-active"&gt;I want to create a vertical bar chart which displays the percentage of people who experienced a hypertension-related death for each of the 3 states.&lt;/DIV&gt;&lt;DIV class=" dgrid-row ui-state-default dgrid-row-even dgrid-selected ui-state-active"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=" dgrid-row ui-state-default dgrid-row-even dgrid-selected ui-state-active"&gt;The x axis should be Iowa, Mississippi and Utah. The bar chart for each x value should be the ColPercent value. It should look as follows:&lt;/DIV&gt;&lt;DIV class=" dgrid-row ui-state-default dgrid-row-even dgrid-selected ui-state-active"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Project 3 graph.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/52379i658F56A5BB01E73E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Project 3 graph.png" alt="Project 3 graph.png" /&gt;&lt;/span&gt;&lt;BR /&gt;I have only generated a bar chart which takes in a variable and plots the frequency of each value of the variable as the weight of the variable.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am not sure how to use another column as the weight of the bar chart. I need to implement the PROC SGPLOT which can achieve this.&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;/DIV&gt;&lt;DIV class=" dgrid-row ui-state-default dgrid-row-even dgrid-selected ui-state-active"&gt;Adhuna Mukhopadhyay&lt;/DIV&gt;</description>
      <pubDate>Mon, 07 Dec 2020 02:31:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-VBAR-using-a-variable-as-weight-for-each-value-of/m-p/704024#M215780</guid>
      <dc:creator>adhunamukherjee</dc:creator>
      <dc:date>2020-12-07T02:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a VBAR using a variable as weight for each value of another variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-VBAR-using-a-variable-as-weight-for-each-value-of/m-p/704034#M215785</link>
      <description>&lt;P&gt;There is a Weight option you can specify after the slash, but from your description I think you want to specify the colpct as a response&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=mydata;
  vbar &lt;SPAN&gt;StateCd&lt;/SPAN&gt; /
    response=ColPct;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Dec 2020 04:07:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-VBAR-using-a-variable-as-weight-for-each-value-of/m-p/704034#M215785</guid>
      <dc:creator>ghosh</dc:creator>
      <dc:date>2020-12-07T04:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a VBAR using a variable as weight for each value of another variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-VBAR-using-a-variable-as-weight-for-each-value-of/m-p/704433#M215946</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Adhuna - to build off of what ghosh responded, below is the code I would use to achieve this &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VBAR StateCd / RESPONSE = ColPercent&lt;BR /&gt;FILLATTRS = (COLOR = LIGHTSALMON)&lt;BR /&gt;DATALABEL = COLPercent;&lt;BR /&gt;FORMAT COLPercent 6.4;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 16:01:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-VBAR-using-a-variable-as-weight-for-each-value-of/m-p/704433#M215946</guid>
      <dc:creator>AnnaWoolery</dc:creator>
      <dc:date>2020-12-08T16:01:33Z</dc:date>
    </item>
  </channel>
</rss>

