<?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 How to get means of different observations in a variable in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-get-means-of-different-observations-in-a-variable/m-p/772330#M31057</link>
    <description>&lt;P&gt;Please, i have a data set for hospital records, there are many patients that have a particular diagnosis. i am aked to provide the average length of stay of the patients per diagnosis. Is there a way i can have a table that shows the mean of the patients per diagnosis?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i tried this and it did not work, the codes in the parentheses are the diangosis codes in the variable Admitting_diag. i am to findthe mean legth of stay per the admitting diagnoses&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC MEANS DATA = WEEK6.QUES3B1 MEAN MIN MAX MAXDEC = 1;&lt;BR /&gt;VAR LENGTH_OF_STAY;&lt;BR /&gt;WHERE ADMITTING_DIAG IN ('V3000') OR ADMITTING_DIAG IN ('V221') ;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;i also tried where admitting_diag in&amp;nbsp;WHERE ADMITTING_DIAG IN ('V3000' 'V221' 'V3001' '650' '78650')&lt;/P&gt;
&lt;P&gt;all it gave me is the cummulative mean for all diagnoses in the parenthesis&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;WHERE ADMITTING_DIAG IN ('V3000' 'V221' 'V3001' '650' '78650');&lt;BR /&gt;RUN;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Oct 2021 02:29:27 GMT</pubDate>
    <dc:creator>Banke</dc:creator>
    <dc:date>2021-10-06T02:29:27Z</dc:date>
    <item>
      <title>How to get means of different observations in a variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-get-means-of-different-observations-in-a-variable/m-p/772330#M31057</link>
      <description>&lt;P&gt;Please, i have a data set for hospital records, there are many patients that have a particular diagnosis. i am aked to provide the average length of stay of the patients per diagnosis. Is there a way i can have a table that shows the mean of the patients per diagnosis?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i tried this and it did not work, the codes in the parentheses are the diangosis codes in the variable Admitting_diag. i am to findthe mean legth of stay per the admitting diagnoses&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC MEANS DATA = WEEK6.QUES3B1 MEAN MIN MAX MAXDEC = 1;&lt;BR /&gt;VAR LENGTH_OF_STAY;&lt;BR /&gt;WHERE ADMITTING_DIAG IN ('V3000') OR ADMITTING_DIAG IN ('V221') ;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;i also tried where admitting_diag in&amp;nbsp;WHERE ADMITTING_DIAG IN ('V3000' 'V221' 'V3001' '650' '78650')&lt;/P&gt;
&lt;P&gt;all it gave me is the cummulative mean for all diagnoses in the parenthesis&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;WHERE ADMITTING_DIAG IN ('V3000' 'V221' 'V3001' '650' '78650');&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 02:29:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-get-means-of-different-observations-in-a-variable/m-p/772330#M31057</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2021-10-06T02:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to get means of different observations in a variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-get-means-of-different-observations-in-a-variable/m-p/772335#M31059</link>
      <description>&lt;P&gt;You must tell proc means that you expect it to produce results for each value of ADMITTING_DIAG.&amp;nbsp; Use the CLASS statement, as in:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC MEANS DATA = WEEK6.QUES3B1 MEAN MIN MAX MAXDEC = 1 nway;
VAR LENGTH_OF_STAY;
class admitting_diag;
WHERE ADMITTING_DIAG IN ('V3000' 'V221' 'V3001' '650' '78650');
RUN;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Oct 2021 04:08:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-get-means-of-different-observations-in-a-variable/m-p/772335#M31059</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2021-10-06T04:08:35Z</dc:date>
    </item>
  </channel>
</rss>

