<?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 | PERCENTILE Option in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-SURVEYMEANS-PERCENTILE-Option/m-p/842228#M333033</link>
    <description>&lt;P&gt;I'd like to get the median, and IQR, of a continuous variable using PROC SURVEYMEANS. I can't seem to figure out the syntax. Neither "50" nor "median" seems to work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SURVEYMEANS DATA=&amp;amp;dataset PLOTS=histogram PERCENTILE=50;
 	STRATUM sdmvstra;
 	CLUSTER sdmvpsu;
 	WEIGHT &amp;amp;weight;
 	
	VAR 
/* 	DEMOGRAPHICS; */
	age_yrs
	;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-11-02 at 4.21.04 PM.png" style="width: 741px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76893iEF23D222D37BC9FA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-11-02 at 4.21.04 PM.png" alt="Screenshot 2022-11-02 at 4.21.04 PM.png" /&gt;&lt;/span&gt;Is there a&lt;/P&gt;
&lt;P&gt;Also, is there a way to add a normality test, like Shapiro-Wilk?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a PROC SURVEYUNIVARIATE? Doesn't seem like it...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Nov 2022 23:27:02 GMT</pubDate>
    <dc:creator>_maldini_</dc:creator>
    <dc:date>2022-11-02T23:27:02Z</dc:date>
    <item>
      <title>PROC SURVEYMEANS | PERCENTILE Option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SURVEYMEANS-PERCENTILE-Option/m-p/842228#M333033</link>
      <description>&lt;P&gt;I'd like to get the median, and IQR, of a continuous variable using PROC SURVEYMEANS. I can't seem to figure out the syntax. Neither "50" nor "median" seems to work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SURVEYMEANS DATA=&amp;amp;dataset PLOTS=histogram PERCENTILE=50;
 	STRATUM sdmvstra;
 	CLUSTER sdmvpsu;
 	WEIGHT &amp;amp;weight;
 	
	VAR 
/* 	DEMOGRAPHICS; */
	age_yrs
	;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-11-02 at 4.21.04 PM.png" style="width: 741px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76893iEF23D222D37BC9FA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-11-02 at 4.21.04 PM.png" alt="Screenshot 2022-11-02 at 4.21.04 PM.png" /&gt;&lt;/span&gt;Is there a&lt;/P&gt;
&lt;P&gt;Also, is there a way to add a normality test, like Shapiro-Wilk?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a PROC SURVEYUNIVARIATE? Doesn't seem like it...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 23:27:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SURVEYMEANS-PERCENTILE-Option/m-p/842228#M333033</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2022-11-02T23:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SURVEYMEANS | PERCENTILE Option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SURVEYMEANS-PERCENTILE-Option/m-p/842230#M333034</link>
      <description>&lt;P&gt;Use&amp;nbsp;&amp;nbsp;"percentile=(50)"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or just type "quartiles" in the proc surveymeans statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*  https://www.eia.gov/consumption/commercial/data/2003/index.php?view=microdata
File 15 */

filename csvFile url "https://www.eia.gov/consumption/commercial/data/2003/csv/FILE15.csv" termstr=crlf; 
 
proc import datafile=csvFile  
dbms=csv  
out=CBECS_2003; 
getnames=yes; 
guessingrows=3000; 
run; 

proc surveymeans data=CBECS_2003 quartiles /* percentile=(50) */ mean;
  strata STRATUM8;
  cluster PAIR8;
  var ELEXP8;
weight ADJWT8;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-11-02 at 7.41.03 PM.png" style="width: 799px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76894i818625E7FDF61BFB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-11-02 at 7.41.03 PM.png" alt="Screen Shot 2022-11-02 at 7.41.03 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 23:42:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SURVEYMEANS-PERCENTILE-Option/m-p/842230#M333034</guid>
      <dc:creator>PharmlyDoc</dc:creator>
      <dc:date>2022-11-02T23:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SURVEYMEANS | PERCENTILE Option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SURVEYMEANS-PERCENTILE-Option/m-p/842231#M333035</link>
      <description>&lt;P&gt;Sorry, I should have been more clear...I want the median and IQR in addition to the mean. I basically want something that looks like PROC Univariate output so I can assess for normality of the distribution of the continuous variables.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 23:47:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SURVEYMEANS-PERCENTILE-Option/m-p/842231#M333035</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2022-11-02T23:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SURVEYMEANS | PERCENTILE Option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SURVEYMEANS-PERCENTILE-Option/m-p/842242#M333037</link>
      <description>&lt;P&gt;The proc surveymeans statement has a range option, but not IQR – SAS must have a reason why.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suppose you could manually subtract Q1 from Q3.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc surveymeans data=CBECS_2003 quartiles mean ;
  strata STRATUM8;
  cluster PAIR8;
  var ELEXP8;
weight ADJWT8;
ods output 
Quantiles=Quantiles;
run;

proc transpose data=quantiles name=Quantile prefix=Quantile out=Quantiles2;
var Estimate;
run;

proc sql;
select
Quantile3-Quantile1 as IQR
from Quantiles2;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Nov 2022 00:17:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SURVEYMEANS-PERCENTILE-Option/m-p/842242#M333037</guid>
      <dc:creator>PharmlyDoc</dc:creator>
      <dc:date>2022-11-03T00:17:14Z</dc:date>
    </item>
  </channel>
</rss>

