My problem: parallel group randomized trial having a very right-skewed distribution of the primary outcome. I do not want to assume normality and use normal-based 95% CIs (i.e. using 1.96 X SE).

I am comfortable expressing the measure of central tendency as the median, but my question is then how to construct a 95% CI of the difference in medians between the two groups.

The first thing that comes to mind is bootstrapping (resample with replacement, determine median in each the two groups and subtract one from the other, repeat 1000 times, and use the Bias-corrected 95% CI). Is this the correct approach? Any other suggestions?

  • 3
    $\begingroup$ That was the first thing that came to my mind too. How big a sample do you have? $\endgroup$ – jbowman Apr 24 '12 at 16:01
  • $\begingroup$ 40 people in each of two groups = 80 total. $\endgroup$ – pmgjones Apr 24 '12 at 17:21
  • 3
    $\begingroup$ You might look into the nonparametric confidence interval and estimator for the difference of location parameters based on the Hodges-Lehmann estimator. As explained in the help page for R's wilcox.test() (under Details), this is closely related to the difference in medians, but not quite the same. $\endgroup$ – caracal Apr 24 '12 at 17:36
  • 2
    $\begingroup$ With regards to bootstrapping the median, it might be worthwhile to read about the smoothed bootstrap. $\endgroup$ – caracal Apr 24 '12 at 17:47
  • $\begingroup$ @caracal : This is a good point. Both the usual or smoothed bootstrap have correct asymptotic coverage, but the coverage probability of the smoothed bootstrap converges at a slightly faster rate. If I recall correctly, $|P(m \in \hat{I}_n) - 0.95| = O(n^{-1/3})$ for the usual bootstrap, and $O(n^{-2/5})$ for the smoothed bootstrap. There is a brief discussion of this with further references in Quantile Regression by Koenker (2005). $\endgroup$ – paul Apr 25 '12 at 19:05

The bootstrap procedure that you describe should be valid. However, it's important to keep in mind that, like normal-based 95% CI, a bootstrap confidence interval is only guaranteed to have correct coverage asymptotically. One nice thing about working with the median or other quantiles is that you can construct exact finite sample confidence intervals under very weak assumptions. The basic idea is that under the null that median of $y$ is $m$, the indicator for $y < m$ is a Bernoulli 0.5 random variable. You can use this observation to create a test statistic with a known finite sample distribution. See Chernozhukov, Hansen, Jansson (2009) for more details.

  • 1
    $\begingroup$ Could you please explain what you mean that it is only valid asymptotically? I'm specifically unsure what asymptotically means in this context. Thanks! $\endgroup$ – pmgjones Apr 24 '12 at 23:52
  • $\begingroup$ @pmgjones: A 95% confidence interval, $\hat{I}_n$, for some parameter $m$ is such that $P(m \in \hat{I}_n) = 0.95$ for all possible $m$ (or really all possible data generating processes). I wrote $\hat{I}_n$ to emphasize that the interval is some function of your sample. For the bootstrap or normal-based confidence interval, it is not true that $P(m \in \hat{I}_n) = 0.95$ (except for very special data generating processes). However, you can show that $\lim_{n \to \infty} P(m \in \hat{I}_n) = 0.95$. This is what I meant by saying that the bootstrap is only valid asymptotically. $\endgroup$ – paul Apr 25 '12 at 18:52

You can also try the method suggested in http://www.ncbi.nlm.nih.gov/pubmed/12243307 (Bonett, Price; 2002) as a simpler (at least computationally, I think) alternative. Good question, by the way.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.