Confidence interval for the median I have a set of values ${x_i}, i=1, \dots ,N$ of which I calculate the median M. I was wondering how I could calculate the error on this estimation.
On the net I found that it can be calculated as $1.2533\frac{\sigma}{\sqrt{N}}$ where $\sigma$ is the standard deviation. But I did not find references about it. So I do not understand why.. Could someone explain it to me?
I was thinking that I could use bootstrap to have an estimate of the error but I would like to avoid it because it would slow down a lot my analysis.
Also I was thinking to calculate the error on the median in this way
$$\delta M = \sqrt{ \frac{\sum_i(x_i - M)^2}{N-1} } $$
Does it make sense?
 A: To directly deal with error on the median you can use the exact nonparametric confidence interval for the median, which uses order statistics.  If you want something different, i.e., a measure of dispersion, consider Gini's mean difference. Code is here for the median's confidence interval.
A: As pointed out in the other answer, there is a non-parametric CI for the median using the order statistics. That CI is better in many aspects than what you found on the net.  
Now, if you must know where the $1.2533\frac{\sigma}{\sqrt{N}}$ factor comes from,  the answer is from the asymptotic distribution of the median. If we denote the sample median by $\tilde{\theta}$ and the population median by $\theta$ then it can be shown that
$$\sqrt{n} \left( \tilde{\theta} - \theta \right) \xrightarrow{L} \mathcal{N} \left(0, \frac{1}{4 \left[f  \left( \theta \right) \right]^2} \right)$$ 
where $f$ is the distribution of your sample. The result is not as universal as the CLT because the asymptptic distribution still depends on the underlying distribution of your sample (through the term $\left[f  \left( \theta \right) \right]^2$). You can, however, make the drastic simplication that your sample comes from a normal distribution with mean -and median- $\theta$ and variance $\sigma^2$. Evaluating $f$ at its point of symmetry then yields 
$$\left[f  \left( \theta \right) \right]^2 = \frac{1}{2\pi \sigma^2}$$
and so the asymptotic variance becomes 
$$\frac{2\pi}{4} \sigma^2$$. 
Divide by $N$ and take the square root of that to arrive at your standard error $1.2533\frac{\sigma}{\sqrt{N}}$.
