Statistical Inference for EveryoneXYZ Homework Edition

⇩ Download ▾

8.2 z-test

The zz-test is the simplest test to use, and is perhaps the most common. It is used when we have the following assumptions:

  1. We are modeling the data as a true value, μ\mu, with uncertainty
  2. We are modeling the as a Normal distribution with known deviation, σ\sigma, as in Normal(0,σ){\rm Normal}(0,\sigma).
  3. We are assuming independence between the measurements.

The model of the data is

d a t a = μ + uncertainty with probability Normal( μ = 0 ,known  σ ) \begin{eqnarray*} {\rm data} = \mu + \text{uncertainty with probability Normal($\mu=0$,known $\sigma$)} \end{eqnarray*}

where μ\mu represents the “true” value. The posterior distribution for μ\mu also follows a Normal distribution, with a smaller uncertainty, σ/N\sigma/\sqrt{N} where NN is the number of data points.

To use the zz-test, we perform the following steps:

  1. Calculate our best estimate for μ\mu, denoted as μ^\hat{\mu}.
  2. Given the known uncertainty, σ\sigma of a single measurement, determine the range of credible values for μ\mu within the uncertainty of the estimate for the NN observations, σ/N\sigma/\sqrt{N}.
  3. Test to see if the credible range includes zero.
  4. If so, then the test passes, and we can be reasonably confident that the parameter is non-zero - that the effect is real.
  5. If the test fails, i.e. the credible range does not include zero, then under the model the possibility of a zero-effect cannot be reasonably excluded.

There are several scenarios where we use the zz-test, each with the same procedure, differing only in the method of estimating the “true” value μ\mu.

  1. For NN independent observations, x1,x2,,xNx_{1}, x_{2}, …, x_{N} we have the best estimate given by the sample mean, and uncertainty related to the single-measurement deviation, σ\sigma, as

    μ^=x1+x2++xNN±σ/N\begin{eqnarray*} \hat{\mu} = \frac{x_{1} + x_{2} + \cdots + x_{N}}{N} \pm \sigma/\sqrt{N} \end{eqnarray*}

  2. When estimating a proportion, for a large number of events NN of which a fraction fh/Nf\equiv h/N are successful, we have

    μ^fσ/Nf(1f)/N\begin{eqnarray*} \hat{\mu} &\approx& f \\ \sigma/\sqrt{N} &\approx& \sqrt{f(1-f)/N} \end{eqnarray*}

  3. For smallish data sets, 5<N<305<N<30, where the uncertainty is not known,

    μ^x1+x2++xNNσ/NkS/N\begin{eqnarray*} \hat{\mu} &\approx& \frac{x_{1} + x_{2} + \cdots + x_{N}}{N}\\ \sigma/\sqrt{N} &\approx& k S/\sqrt{N} \end{eqnarray*}

    where we replace the known σ/N\sigma/\sqrt{N} from the previous case with an estimate using the sample standard deviation and an adjustment for small data set parameter kk,

    S2=1N1((x1x¯)2++(xNx¯)2)k1+20N2\begin{eqnarray*} S^{2}&=&\frac{1}{N-1}\left( (x_{1}-\bar{x})^{2}+\cdots+(x_{N}-\bar{x})^{2}\right) \\ k&\equiv& 1+\frac{20}{N^{2}} \end{eqnarray*}

Adapted from Statistical Inference for Everyone, by Brian Blais (Bryant University), licensed under CC BY-SA 4.0 (dual-licensed under the GNU FDL 1.2 or later; this adaptation uses the CC BY-SA grant). Changes were made; this adaptation is distributed under the same license. License: CC-BY-SA-4.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or ADA Title II. Every page is built against an automated accessibility gate, and the published editions will meet ADA Title II requirements when they release in late September 2026. If something is unusable, please tell us.