# Recursive Z-statistic

In respones to: Consider a standard Z-statistic used in hypothesis testing^{}. One of the variables needed to compute the Z-statistic is the number of observations. The problem is that with each additional observation one has to recompute the Z-statistic from scratch. It seems like there is no recursive formulation, e.g. a representation such as
Z(n) = Z(n-1) + new piece of information. Is there perhaps an approximate recursive formulation? Any other thoughts?
Thanks.

An example hypothesis test is:

${H}_{0}:$ $\mu ={\mu}_{0}$

${H}_{1}:$ $\mu \ne {\mu}_{0}$

We reject this hypothesis if $\overline{x}$ is either greater than or lower than a critical value. Assuming the critical values do not change all you have to update is ${Z}_{0}$.

The test statistic is:

$${Z}_{0}=\frac{\overline{X}-\mu}{\sigma /\sqrt{n}}$$ |

Assuming you know $\sigma $, when you get a new variable ${X}_{n+1}$ you can update $\overline{x}$ using $n$, $\overline{X}$, and ${X}_{n+1}$, then recalculate ${Z}_{0}$.

Now if you do not know $\sigma $, and your sample size is large enough to use the Normal distribution^{}, you have
to update your sample variance^{}, ${S}^{2}$. If your sample size is not large enough and you are using the t-distribution then
your critical values will change when $n$ changes.

To do update $S$ without recalculating, you should keep running totals of ${\sum}_{i}{X}_{i}$ and ${\sum}_{i}{X}_{i}^{2}$, so you can update $S$ using the computation formula for the sample variance.

Title | Recursive Z-statistic |
---|---|

Canonical name | RecursiveZstatistic |

Date of creation | 2013-03-22 19:11:30 |

Last modified on | 2013-03-22 19:11:30 |

Owner | statsCab (25915) |

Last modified by | statsCab (25915) |

Numerical id | 4 |

Author | statsCab (25915) |

Entry type | Definition |

Classification | msc 62-00 |