<?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 Class statement doesn't work in Proc Surveymeans in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Class-statement-doesn-t-work-in-Proc-Surveymeans/m-p/936407#M368075</link>
    <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The class statement doesn't work in the syntax below.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;PROC SURVEYMEANS Data=health varmethod=brr mean clm;
CLASS sex agegroup;
REPWEIGHTS Rweight1-Rweight500;
VAR Cause;
WEIGHT TWeight ;
ods output Statistics=MyStat1 (keep= VarLevel Mean LowerCLMean StdErr UpperCLMean sex agegroup);
run; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The output contents only the total estimations.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any helps will be appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Jul 2024 18:39:28 GMT</pubDate>
    <dc:creator>altadata1</dc:creator>
    <dc:date>2024-07-19T18:39:28Z</dc:date>
    <item>
      <title>Class statement doesn't work in Proc Surveymeans</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Class-statement-doesn-t-work-in-Proc-Surveymeans/m-p/936407#M368075</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The class statement doesn't work in the syntax below.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;PROC SURVEYMEANS Data=health varmethod=brr mean clm;
CLASS sex agegroup;
REPWEIGHTS Rweight1-Rweight500;
VAR Cause;
WEIGHT TWeight ;
ods output Statistics=MyStat1 (keep= VarLevel Mean LowerCLMean StdErr UpperCLMean sex agegroup);
run; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The output contents only the total estimations.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any helps will be appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 18:39:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Class-statement-doesn-t-work-in-Proc-Surveymeans/m-p/936407#M368075</guid>
      <dc:creator>altadata1</dc:creator>
      <dc:date>2024-07-19T18:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Class statement doesn't work in Proc Surveymeans</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Class-statement-doesn-t-work-in-Proc-Surveymeans/m-p/936424#M368078</link>
      <description>Does your log show any error? Mine states that the BRR method requires a STRATA statement? Is that perhaps what you need to be using instead of CLASS?</description>
      <pubDate>Fri, 19 Jul 2024 19:44:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Class-statement-doesn-t-work-in-Proc-Surveymeans/m-p/936424#M368078</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2024-07-19T19:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: Class statement doesn't work in Proc Surveymeans</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Class-statement-doesn-t-work-in-Proc-Surveymeans/m-p/936444#M368085</link>
      <description>&lt;P&gt;If you want to have a summary of the variable Cause for levels of the variables Sex and Agegroup then you want to use a DOMAIN statement in Surveymeans.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Compare the output for these two calls that you can run as you should have the SAS supplied SASHELP.CLASS data set:&lt;/P&gt;
&lt;PRE&gt;proc surveymeans data=sashelp.class;
   class sex age;
   var height;
run;

proc surveymeans data=sashelp.class;
   domain sex age;
   var height;
run;&lt;/PRE&gt;
&lt;P&gt;And compare these for the intended use of CLASS when you want analysis of the levels of a variable.&lt;/P&gt;
&lt;PRE&gt;proc surveymeans data=sashelp.class;
   var   age;
run;
proc surveymeans data=sashelp.class;
   class age;
   var   age;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Jul 2024 20:30:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Class-statement-doesn-t-work-in-Proc-Surveymeans/m-p/936444#M368085</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-07-19T20:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: Class statement doesn't work in Proc Surveymeans</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Class-statement-doesn-t-work-in-Proc-Surveymeans/m-p/936448#M368088</link>
      <description>&lt;P&gt;Hi. I don't receive any errors, except the warning: "The variable diverse in the Drop, Keep, or Rename list has never been referenced."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 21:01:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Class-statement-doesn-t-work-in-Proc-Surveymeans/m-p/936448#M368088</guid>
      <dc:creator>altadata1</dc:creator>
      <dc:date>2024-07-19T21:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Class statement doesn't work in Proc Surveymeans</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Class-statement-doesn-t-work-in-Proc-Surveymeans/m-p/936449#M368089</link>
      <description>&lt;P&gt;Thank you for the reply. Why do i need to use "Domain" instead of Class. Domain makes a subpopulation, while what I need is to create the estimations by the categories of the variable in CLASS - That's what CLASS statement does.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 21:03:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Class-statement-doesn-t-work-in-Proc-Surveymeans/m-p/936449#M368089</guid>
      <dc:creator>altadata1</dc:creator>
      <dc:date>2024-07-19T21:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: Class statement doesn't work in Proc Surveymeans</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Class-statement-doesn-t-work-in-Proc-Surveymeans/m-p/936454#M368090</link>
      <description>&lt;P&gt;Sorry, i meant the variable "sex" . Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 21:09:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Class-statement-doesn-t-work-in-Proc-Surveymeans/m-p/936454#M368090</guid>
      <dc:creator>altadata1</dc:creator>
      <dc:date>2024-07-19T21:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Class statement doesn't work in Proc Surveymeans</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Class-statement-doesn-t-work-in-Proc-Surveymeans/m-p/936465#M368093</link>
      <description>&lt;P&gt;Please read your initial message carefully. You do not say anything about what you actually wanted for output just claimed that "class doesn't work".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I went with a suggestion of DOMAIN as that is a frequent request for that type of output and one of the possible interpretations because of the way CLASS works in other procedures such as MEANS/Summary, Tabulate and others.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you needed to add the CLASS variables to the VAR statement to get the levels of those variables. I did show how to do that as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV id="bodyDisplay_87d35229b16bfb" class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation"&gt;
&lt;DIV class="lia-message-body-content"&gt;
&lt;P&gt;Hello.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The class statement doesn't work in the syntax below.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;PROC SURVEYMEANS Data=health varmethod=brr mean clm;
CLASS sex agegroup;
REPWEIGHTS Rweight1-Rweight500;
VAR Cause;
WEIGHT TWeight ;
ods output Statistics=MyStat1 (keep= VarLevel Mean LowerCLMean StdErr UpperCLMean sex agegroup);
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The output contents only the total estimations.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any helps will be appreciated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 19 Jul 2024 22:02:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Class-statement-doesn-t-work-in-Proc-Surveymeans/m-p/936465#M368093</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-07-19T22:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Class statement doesn't work in Proc Surveymeans</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Class-statement-doesn-t-work-in-Proc-Surveymeans/m-p/936484#M368095</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;Thank you for your response, and I apologize for not explaining it clearly at the beginning.&lt;/P&gt;&lt;P&gt;I was concerned that the "domain" statement might function like the "by" statement, treating each subgroup independently. However, it seems that is not the case. So, I will use the "domain" statement. Thank you very much!&lt;/P&gt;&lt;P&gt;I still don't understand why the "class" statement doesn't work. Is the "class" statement only for categorical variables?&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 20 Jul 2024 10:21:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Class-statement-doesn-t-work-in-Proc-Surveymeans/m-p/936484#M368095</guid>
      <dc:creator>altadata1</dc:creator>
      <dc:date>2024-07-20T10:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Class statement doesn't work in Proc Surveymeans</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Class-statement-doesn-t-work-in-Proc-Surveymeans/m-p/936511#M368105</link>
      <description>&lt;P&gt;If a numeric variable appears on the VAR statement then it will only have the requested statistics mean or what ever. However when a variable appears on the CLASS statement and the VAR statement then levels of the variable are summarized. Class is used to force categorical behavior when you want it but only for variables on the VAR statement.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jul 2024 05:16:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Class-statement-doesn-t-work-in-Proc-Surveymeans/m-p/936511#M368105</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-07-21T05:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: Class statement doesn't work in Proc Surveymeans</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Class-statement-doesn-t-work-in-Proc-Surveymeans/m-p/936521#M368106</link>
      <description>&lt;P&gt;Thank you so much for the explanation.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jul 2024 11:44:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Class-statement-doesn-t-work-in-Proc-Surveymeans/m-p/936521#M368106</guid>
      <dc:creator>altadata1</dc:creator>
      <dc:date>2024-07-21T11:44:05Z</dc:date>
    </item>
  </channel>
</rss>

