Can I use the Z-Test to calculate Goodness of Fit?

88 Views Asked by At

I have a background population defined by a normal distribution:

$$\mathcal{N}(\mu, \sigma^2)$$

where $\mu$ and $\sigma^2$ are known.

I'd like to perform a goodness of fit test on an observation to check the likelihood that its been drawn from the same distribution. I've read that you should use Pearson's $\chi^2$ statistic, but I'd like to use a Z-Test.

Is it ever possible to do this?

1

There are 1 best solutions below

2
On BEST ANSWER

$\def\eqdef{\stackrel{\text{def}}{=}}$ For a single observation when the mean and variance of the background population are known, a two-tailed $ Z\ $ test and the chi-squared test will give you identical results. If $\ X\sim\mathcal{N}(\mu,\sigma^2)\ $, then the $\ Z\ $ statistic, $$ Z\eqdef\frac{X-\mu}{\sigma}\ , $$ follows a standard normal distribution and the $\ \chi^2\ $ statistic $$ \chi^2\eqdef Z^2 $$ follows a chi-squared distribition with one degree of freedom. If your observed value of $\ X\ $ gives you a value of $\ z\ $ for your $\ Z\ $ statistic, then the $\ p$-value for the two-tailed $\ Z\ $ test is given by \begin{align} p&=P(Z\le-|z|)+P(Z\ge|z|)\\ &=2P(Z\ge|z|)\\ &=2\big(1-\mathcal{N}(0,1)(|z|)\big)\ , \end{align} and the $\ p$-value for the chi-squared test is given by \begin{align} p&=P\big(\chi^2\ge z^2\big)\\ &=1-\chi_1^2\big(z^2\big)\ . \end{align} However, since $\ Z^2\ge z^2\ $ if and only if either $\ Z\le-|z|\ $ or $\ Z\ge|z|\ $, then \begin{align} P\big(\chi^2\ge z^2\big)&=P\big(Z^2\ge z^2\big)\\ &=P(Z\le-|z|)+P(Z\ge|z|)\ , \end{align} and it follows that the two $\ p$-values are identical. In these circumstances, therefore, the two tests are completely equivalent.