# Estimating the Mean of a Normal Variable from a Sample

On sampling a normal random variable   $\displaystyle{ Z_{\mu,\sigma} }$   of mean   $\mu$   and standard deviation   $\sigma$ randomly and independently   $n$   times, the average   $\bar{X}$   is a normal random variable with mean   $\mu$   and standard deviation   $\frac{\sigma}{\sqrt{n}}\;$ .   That is, $\bar{X}$   has the same density as   $\displaystyle{ \bar{X} =Z_{\mu,\frac{\sigma}{\sqrt{n}}} }\;$ .   As such, we can construct a priori confidence intervals for where   $\bar{X}$   will take its value

## Example:   Find a   $90\%$   confidence interval about the mean for   $\bar{X}\,$ , a sample of size   $100$   of   $\displaystyle{ Z_{17, 2} }\;$ .

As   $\bar{X}$   has the same density as   $\displaystyle{ Z_{17, \frac{2}{\sqrt{100}}} =Z_{17, 0.2} }\,$ , a   $90\%$   confidence interval about the mean is of the form   $(17-m, 17+m)$   and satisfies   $\displaystyle{ P\left( Z_{17, 0.2} \in (17-m, 17+m) \right) =0.9 }\;$ .   But this means   $\displaystyle{ P\left( Z_{0, 0.2} \in (-m, m) \right) =0.9 }\,$ , or   $\displaystyle{ P\left( Z_{0, 1} \in \left(-\frac{m}{.2}, \frac{m}{.2}\right) \right) =0.9 }\;$ .   This is satisfied when   $\displaystyle{ \frac{m}{.2} =1.645 }\,$ , or   $m=.329\;$ .

We now wish to turn this process around.   That is, given that we have completed a test and have data at hand, we wish to draw conclusions about the probabilistic process (presuming that there is such) generating our data.

For example, suppose we have a sample of size one-hundred from a process   $X$   known to be normal, with unknown mean   $\displaystyle{ \mu_1 }$   and known standard deviation   $\sigma =3\;$ .   We seek the   $\mu$   values such that   $\bar{X}$   is in the   $90\%$   confidence interval about the mean   $\mu$   of   $\displaystyle{ Z_{\mu,\frac{3}{\sqrt{100}}} =Z_{\mu,.3} }\;$ .   This will be turn out to be an interval   $I\,$ , and we will call   $I$   the   $90\%$   confidence interval for   $\displaystyle{ \mu_1 }\;$ .   That is, $\, \displaystyle{ \mu_1 \in I }$   precisely when   $\bar{X}$   is in the   $90\%$   confidence interval about the mean of   $\displaystyle{ Z_{\mu_1,.3} }\;$ .

We now wish to see that the set of   $\mu$   values such that   $\bar{X}$   is in the   $90\%$   confidence interval about the mean of   $\displaystyle{ Z_{\mu,.3} }$   is indeed an interval.   To this end, the   $90\%$   confidence interval about the mean of   $\displaystyle{ Z_{\mu,.3} }$   is given by   $( \mu -.3\cdot 1.645 , \mu +.3\cdot 1.645) =(\mu -.492, \mu +.492 )\;$ .   Thus   $\bar{X}$   is in this   $90\%$   confidence interval precisely when   $\bar{X}\in (\mu -.492, \mu +.492 )\,$ , or   $\bar{X}-\mu \in (-.492, .492) \;$ .   This can be expressed as   $\mu -\bar{X} \in (-.492, .492)$   or   $\mu \in (\bar{X} -.492, \bar{X} +.492)\;$ .   This is the desired interval.

We thus say that the actual mean   $\displaystyle{ \mu_1 }$   is in the   $90\%$   confidence interval for the mean   $\mu\,$ , given   $\bar{X}\,$ , if   $\displaystyle{ \mu_1 \in (\bar{X} -.492, \bar{X} +.492)}\;$ .

This process clearly generalizes to arbitrary confidence ( $\,\lt 100\%\,$ ) and arbitrary sample size.

## The General Case

We are given sample mean   $\bar{X}$   for a sample of size   $n$   of a   $\displaystyle{ Z_{\mu,\sigma} }$   process.   The mean   $\displaystyle{ \mu }$   is unknown but the standard deviation   $\displaystyle{ \sigma }$   is known.   We will say that   $\displaystyle{ \mu }$   is in the   $100\cdot p\%$   confidence interval for the mean if   $\bar{X}$   is in the   $100\cdot p\%$   confidence interval about the mean of   $\displaystyle{ Z_{\mu,\frac{\sigma}{\sqrt{n}}} }\;$ .   That is, if   $\bar{X} \in (\mu -\alpha, \mu +\alpha)$   where   $\displaystyle{ P\left( Z_{\mu,\frac{\sigma}{\sqrt{n}}} \in (\mu -\alpha, \mu +\alpha) \right) =p }\;$ .   Our task is to determine   $\alpha$   here.   This is not difficult.   The condition holds precisely when   $\displaystyle{ P\left( Z_{0,\frac{\sigma}{\sqrt{n}}} \in (-\alpha, \alpha) \right) =p }\,$ , or
$$P\left( Z_{0,1} \in \left( -\alpha\cdot\frac{\sqrt{n}}{\sigma} , \alpha \cdot\frac{\sqrt{n}}{\sigma} \right) \right) =p \;\text{.}$$

That is, for   $p\in (0,1)\,$ , we find   $\alpha$   so that
$$P\left( Z_{0,1} \in \left( -\alpha\cdot\frac{\sqrt{n}}{\sigma} , \alpha \cdot\frac{\sqrt{n}}{\sigma} \right) \right) =p \;\text{.}$$
and know that   $(\mu -\alpha, \mu +\alpha)$   is the   $100\cdot p\%$   confidence interval for the mean of   $\displaystyle{ Z_{\mu,\frac{\sigma}{\sqrt{n}}} }\;$ .   Now   $\bar{X} \in (\mu -\alpha, \mu +\alpha)$   precisely when   $\bar{X} -\mu \in (-\alpha, \alpha)\,$ , or   $\mu \in (\bar{X} -\alpha, \bar{X} +\alpha)\;$ .

Here is an example illustrating how this works.

## Example:   A normal process   $\displaystyle{ Z_{\mu,\sigma} }$   is known to have standard deviation   $\sigma=5\;$ .   A sample of size   $n=250$   yields sample mean   $\bar{X} =146\;$ .   Find the   $95\%$   confidence interval about the mean for   $\mu\;$ .

According to our above prescription, we need to find   $\alpha$   such that
$$P\left( Z_{0,1} \in\left( -\alpha\cdot\frac{\sqrt{250}}{5} , \alpha \cdot\frac{\sqrt{250}}{5} \right) \right) =.95 \;\text{.}$$
But we know that   $\displaystyle{ P\left( Z_{0,1} \in (-1.96 , 1.96)\right) =.95 }\;$ .   Thus we must have
$$\alpha \cdot\frac{\sqrt{250}}{5} =1.96 \,\text{,}$$
or
$$\alpha =0.62 \;\text{.}$$
Thus our   $95\%$   confidence interval for   $\mu$   is $(146 -0.62, 146+0.62) =(145.38, 146.62)\;$ .

The determination of the value   $0.62$   in the preceding example has been packaged into most common spreadsheet applications with a command like “=CONFIDENCE(.05, 5, 250)” , where

1. the   $.05$   represents   $1-.95$   with   $.95$   our confidence,
2. the   $5$   being the known standard deviation of the process, and
3. the   $250$   being the size of the sample.

You can experiment with this in the spreadsheet below.

It is worthwhile (as will be seen in the discussion below) to understand how the workings of this command can be managed using more basic commands.   In particular, if we have a   $95\%$   confidence interval about the mean of a normal distribution, then such a process will fall out of the mean   $5\%$   of the time.   By symmetry, $\,2.5\%$   of the time the process will give a value below the confidence interval, and   $2.5\%$ of the time above.   We can find the value   $\alpha$   such that   $\displaystyle{ P\left( Z_{0,1} \lt \alpha \right) =.025 }$   using the command “=NORMSINV(1-0.25)” or “=NORMSINV(.975)” and then calculate our desired confidence interval.   This is also illustrated in the spreadsheet below.

Click here to open a copy of this so you can experiment with it. You will need to be signed in to a Google account.

Similar considerations allow us to define one-sided confidence intervals for the mean of a normal random variable, given the value of the mean of a sample of size   $n\;$ .

## One-sided Confidence Intervals for the Mean

The sample mean   $\bar{X}$   of a sample of size   $n$   of a normal process   $\displaystyle{ Z_{\mu, \sigma} }$   sits within the   $90\%$   confidence interval to the left if $\bar{X} \in (-\infty, \mu +\alpha)\,$ , where
$$P\left( Z_{\mu,\frac{\sigma}{\sqrt{n}}} \lt \mu +\alpha\right) =.10 \;\text{.}$$
Thus   $\bar{X} -\mu \lt\alpha\,$ , or   $\mu \gt \bar{X} -\alpha\;$ .   So we say   $\mu$   is in the   $90\%$   left-confidence interval for a sample of size   $n$   of a normal process with standard deviation   $\sigma$   if   $\mu \gt \bar{X} -\alpha\,$ , where   $\alpha$   satisfies
$$P\left( Z_{\mu,\frac{\sigma}{\sqrt{n}}} \lt \mu +\alpha\right) =.10 \;\text{.}$$
But this is
$$P\left( Z_{0,1} \lt \alpha\cdot \frac{\sqrt{n}}{\sigma} \right) =.10 \,\text{,}$$
so we have a way to determine   $\alpha$   from the standard normal distribution.

Clearly we can replace the   $90\%$   confidence by any figure between   $0$   and   $1$   that we wish.

### Example:   Find the   $99\%$ left-confidence interval for the true mean of a normal process with standard deviation   $15\,$, given a sample of size   $400$   with sample mean   $88\;$ .

blah

In a similar fashion we can find right-confidence intervals for sample of given size of a normal process with known standard deviation, given the sample mean.