<?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: Calculate the median (Q1-Q3) overall from a demographic table in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-the-median-Q1-Q3-overall-from-a-demographic-table/m-p/866522#M42820</link>
    <description>&lt;P&gt;You can't. That operation is not mathematically feasible. Because of the way the median is computed, you cannot estimate the overall median from the medians of the groups.&amp;nbsp;For example, the following two data sets have exactly the same medians across all classes, but different overall medians.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data A;
input Group $ Value;
datalines;
A 1
A 2
A 3
B 2
B 4
B 6
;
proc means data=A median printalltypes ;
   class Group;
   var Value;
run;


data B;
input Group $ Value;
datalines;
A 1
A 2
A 3
B 4
B 4
B 6
;
proc means data=B median printalltypes ;
   class Group;
   var Value;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 27 Mar 2023 12:59:47 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2023-03-27T12:59:47Z</dc:date>
    <item>
      <title>Calculate the median (Q1-Q3) overall from a demographic table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-the-median-Q1-Q3-overall-from-a-demographic-table/m-p/866515#M42818</link>
      <description>&lt;P&gt;Hi guys,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;suppose to have the following median age (Q1-Q3) by hospitals from a demographic table:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hospital A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Hospital B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Hospital C&lt;/P&gt;
&lt;P&gt;43(39-61)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;55(41-78)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;57(43-59)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I put the median overall with Q1-Q3 without calculating that on the entire cohort from data?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have not the original data but only the final table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: what I would like to do is to give a single number (median and Q1-Q3) that represents all the Hospitals&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 13:28:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculate-the-median-Q1-Q3-overall-from-a-demographic-table/m-p/866515#M42818</guid>
      <dc:creator>NewUsrStat</dc:creator>
      <dc:date>2023-03-27T13:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the median (Q1-Q3) overall from a demographic table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-the-median-Q1-Q3-overall-from-a-demographic-table/m-p/866516#M42819</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/134532"&gt;@NewUsrStat&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I put the median overall with Q1-Q3 without calculating that on the entire cohort from data?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have not the original data but only the final table.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I really don't understand what you are saying, please describe in more detail.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 12:10:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculate-the-median-Q1-Q3-overall-from-a-demographic-table/m-p/866516#M42819</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-03-27T12:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the median (Q1-Q3) overall from a demographic table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-the-median-Q1-Q3-overall-from-a-demographic-table/m-p/866522#M42820</link>
      <description>&lt;P&gt;You can't. That operation is not mathematically feasible. Because of the way the median is computed, you cannot estimate the overall median from the medians of the groups.&amp;nbsp;For example, the following two data sets have exactly the same medians across all classes, but different overall medians.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data A;
input Group $ Value;
datalines;
A 1
A 2
A 3
B 2
B 4
B 6
;
proc means data=A median printalltypes ;
   class Group;
   var Value;
run;


data B;
input Group $ Value;
datalines;
A 1
A 2
A 3
B 4
B 4
B 6
;
proc means data=B median printalltypes ;
   class Group;
   var Value;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Mar 2023 12:59:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculate-the-median-Q1-Q3-overall-from-a-demographic-table/m-p/866522#M42820</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2023-03-27T12:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the median (Q1-Q3) overall from a demographic table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-the-median-Q1-Q3-overall-from-a-demographic-table/m-p/866531#M42821</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/134532"&gt;@NewUsrStat&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think what you can say in general about the overall quartiles Q1, Q2 (median) and Q3 is that they are in the range of the corresponding group-specific quartiles:&lt;/P&gt;
&lt;PRE&gt;39 &amp;lt;= Q1 &amp;lt;= 43
43 &amp;lt;= Q2 &amp;lt;= 57
59 &amp;lt;= Q3 &amp;lt;= 78&lt;/PRE&gt;
&lt;P&gt;(assuming &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n1qnc9bddfvhzqn105kqitnf29cp.htm#n1xsk6v7ixfsrmn1phcsrgps47mi" target="_blank" rel="noopener"&gt;QNTLDEF=&lt;/A&gt;5 and that the given group-specific quartiles are exact).&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 14:33:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculate-the-median-Q1-Q3-overall-from-a-demographic-table/m-p/866531#M42821</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2023-03-27T14:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the median (Q1-Q3) overall from a demographic table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-the-median-Q1-Q3-overall-from-a-demographic-table/m-p/866570#M42823</link>
      <description>Thank you very much! Maybe the mean of the means is feasible?</description>
      <pubDate>Mon, 27 Mar 2023 16:24:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculate-the-median-Q1-Q3-overall-from-a-demographic-table/m-p/866570#M42823</guid>
      <dc:creator>NewUsrStat</dc:creator>
      <dc:date>2023-03-27T16:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the median (Q1-Q3) overall from a demographic table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-the-median-Q1-Q3-overall-from-a-demographic-table/m-p/866577#M42825</link>
      <description>&lt;P&gt;You can do the mean of means if you know the number observations in each group.&lt;/P&gt;
&lt;P&gt;Assume&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The first group has N1 observations and the mean is M1&lt;/LI&gt;
&lt;LI&gt;The second group has N2 observations and the mean is M2&lt;/LI&gt;
&lt;LI&gt;The third group has N3 observations and the mean is M3&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Then the overall mean is&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(N1*M1 + N2*M2 + N3*M3) /&amp;nbsp; (N1 + N2 + N3)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The numerator is the sum of the variable. The denominator is the total number of observations.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 17:05:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculate-the-median-Q1-Q3-overall-from-a-demographic-table/m-p/866577#M42825</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2023-03-27T17:05:41Z</dc:date>
    </item>
  </channel>
</rss>

