<?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: Confidence interval for  difference in median in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-for-difference-in-median/m-p/822271#M40692</link>
    <description>&lt;P&gt;Your SAS statements include a BY statement, so presumably the log includes one or more notes that contains information about the BY-group where the data are degenerate. For example, look for a note that says something like,&amp;nbsp; "The previous warnings for for BY-group BMI2=&amp;lt;value&amp;gt;."&amp;nbsp; That BY group is degenerate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also investigate the the issue graphically. Create box plots of the data (or at least for the BY-groups that are causing the problem):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=VENT.Ventilation_data10  ;&lt;BR /&gt;   /* optional: WHERE BMI2 in (set of BY groups that give the warnings); */
   vbox icu_peep / group=after_intervention;
   BY BMI2;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Probably that method will enable you to figure out what is going on. For example, one of the BY-groups might have only a one unique value for one of the levels of after_intervention.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jul 2022 13:38:00 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2022-07-08T13:38:00Z</dc:date>
    <item>
      <title>Confidence interval for  difference in median</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-for-difference-in-median/m-p/822160#M40686</link>
      <description>&lt;P&gt;Please, I need help calculating the confidence interval for a median. I keep getting the following error messages.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;"WARNING: Heterogeneous covariance estimate is degenerate. Confidence limits for QUANTILE= 0.5&lt;BR /&gt;cannot be computed.&lt;BR /&gt;WARNING: Heterogeneous covariance estimate is degenerate. Covariance and correlation for&lt;BR /&gt;QUANTILE= 0.5 cannot be computed."&lt;/P&gt;
&lt;P&gt;I have tried CI=Sparsity, Rank and resampling but none could give me the confidence interval.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following is my SAS code&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc quantreg data=VENT.Ventilation_data10  ;
   class after_intervention ;
   model icu_peep=after_intervention / quantile=0.5;
   estimate 'Diff in Medians' after_intervention 1 -1 / CL;
   BY BMI2;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 21:14:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-for-difference-in-median/m-p/822160#M40686</guid>
      <dc:creator>UcheOkoro</dc:creator>
      <dc:date>2022-07-07T21:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: Confidence interval for  difference in median</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-for-difference-in-median/m-p/822161#M40687</link>
      <description>&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2017/02/22/difference-of-medians-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2017/02/22/difference-of-medians-sas.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 21:17:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-for-difference-in-median/m-p/822161#M40687</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-07-07T21:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: Confidence interval for  difference in median</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-for-difference-in-median/m-p/822246#M40689</link>
      <description>&lt;P&gt;Thank you for your response. The link you attached provides the same SAS code I used that gave me the warning with no confidence interval.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 11:51:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-for-difference-in-median/m-p/822246#M40689</guid>
      <dc:creator>UcheOkoro</dc:creator>
      <dc:date>2022-07-08T11:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: Confidence interval for  difference in median</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-for-difference-in-median/m-p/822266#M40690</link>
      <description>&lt;P&gt;Then calling&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633"&gt;@StatDave&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 13:16:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-for-difference-in-median/m-p/822266#M40690</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-07-08T13:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Confidence interval for  difference in median</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-for-difference-in-median/m-p/822271#M40692</link>
      <description>&lt;P&gt;Your SAS statements include a BY statement, so presumably the log includes one or more notes that contains information about the BY-group where the data are degenerate. For example, look for a note that says something like,&amp;nbsp; "The previous warnings for for BY-group BMI2=&amp;lt;value&amp;gt;."&amp;nbsp; That BY group is degenerate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also investigate the the issue graphically. Create box plots of the data (or at least for the BY-groups that are causing the problem):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=VENT.Ventilation_data10  ;&lt;BR /&gt;   /* optional: WHERE BMI2 in (set of BY groups that give the warnings); */
   vbox icu_peep / group=after_intervention;
   BY BMI2;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Probably that method will enable you to figure out what is going on. For example, one of the BY-groups might have only a one unique value for one of the levels of after_intervention.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 13:38:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-for-difference-in-median/m-p/822271#M40692</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2022-07-08T13:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Confidence interval for  difference in median</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-for-difference-in-median/m-p/822312#M40695</link>
      <description>&lt;P&gt;Thank you so much for the response. The BMI2 level 1 box plot for the after_intervention=0 does not have an upper or lower whisker, or an upper or lower quantile.&amp;nbsp;&amp;nbsp;The BMI2 level 2 and 3 box plot for the after_intervention=0 do not have the lower whisker but level 3 has a CI calculated but 2 does not.&lt;/P&gt;
&lt;P&gt;Find below the boxplots and the SAS log statements. Please, what would you suggest?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UcheOkoro_3-1657295358920.png" style="width: 720px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73070i3238E47C7703F73C/image-dimensions/720x249?v=v2" width="720" height="249" role="button" title="UcheOkoro_3-1657295358920.png" alt="UcheOkoro_3-1657295358920.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UcheOkoro_0-1657295135618.png" style="width: 436px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73067i52FD68A31E3E3205/image-dimensions/436x323?v=v2" width="436" height="323" role="button" title="UcheOkoro_0-1657295135618.png" alt="UcheOkoro_0-1657295135618.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UcheOkoro_1-1657295174076.png" style="width: 441px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73068i0E9F8EEE87AD37C9/image-dimensions/441x330?v=v2" width="441" height="330" role="button" title="UcheOkoro_1-1657295174076.png" alt="UcheOkoro_1-1657295174076.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UcheOkoro_2-1657295251579.png" style="width: 429px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73069i359783F22BCEC90B/image-dimensions/429x321?v=v2" width="429" height="321" role="button" title="UcheOkoro_2-1657295251579.png" alt="UcheOkoro_2-1657295251579.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Without the by statement&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UcheOkoro_5-1657295884674.png" style="width: 737px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73072i63F14D07ACB58F71/image-dimensions/737x163?v=v2" width="737" height="163" role="button" title="UcheOkoro_5-1657295884674.png" alt="UcheOkoro_5-1657295884674.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UcheOkoro_4-1657295807739.png" style="width: 546px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73071i80B25F508676AA1F/image-dimensions/546x431?v=v2" width="546" height="431" role="button" title="UcheOkoro_4-1657295807739.png" alt="UcheOkoro_4-1657295807739.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 16:04:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-for-difference-in-median/m-p/822312#M40695</guid>
      <dc:creator>UcheOkoro</dc:creator>
      <dc:date>2022-07-08T16:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Confidence interval for  difference in median</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-for-difference-in-median/m-p/822325#M40698</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;Please, what would you suggest?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;I do not know.&amp;nbsp;Your data appeared to be binned to the nearest integer. Binned data always presents challenges to quantile-based computations. For BMI2=1, it looks like the two groups have exactly the same median and have many duplicate values. Tied values also present many challenges for quantile routines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Clearly, your data are degenerate for some BY groups and the procedure cannot estimate the quantities necessary for the CL because a certain covariance matrix is singular.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are willing to try a wild suggestion, you might think about using &lt;A href="https://blogs.sas.com/content/iml/2016/08/17/smooth-bootstrap-sas.html" target="_self"&gt;the smooth bootstrap&lt;/A&gt;.&amp;nbsp;You would&amp;nbsp;jitter the icu_peep variable by adding a small random noise to each value. For example, if you think that the response that has the value k is actually uniformly distributed in the interval (k-1/2, k+0.5], you could try adding a random value in [-0.5, 0.5], like this:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data Want;&lt;/P&gt;
&lt;P&gt;set VENT.Ventilation_Data10;&lt;BR /&gt;call streaminit(123);&lt;/P&gt;
&lt;P&gt;icu_peep_jit = icu_peep + rand("Uniform", -0.5, 0.5);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could then analyze the&amp;nbsp;icu_peep_jit variable. I am curious if that resolves the problem. If so, this suggests using a bootstrap-type approach with jittered data, which is called the smooth bootstrap.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 17:51:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-for-difference-in-median/m-p/822325#M40698</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2022-07-08T17:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Confidence interval for  difference in median</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-for-difference-in-median/m-p/822381#M40705</link>
      <description>&lt;P&gt;It worked! Thank you so much for taking time to respond. I am very grateful.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 22:12:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-for-difference-in-median/m-p/822381#M40705</guid>
      <dc:creator>UcheOkoro</dc:creator>
      <dc:date>2022-07-08T22:12:01Z</dc:date>
    </item>
  </channel>
</rss>

