# Build a (normal?) distribution from $n$, quartiles and mean?

I have some data that is described by $$n$$, quartiles (+ additional quantile point) and the mean. Is it possible to rebuild or model this distribution from these statistics? As the median and the mean are not the same, there is at least some skew, but otherwise, I would assume the data to be normal like.

Edit: This was marked as a duplicate, but in the other questions I found while searching, none of them included the information regarding the mean as a data point to recreate the distribution. Because of that additional parameter, I wondered if it made the estimation possible. In short, the affect of having the mean was not apparent from the other answers related to the question.

• Your post isn't quite clear. Do you want to estimate parameters of a normal distribution? (this may be feasible) Or are you trying to identify a simple distribution that's reasonably consistent with the information you have? (may be doable, but more information may be required to give a useful answer); Or perhaps something else? ... what was the "additional quantile point"? Sep 8 '18 at 2:31

The answer is No, not exactly anyhow.

If you have two quartiles of a normal population then you can find $\mu$ and $\sigma.$ For example the lower and upper quantiles of $\mathsf{Norm}(\mu = 100,\, \sigma = 10)$ are $93.255$ and $106.745,$ respectively.

 qnorm(c(.25, .75), 100, 10)
[1]  93.2551 106.7449


Then $P\left(\frac{X-\mu}{\sigma} < -0.6745\right) = 0.25$ and $P\left(\frac{X-\mu}{\sigma} < 0.6745\right) = 0.75$ provide two equations that can be solved to find $\mu$ and $\sigma.$

qnorm(c(.25,.75))
[1] -0.6744898  0.6744898


However, sample quartiles are not population quartiles. There is not enough information in any normal sample precisely to determine $\mu$ and $\sigma.$

And you are not really sure your sample is from a normal population. If the population has mean $\mu$ and median $\eta,$ then the sample mean and median, respectively, are estimates of these two parameters. If the population is symmetrical, then $\mu = \eta,$ but you say the sample mean and median do not agree. So you cannot be sure the population is symmetrical, much less normal.

• I would like to suggest that a more constructive way to interpret the question is that by employing the phrase "model the distribution" it asks how to estimate the parameters of a Normal distribution given three order statistics, the mean, and the count of an iid sample. It isn't easy to write down the likelihood.
– whuber
Sep 7 '18 at 21:36
• If the numerical value of $n$ were given along with sample mean $A$ and sample median $H,$ it would be easier to know how seriously to take the difference between $A$ and $H$ (and the difference between $H-Q_1$ and $Q_3 - H)$ as indication(s) that the population is not normal. Sep 7 '18 at 23:26
• That's right, so I was glad to see that the OP explicitly mentions $n$ in the first line of the question.
– whuber
Sep 7 '18 at 23:27
• @whuber: Gave a second answer. Sep 11 '18 at 2:34

Based on @whuber's Comments about 'modeling', I gave some thought to relatively elementary methods that might be used to estimate the parameters of a normal distribution given the sample size, sample quartiles, and sample mean, assuming that data are normal.

Most of this will work better for very large $n.$ After some experimentation, I found that sample sizes around 35 are just large enough to get reasonably good results. All computations are done using R; seeds (based on current dates) are shown for simulations.

Hypothetical sample: So let's suppose we have a sample (rounded to two places) that is known to have come from a normal population of size $n = 35,$ but with unknown $\mu$ and $\sigma.$ We are given that the sample mean is $A = 49.19,$ the sample median is $H = 47.72,$ and that the lower and upper quartiles are $Q_1 = 43.62,\, Q_3 = 54.73,$ respectively. (Sometimes reports and articles don't give complete datasets, but do give such summary data about the sample.)

Estimating the population mean. The best estimate of the population mean $\mu$ is the sample mean $A = \hat \mu = 49.19.$

Estimating the population standard deviation: If we knew it, a good estimate of the population standard deviation (SD) would be the sample SD $S,$ but that information is not given. The interquartile range (IQR) of a standard normal population $1.35,$ and the IQR of a very large normal sample would be about $1.35\sigma.$

diff(qnorm(c(.25, .75)))
[1] 1.34898
set.seed(1018); IQR(rnorm(10^6))
[1] 1.351207


The IQR of our sample of size $n = 35$ is $54.73 - 43.62 = 11.11$ and the expected IQR of a standard normal sample of size 35 is 1.274. So we can estimate $\sigma$ for our population using the sample IQR: $\check \sigma = 11.11/1.274 = 8.72.$

set.seed(910);  m = 10^6;  n = 25
iqr = replicate(m, IQR(rnorm(n)))
mean(iqr);  sd(iqr)
[1] 1.274278
[1] 0.3024651


Assessing results: Thus, we can surmise that our normal population distribution is roughly, $\mathsf{Norm}(49.19, 8.72).$ Actually, I simulated the sample from $\mathsf{Norm}(50, 10).$

set.seed(2018);  x = round(rnorm(35, 50, 10), 2);  summary(x)
Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
31.73   43.62   47.72   49.19   54.73   70.99


It seems worthwhile to make two comparisons: (a) how well does the given information match the CDF of $\mathsf{Norm}(49.19, 8.72),$ and (b) how well does the CDF of this estimated distribution match what we know to be the true normal distribution. Of course, in a practical situation, we would not know the true normal distribution, so the second comparison would be impossible.

In the figure below, the blue curve is the estimated CDF; the solid red points show the sample values $Q_1, H, Q_3,$ and the red circle shows $A.$ The CDF of the true normal distribution is shown as a broken curve. It is no surprise that the three values $Q_1, Q_3,$ and $A$ used to estimate normal parameters fall near the estimated normal CDF.

curve(pnorm(x, 49.19, 8.27), 0, 80, lwd=2, ylab="CDF",
main="CDF of NORM(49.19, 8.27)", xaxs="i", col="blue")
abline(h=0:1, col="green2")
points(c(43.62, 47.72, 54.73), c(.25, .5, .75), pch=19, col="red")
points(49.19, .50, col="red")


About symmetry: A remaining question is how much concern might have been appropriate about the normality of the data, upon noting that the sample mean exceeds the sample median by $D = A - H = 49.19 - 47.72 = 1.47.$ We can get a good idea by simulating the difference $D = A - H$ for many samples of size $n = 35$ from $\mathsf{Norm}(\mu = 49.19, \sigma = 8.27).$ A simple simulation shows that a larger positive difference might occur in such a normal sample about 11% of the time.

set.seed(918);  m = 10^6;  n = 25;  d = numeric(m)
for (i in 1:m) {
y = rnorm(n, 49.19, 8.27)
d[i] = mean(y) - median(y) }
mean(d > 1.47)
[1] 0.113


Thus there is no significant evidence of skewness in the comparison of the our sample mean and median. Of course, the Laplace and Cauchy families of distributions are also symmetrical, so this would hardly be "proof" that the sample is from a normal population.

It is possible to estimate the parameters based on this information, but to construct some (approximate) likelihood function based on the given information $$n,Q_1, Q_3, \bar{X}_n$$ do not see easy. In a way this is a followup on the answer by @BruceET, trying to formalize ideas in that answer.

Using the theory of order statistics we can construct a likelihood function based on $$n,Q_1, Q_3$$. How to also incorporate the observed mean do seem more difficult. To simplify I will assume $$n=4k$$ and that $$X_{(k)}\le Q_1\le X_{(k+1)}$$ and $$X_{(3k)}\le Q_3\le X_{(3k+1)}$$. An exact analysis (if at all possible) for small $$n$$ would need to know exactly how the quartiles was computed (different methods can give quite different answers for small $$n$$). Then we can find the likelihood $$L(\mu,\sigma) \propto \Phi(\frac{Q_1-\mu}{\sigma})^k \left[\Phi(\frac{Q_3-\mu}{\sigma})-\Phi(\frac{Q_1-\mu}{\sigma}) \right]^{2k}\left[1-\Phi(\frac{Q_3-\mu}{\sigma})\right]^k \cdot \phi(\frac{Q_1-\mu}{\sigma})\phi(\frac{Q_3-\mu}{\sigma})/\sigma^2$$ where $$\phi, \Phi$$ are the standard normal pdf, cdf respectively. This can now be used as any other likelihood function.

But to extend this to a likelihood also using the mean, we need the joint distribution of $$Q_1, Q_3, \bar{X}_n$$ and that would probably have to be approximated in some way. That seems like a nice little project!

Other ideas to look into here is ABC (approximate bayesian computation) which seems a good fit to estimation based on (insufficient) summary statistics. Or maybe simulated maximum likelihood. I will come back here to look at that.