<?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: FINDING MEDIAN FOR CATEGORIES OF SUBPOPULATIONS in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617407#M19073</link>
    <description>&lt;P&gt;PROC SUMMARY is the tool&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UNTESTED CODE&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=project1.dii_q nway;
    class sex q;
    var adj_dii;
    output out=_stats_ median=;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;By the way, the median of quartiles is an "octile", or a 12.5 percentile, and so there was no need for you to compute an intermediate step of computing quartile limits and then type the limits of the quartiles into a SAS data step, as you have done.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc univariate data=project1.dii_1 noprint;
    class sex q;
    var adj_dii;
    output out=_stats_ pctlpts=12.5 37.5 62.5 87.5 pctlpre=oct;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jan 2020 13:12:12 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-01-15T13:12:12Z</dc:date>
    <item>
      <title>FINDING MEDIAN FOR CATEGORIES OF SUBPOPULATIONS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617389#M19068</link>
      <description>&lt;P&gt;hello here. I have the attached data set below from a National Health survey. Q indicates Quartiles that I created separately for women and men using the following code.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Project1.DII_Q;
  set  Project1.DII_F;
  if sex=1 and Adj_DII &amp;lt;=-0.382609 then Q=1;
  if sex=1 and -0.382609 LT Adj_DII LE 0.618524 then Q=2;
  if sex=1 and 0.618524LT Adj_DII LE 1.651765 then Q=3;
  if sex=1 and Adj_DII&amp;gt; 1.651765 then Q=4;
  if sex=2 and Adj_DII &amp;lt;=-0.486805 then Q=1;
  if sex=2 and -0.486805 LT Adj_DII LE 0.598508 then Q=2;
  if sex=2 and 0.598508 LT Adj_DII LE 1.533177 then Q=3;
  if sex=2 and Adj_DII&amp;gt;1.533177 then Q=4;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I want to assign the median of the variable Adj_DII (in the attached data set) in each quartile category to individuals in that category separately by sex.But first,&amp;nbsp; &amp;nbsp;I want to find the median of Adj_DII in Q1, Q2, Q3, Q4&amp;nbsp; separately for men and women. I tried to use Proc survey means but didnt work. I need something like this;&lt;/P&gt;&lt;P&gt;For sex=1&lt;/P&gt;&lt;P&gt;median of Q1&lt;/P&gt;&lt;P&gt;median of Q2&lt;/P&gt;&lt;P&gt;median of Q3&lt;/P&gt;&lt;P&gt;median of Q4&lt;/P&gt;&lt;P&gt;And like wise for sex=2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to use Proc survey means but didnt work.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc surveymeans data=Project1.DII_Q  median;
strata kstrata;
cluster psu;
weight pooled_wt;
Domain Q;
var Adj_DII;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Kindly request for your assistance.&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 09:10:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617389#M19068</guid>
      <dc:creator>Prest</dc:creator>
      <dc:date>2020-01-15T09:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: FINDING MEDIAN FOR CATEGORIES OF SUBPOPULATIONS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617392#M19069</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;You should try this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=dii_m out=dii_median;
columns sex Q Adj_DII;
define sex / group "Sexe";
define Q / group "Quartile";
define Adj_DII / median;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Jan 2020 09:31:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617392#M19069</guid>
      <dc:creator>JeanDo</dc:creator>
      <dc:date>2020-01-15T09:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: FINDING MEDIAN FOR CATEGORIES OF SUBPOPULATIONS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617407#M19073</link>
      <description>&lt;P&gt;PROC SUMMARY is the tool&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UNTESTED CODE&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=project1.dii_q nway;
    class sex q;
    var adj_dii;
    output out=_stats_ median=;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;By the way, the median of quartiles is an "octile", or a 12.5 percentile, and so there was no need for you to compute an intermediate step of computing quartile limits and then type the limits of the quartiles into a SAS data step, as you have done.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc univariate data=project1.dii_1 noprint;
    class sex q;
    var adj_dii;
    output out=_stats_ pctlpts=12.5 37.5 62.5 87.5 pctlpre=oct;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 13:12:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617407#M19073</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-01-15T13:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: FINDING MEDIAN FOR CATEGORIES OF SUBPOPULATIONS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617511#M19078</link>
      <description>&lt;P&gt;You can use this syntax in PROC SURVEYMEANS to compute the medians for each sex within each category:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#3366FF"&gt;Domain&lt;/FONT&gt; Q*sex;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 16:30:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617511#M19078</guid>
      <dc:creator>Zard</dc:creator>
      <dc:date>2020-01-15T16:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: FINDING MEDIAN FOR CATEGORIES OF SUBPOPULATIONS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617670#M19110</link>
      <description>&lt;P&gt;Hello. Thank you for the assistance. I think I didnt write it correctly. What I meant is that I already categorised data into Q1-Q4. I need to find the median of the variable Adj_DII in each of the Qs stratified by sex.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 04:25:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617670#M19110</guid>
      <dc:creator>Prest</dc:creator>
      <dc:date>2020-01-16T04:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: FINDING MEDIAN FOR CATEGORIES OF SUBPOPULATIONS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617673#M19112</link>
      <description>&lt;P&gt;This is excellent and very simple.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 04:39:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617673#M19112</guid>
      <dc:creator>Prest</dc:creator>
      <dc:date>2020-01-16T04:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: FINDING MEDIAN FOR CATEGORIES OF SUBPOPULATIONS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617675#M19113</link>
      <description>&lt;P&gt;Thank you. Proc summary produced the results I wanted.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all for your effort.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 04:45:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/FINDING-MEDIAN-FOR-CATEGORIES-OF-SUBPOPULATIONS/m-p/617675#M19113</guid>
      <dc:creator>Prest</dc:creator>
      <dc:date>2020-01-16T04:45:28Z</dc:date>
    </item>
  </channel>
</rss>

