Solved – Why is the CI in the median larger then the CI in the mean

confidence intervalmeanmedian

if I generate sample of normally distributed values (N=100, Mean of 10, STD 2.5)
Then I calculate the mean with confidence intervals and the median with confidence intervals of the sample I get:
A mean from 9.67 to 10.67 at the 95% CI and a median that is from 9.28 to 10.99 at the 95% CI. Conceptually I am having trouble with this as I always think of the median as more robust, why is its CI larger in the case of the normal distribution.
Can somebody explain why the median CI is larger than the mean confidence Interval even though the median is more robust?

Best Answer

The mean is an ordinary least squares estimator, and so it's BLUE - it's the best linear unbiased estimator. Best, in this case means that it has the smallest sampling variance of any unbiased estimator (including the median).

The proof is on the Wikipedia page for Gauss-Markov theorem: http://en.wikipedia.org/wiki/Gauss%E2%80%93Markov_theorem

Another way to think about it is that the mean uses all of the information available in the sample, the median is just one value.

Another way to look at it is to run a simulation, calculating the median and mean for a large number of samples, and to look at their standard deviation:

> sd(tapply(runif(100000), rep(1:1000, 100), mean))
[1] 0.02935391
> sd(tapply(runif(100000), rep(1:1000, 100), median))
[1] 0.04848859

The mean has a smaller variance (sd), which means it has narrower confidence intervals.