Z-test
This test is not very often used because it relies on knowing the true expectation and variance of your population, but it's used as the basis for most other statistics tests.
We have a population with
In a sample of size
Since the sample average is normally distributed (Central Limit Theorem), if we assume that the difference is due to sampling error and our sample does not differ from the overall population (our null hypothesis
The normal distribution in this case is
If our value
The biggest problem is that this still relies on the prosecutor's fallacy. Using Bayesian statistics, we need to get the posterior probability of the null hypothesis being true based on our data. However, since we can't know the probabilities of every other possibility, we cannot actually calculate this.
In math terms, we determined
More details:
- This is a two-tailed test. In some cases we might want to only look at whether it is bigger, in this case we would just look at if its in the top 5%.
The same test with a higher n
If we do the same test from a larger sample, this means we have a narrower normal distribution (lower s.d., therefore we can estimate the true mean better). As seen below, if we took the same 5% cutoff value, then our results will be significant at a value much less extreme value.
When communicating statistics, it might be better to explain as
"The data represents an outlier under the null hypothesis" - this is what statistics can tell us. It might be misleading to say something is "significant", especially when communicating with the public and people not as well-versed in statistics.
z-score
Why do we call it a z-test?
This is because of an old-fashioned concept called the "z-score" which is not much used anymore.
If the sample average were close to the true mean, we would end up with zero, and the standard deviation of the