Solved – How to calculate mean and standard deviation from median and quartiles

meanquantilesrself-study

I have 1st quartile, median and 3rd quartile. I want to find mean and SD. I want to use Bland’s method1 but i do not have max, min values of the data. How can i solve this problem? Is there any R package?

1 Bland, Martin. 2014. “Estimating Mean and Standard Deviation from the Sample Size, Three Quartiles, Minimum, and Maximum.” International Journal of Statistics in Medical Research 4 (1): 57–64.

Best Answer

You can check Wan et al. (2014)*. They build on Bland (2014) to estimate these parameters according to the data summaries available. See scenario C3 in their paper :

$$ \bar{X} ≈ \frac {q_{1} + m + q_{3}}{3}$$

$$ S ≈ \frac {q_{3} - q_{1}}{1.35}$$

or, if you have the sample size :

$$ S ≈ \frac {q_{3} - q_{1}}{2 \Phi^{-1}(\frac{0.75n-0.125}{n+0.25}) }$$

where $q_{1}$ is the first quartile, $m$ the median, $q_{3}$ is the 3rd quartile and $\Phi^{-1}(z)$ the upper zth percentile of the standard normal distribution.

So, in R :

q1 <- 0.02
q3 <- 0.04
n <- 100

(s <- (q3 - q1) / (2 * (qnorm((0.75 * n - 0.125) / (n + 0.25)))))
#[1] 0.0150441

* Wan, Xiang, Wenqian Wang, Jiming Liu, and Tiejun Tong. 2014. “Estimating the Sample Mean and Standard Deviation from the Sample Size, Median, Range And/or Interquartile Range.” BMC Medical Research Methodology 14 (135). doi:10.1186/1471-2288-14-135.