# Test for normality for confidence interval [closed]

given a sample distribution with $$n=15$$, $$\overline{x}$$, and $$s$$, how can you use a box plot to determine if the sample distribution is approximately normal? We know nothing about the population. We can assume $$N>150$$. In this case the box plot is left skewed with no outliers. I’m not clear what to look for.

New contributor
Ccgm_corky is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
• Typically you want to look for skewness, outliers, and multimodal features. If your graphical representation of data displays any of these features then it's really not safe to assume your population is approximately normal. There are more formal tests for normality, however. I'm not sure how much stats you know, but you could make a QQ plot or employ goodness of fit to more formally test or normlaity. – Matthew Pilling 2 days ago
• If a boxplot has one very long whisker or shows many outliers, that might be taken as evidence that the data are not normal. But for small sample sizes, looking at normal probability plots (QQ-plots) may be more useful. Formal tests with $n=15$ often fail to reveal that a non-normal population is non-normal. // Because your title mentions confidence intervals, my answer shows a bootstrap CI that does not require normal data. // However, for full disclosure, a t CI for $\mu$ from my particular data is $(18.54, 33.67),$ which is not a lot different from my bootstrap CI. – BruceET 2 days ago

A sample size of only $$n = 15$$ is at the lower edge for doing a bootstrap CI, but you might get a more reliable 95% from a somewhat skewed sample by using a nonparametric bootstrap CI for the population mean than you would by assuming normality and using a t confidence interval.

Consider the sample below. The maximum is farther from the mean than is the minimum; a stripchart shows mild right-skewness; and a normal probability plot is distinctly non-linear.

summary(x)
Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
9.057  15.657  22.235  26.105  37.405  52.175
length(x);  sd(x)
[1] 15             # sample size
[1] 13.66145       # sample SD

stripchart(x, pch="|")


plot(qqnorm(x)); qqline(x, col="blue")


Thus, for a sample of as few as fifteen, sample x shows enough evidence of non-normality that we might be skeptical of using a t confidence interval.

To get a 95% bootstrap CI for the population mean $$\mu,$$ we can use the procedure below. [There are many styles of bootstrap CIs; this is one of the simplest.]

If we knew the distribution of the sample mean $$\bar X,$$ then we could find values $$L$$ and $$U$$ that cut probability $$0.025$$ from its lower and upper tails, respectively, with $$P(L < D = \bar X - \mu < U) = 0.95.$$ Then we could pivot to get the 95% CI $$(\bar X - U. \bar X - L).$$

Not knowing the distribution, we take many (here 2000) 're-samples' of size $$n=15$$ (with replacement) from the sample x, and find each $$\bar X^*,$$ and then $$D^* = \bar X^* - \bar X.$$ This will give us an idea of the distribution of $$D,$$ and we use its quantiles to make a CI. [During the re-sampling, we temporarily use the observed mean $$\bar X$$ of the original sample as a proxy for the unknown $$\mu.]$$

In the R code below the suffixes .re (instead of $$*$$'s) indicate quantities based on re-samples. [In the last step, the observed $$\bar X$$ returns to its role as sample mean.]

set.seed(222)
a.obs = mean(x)
d.re = replicate(2000, mean(sample(x,15,rep=T)) - a.obs)
LU.re = quantile(d, c(.975,.025))
a.obs - LU.re
97.5%     2.5%
19.35891 32.41874


Notes: (1) An even simpler kind of 95% nonparametric bootstrap CI just finds the mean of each re-sample and takes quantiles 0.025 and 0.975 of the large collection of (2000) means as endpoints of the CI. Sometimes this kind of bootstrap CI doesn't work well for skewed data, but it doesn't do badly here.

set.seed(223)
a.re = replicate(2000, mean(sample(x,15,rep=T)))
quantile(a.re, c(.025,.975))
2.5%    97.5%
19.79505 32.81955


(2) Because I simulated the data x from a gamma distribution, I know that $$\mu = 24.$$ So we know that in this instance both of our CIs include $$\mu.$$ [Of course, in a real application, we would not know for sure that the CI covers $$\mu.]$$ The R code used to sample the data x for the demonstrations above is shown below.

set.seed(2010)
x = rgamma(15, 3, 1/8)