<?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: Help separating categories in proc surveymeans in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Help-separating-categories-in-proc-surveymeans/m-p/872888#M82697</link>
    <description>&lt;P&gt;Your code requested the mean and other statistics of a variable. It does nothing to use levels.&lt;/P&gt;
&lt;P&gt;In Surveymeans variables that used for categories belong in a DOMAIN statement. At which point the mean for age_new will be the value of age_new. Are you sure that you aren't looking for SURVEYFREQ to estimate percentages of age_new?&lt;/P&gt;
&lt;P&gt;Or is there another actual variable that you want the mean and other statisics for such as height, test score or such that would belong on the VAR variable?&lt;/P&gt;
&lt;P&gt;If you want the actual mean Age within the Age_new group that would be:&lt;/P&gt;
&lt;PRE&gt;proc surveymeans data=syc mean clm sum std stderr clsum plots=none;
stratum stratum;
cluster psu;
weight finalwt;
domain age_new;
var age;

run;&lt;/PRE&gt;</description>
    <pubDate>Fri, 28 Apr 2023 18:03:33 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2023-04-28T18:03:33Z</dc:date>
    <item>
      <title>Help separating categories in proc surveymeans</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-separating-categories-in-proc-surveymeans/m-p/872870#M82696</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm trying to get into SAS programing and I'm having a lil trouble separating categories in my variable age (&amp;lt;15, 16-17, &amp;gt;18 years old).&amp;nbsp; I need to used proc surveymeans but the output only shows all 3 categories together and 1 mean in 1 row.&amp;nbsp; How you I get the output to show 3&amp;nbsp; means in the separate rows?&lt;/P&gt;&lt;P&gt;Thank you for helping&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot (16).jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/83385i3DED2C5CEBDA3CB6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot (16).jpg" alt="Screenshot (16).jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;age_new =.;&lt;/P&gt;&lt;P&gt;if age le 15 then age_new =1;&lt;BR /&gt;if age = 16 or age = 17 then age_new =2;&lt;BR /&gt;if age ge 18 then age_new =3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;label&lt;BR /&gt;age_new = "1=15 or Under" "2=Between 16-17" "3=18 or Older"&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc format;&lt;BR /&gt;value age_new 1='1=15 or Under' 2='2=16 or 17' 3='3=18 or Older';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc surveymeans data=syc mean clm sum std stderr clsum plots=none;&lt;BR /&gt;stratum stratum;&lt;BR /&gt;cluster psu;&lt;BR /&gt;weight finalwt;&lt;BR /&gt;var age_new;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 16:41:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-separating-categories-in-proc-surveymeans/m-p/872870#M82696</guid>
      <dc:creator>CJxyz</dc:creator>
      <dc:date>2023-04-28T16:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: Help separating categories in proc surveymeans</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-separating-categories-in-proc-surveymeans/m-p/872888#M82697</link>
      <description>&lt;P&gt;Your code requested the mean and other statistics of a variable. It does nothing to use levels.&lt;/P&gt;
&lt;P&gt;In Surveymeans variables that used for categories belong in a DOMAIN statement. At which point the mean for age_new will be the value of age_new. Are you sure that you aren't looking for SURVEYFREQ to estimate percentages of age_new?&lt;/P&gt;
&lt;P&gt;Or is there another actual variable that you want the mean and other statisics for such as height, test score or such that would belong on the VAR variable?&lt;/P&gt;
&lt;P&gt;If you want the actual mean Age within the Age_new group that would be:&lt;/P&gt;
&lt;PRE&gt;proc surveymeans data=syc mean clm sum std stderr clsum plots=none;
stratum stratum;
cluster psu;
weight finalwt;
domain age_new;
var age;

run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Apr 2023 18:03:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-separating-categories-in-proc-surveymeans/m-p/872888#M82697</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-04-28T18:03:33Z</dc:date>
    </item>
  </channel>
</rss>

