<?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: Using mean values of a variable in a table in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Using-mean-values-of-a-variable-in-a-table/m-p/731476#M28433</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc sgplot data=set SOR2002.elderly5;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; vbar admgrp&amp;nbsp; /response=los stat=mean;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Will create chart with the bars for each value of admgrp and display the mean of the LOS for the group as the height of the bar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The graphing procedures don't have the ability to do a great deal of summaries but can do means, counts (frequency), medians, sums and percentages(carefully).&lt;/P&gt;</description>
    <pubDate>Mon, 05 Apr 2021 22:23:49 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-04-05T22:23:49Z</dc:date>
    <item>
      <title>Using mean values of a variable in a table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-mean-values-of-a-variable-in-a-table/m-p/731464#M28432</link>
      <description>&lt;P&gt;I have 2 variables and I am looking to investigate the relationship between them. First of all, I am working with an excel sheet containing n=4533 observations. Of these observations, each can be categorized into a value between 1-8 known as 'admgrp' (admin group). This is the first variable.&amp;nbsp;&lt;BR /&gt;The second variable is called 'los' (length of stay in days), for which every observation has a value.&amp;nbsp;&lt;BR /&gt;Basically, I want to look at how 'admgrp' value influences the 'los' value.&amp;nbsp;&lt;BR /&gt;I have isolated each 'admgrp' and found their mean 'los' using the attached code;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data SOR2002.admgrp1;&lt;BR /&gt;set SOR2002.elderly5;&lt;BR /&gt;if admgrp = '1';&lt;BR /&gt;run;
&amp;nbsp;
proc means data=SOR2002.admgrp1;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Where SOR2002.elderly5 is the data set containing all 4533 observations. The above code demonstrates how I isolated admgrp 1, with similar code used to isolate the other 7 admgrps. I then use proc means on each individual admgrp to find their respective means for 'los'.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Now what I want to do is produce a bar graph showing each admgrp along the horizontal axis against their mean 'los' along the vertical axis.&lt;BR /&gt;I assume my first step would be trying to produce a 2-column table; one containing the 8 admgrps and the other containing their 8 respective mean 'los'. I am unsure how to do this.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Is there some way perhaps that you can produce a new variable called 'average los' and then set it equal to some calculation which returns the mean for each admgrps 'los'? Or is there a way to do it involving the proc means statement? Any advice is appreciated!&lt;/P&gt;</description>
      <pubDate>Mon, 05 Apr 2021 21:45:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-mean-values-of-a-variable-in-a-table/m-p/731464#M28432</guid>
      <dc:creator>SteveMarriott14</dc:creator>
      <dc:date>2021-04-05T21:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Using mean values of a variable in a table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-mean-values-of-a-variable-in-a-table/m-p/731476#M28433</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc sgplot data=set SOR2002.elderly5;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; vbar admgrp&amp;nbsp; /response=los stat=mean;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Will create chart with the bars for each value of admgrp and display the mean of the LOS for the group as the height of the bar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The graphing procedures don't have the ability to do a great deal of summaries but can do means, counts (frequency), medians, sums and percentages(carefully).&lt;/P&gt;</description>
      <pubDate>Mon, 05 Apr 2021 22:23:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-mean-values-of-a-variable-in-a-table/m-p/731476#M28433</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-04-05T22:23:49Z</dc:date>
    </item>
  </channel>
</rss>

