<?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 PROC SURVEYMEANS, quantiles, and outputs in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-SURVEYMEANS-quantiles-and-outputs/m-p/849941#M42081</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have run MI with 30 imputations and would like to calculate median estimates among subgroups. Using the code below, I was able to get median estimates, but I cannot seem to output the subgroup estimates.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SORT DATA=for_gee;&lt;BR /&gt;BY _imputation_;&lt;BR /&gt;RUN;&lt;BR /&gt;PROC SURVEYMEANS DATA=for_gee MEDIAN;&lt;BR /&gt;BY _imputation_;&lt;BR /&gt;WHERE months_post = .;&lt;BR /&gt;DOMAIN sex;&lt;BR /&gt;VAR igg_value_new;&lt;BR /&gt;ODS OUTPUT QUANTILES=stats1;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get this (one of the imputations):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;The SURVEYMEANS Procedure&lt;/DIV&gt;&lt;DIV class=""&gt;Imputation Number=30&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;STRONG&gt;Quantiles for Sex Domain&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;sex&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Variable&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Percentile&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Estimate&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Std&lt;BR /&gt;Error&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;95% Lower CL&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;95% Upper CL&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Female&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;igg_value_new&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;50&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Median&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.968816&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.009923&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.94935319&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.98827979&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Male&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;igg_value_new&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;50&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Median&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.980282&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.013516&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.95377236&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1.00679102&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;&lt;P class="lia-align-left"&gt;In the output, I am only getting one estimate per imputation (0.972689). Is there a way to change the output to include both estimates?&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;Thank you!&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 15 Dec 2022 19:14:46 GMT</pubDate>
    <dc:creator>cmendoza87</dc:creator>
    <dc:date>2022-12-15T19:14:46Z</dc:date>
    <item>
      <title>PROC SURVEYMEANS, quantiles, and outputs</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-SURVEYMEANS-quantiles-and-outputs/m-p/849941#M42081</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have run MI with 30 imputations and would like to calculate median estimates among subgroups. Using the code below, I was able to get median estimates, but I cannot seem to output the subgroup estimates.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SORT DATA=for_gee;&lt;BR /&gt;BY _imputation_;&lt;BR /&gt;RUN;&lt;BR /&gt;PROC SURVEYMEANS DATA=for_gee MEDIAN;&lt;BR /&gt;BY _imputation_;&lt;BR /&gt;WHERE months_post = .;&lt;BR /&gt;DOMAIN sex;&lt;BR /&gt;VAR igg_value_new;&lt;BR /&gt;ODS OUTPUT QUANTILES=stats1;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get this (one of the imputations):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;The SURVEYMEANS Procedure&lt;/DIV&gt;&lt;DIV class=""&gt;Imputation Number=30&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;STRONG&gt;Quantiles for Sex Domain&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;sex&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Variable&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Percentile&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Estimate&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Std&lt;BR /&gt;Error&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;95% Lower CL&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;95% Upper CL&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Female&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;igg_value_new&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;50&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Median&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.968816&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.009923&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.94935319&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.98827979&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Male&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;igg_value_new&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;50&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Median&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.980282&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.013516&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.95377236&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1.00679102&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;&lt;P class="lia-align-left"&gt;In the output, I am only getting one estimate per imputation (0.972689). Is there a way to change the output to include both estimates?&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;Thank you!&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 15 Dec 2022 19:14:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-SURVEYMEANS-quantiles-and-outputs/m-p/849941#M42081</guid>
      <dc:creator>cmendoza87</dc:creator>
      <dc:date>2022-12-15T19:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SURVEYMEANS, quantiles, and outputs</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-SURVEYMEANS-quantiles-and-outputs/m-p/849950#M42082</link>
      <description>&lt;P&gt;What defines your subgroups? If mean that you have another variable like age that you want combinations of Sex and Age considered then add them to the Domain such as&lt;/P&gt;
&lt;P&gt;Domain sex sex*age&amp;nbsp; age.&lt;/P&gt;
&lt;P&gt;This will give the results considering sex only, age within sex and age only. You can provide combinations for grouping by using ( )&amp;nbsp; similar to the Tables statement in proc freq.&lt;/P&gt;
&lt;P&gt;So you can combine groups of variables with statements like&lt;/P&gt;
&lt;P&gt;Domain (var1 var2 var3) * (vara varb varc);&lt;/P&gt;
&lt;P&gt;to provide var1*vara var1*varb var1*varc var2*vara etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 20:36:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-SURVEYMEANS-quantiles-and-outputs/m-p/849950#M42082</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-12-15T20:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SURVEYMEANS, quantiles, and outputs</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-SURVEYMEANS-quantiles-and-outputs/m-p/849960#M42083</link>
      <description>&lt;P&gt;My subgroups are male and female, but I only get one estimate instead of two in the output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 21:05:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-SURVEYMEANS-quantiles-and-outputs/m-p/849960#M42083</guid>
      <dc:creator>cmendoza87</dc:creator>
      <dc:date>2022-12-15T21:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SURVEYMEANS, quantiles, and outputs</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-SURVEYMEANS-quantiles-and-outputs/m-p/849984#M42084</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/393383"&gt;@cmendoza87&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;My subgroups are male and female, but I only get one estimate instead of two in the output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please look closely at your log. Do you see a statement anything like this?&lt;/P&gt;
&lt;PRE&gt;WARNING: Output 'QUANTILES' was not created.  Make sure that the output object name, label, or
         path is spelled correctly.  Also, verify that the appropriate procedure options are used
         to produce the requested output object.  For example, verify that the NOPRINT option is
         not used.

&lt;/PRE&gt;
&lt;P&gt;Now, go back to your Surveymeans statement and look at the requested statistics.&lt;/P&gt;
&lt;P&gt;You do not show any request for any quantile statistic so you only get the n, m, std error and confidence limits.&lt;/P&gt;
&lt;P&gt;If you want a quantile then you have to specify it on the Proc Statement such as Q1 Q3 Deciles Quartiles Median or other specific quantile wanted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you aren't using any complex weighting scheme, why suveymeans?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 23:19:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-SURVEYMEANS-quantiles-and-outputs/m-p/849984#M42084</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-12-15T23:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SURVEYMEANS, quantiles, and outputs</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-SURVEYMEANS-quantiles-and-outputs/m-p/850128#M42087</link>
      <description>&lt;P&gt;Sorry for the delay in responding. I do not see that message in the log. This is what I see:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: The input data set is subset by WHERE, OBS, or FIRSTOBS. This provides a completely separate&lt;BR /&gt;analysis of the subset. It does not provide a statistically valid subpopulation or domain&lt;BR /&gt;analysis, where the total number of units in the subpopulation is not known with certainty. If&lt;BR /&gt;you want a domain analysis, you should include the DOMAIN variables in a DOMAIN statement.&lt;BR /&gt;NOTE: The BY statement provides completely separate analyses of the BY groups. It does not provide a&lt;BR /&gt;statistically valid subpopulation or domain analysis, where the total number of units in the&lt;BR /&gt;subpopulation is not known with certainty. If you want a domain analysis, you should include&lt;BR /&gt;the DOMAIN variables in a DOMAIN statement.&lt;BR /&gt;NOTE: The data set WORK.STATS1 has 30 observations and 10 variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I included MEDIAN in the proc statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using surveymeans because I am trying to get median values for the imputed data and I saw this post:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/Statistical-Procedures/Multiple-imputation-caculating-medians/td-p/733644" target="_blank"&gt;Solved: Multiple imputation - caculating medians - SAS Support Communities&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am certainly open to other options.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 18:25:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-SURVEYMEANS-quantiles-and-outputs/m-p/850128#M42087</guid>
      <dc:creator>cmendoza87</dc:creator>
      <dc:date>2022-12-16T18:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SURVEYMEANS, quantiles, and outputs</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-SURVEYMEANS-quantiles-and-outputs/m-p/850133#M42088</link>
      <description>&lt;P&gt;If you want the quantiles by Domain in a data set then you use: ods output DOMAINQUANTILES =stat1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you see information in the RESULTS window that does not make it into your output data set you should use ODS TRACE to show which sources are used. For example which shows two output objects containing quantiles, Quantiles and Domainquantiles. The linked solution did not do DOMAIN analysis so did not need the Domainquantiles.&lt;/P&gt;
&lt;PRE&gt;71   ods trace on;
72   PROC SURVEYMEANS DATA=sashelp.class MEDIAN q1 q3;
73   /*BY _imputation_;*/
74   /*WHERE months_post = .;*/
75   ODS OUTPUT QUANTILES=stats1;
76   DOMAIN sex;
77   VAR height;
78   RUN;

NOTE: Writing HTML Body file: sashtml1.htm

Output Added:
-------------
Name:       Summary
Label:      Data Summary
Template:   Stat.SurveyMeans.Factoid
Path:       Surveymeans.Summary
-------------

Output Added:
-------------
Name:       Statistics
Label:      Statistics
Template:   Stat.SurveyMeans.Statistics
Path:       Surveymeans.Statistics
-------------

Output Added:
-------------
Name:       Quantiles
Label:      Quantiles
Template:   Stat.SurveyMeans.Quantiles
Path:       Surveymeans.Quantiles
-------------

Output Added:
-------------
Name:       DomainQuantiles
Label:      Quantiles for Sex Domains
Template:   Stat.SurveyMeans.DomainQuantiles
Path:       Surveymeans.DomainAnalysis.DomainQuantiles
-------------
NOTE: The data set WORK.STATS1 has 3 observations and 10 variables.
NOTE: PROCEDURE SURVEYMEANS used (Total process time):
      real time           0.47 seconds
      cpu time            0.26 seconds


79
80   ods trace off;

&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Dec 2022 18:40:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-SURVEYMEANS-quantiles-and-outputs/m-p/850133#M42088</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-12-16T18:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SURVEYMEANS, quantiles, and outputs</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-SURVEYMEANS-quantiles-and-outputs/m-p/850138#M42089</link>
      <description>&lt;P&gt;This worked, thank you!! I feel kind of dumb for not having tried that haha thank you for your help with this!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 19:23:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-SURVEYMEANS-quantiles-and-outputs/m-p/850138#M42089</guid>
      <dc:creator>cmendoza87</dc:creator>
      <dc:date>2022-12-16T19:23:54Z</dc:date>
    </item>
  </channel>
</rss>

