Hypothesis testing leads us to make a decision whether the null hypothesis is plausibly consistent with a sample result. Samples do not always exactly mirror the populations from which they are drawn , so making an inference from a sample to the population always involves a risk of error. Specifically, whether we choose to reject or not reject a null hypothesis , we need to be aware of the difference between a Type 1 error (alpha error) and a Type 2 error (beta error).
A Type 1 error occurs when the null hypothesis of no difference is rejected, even though in fact there is no difference. In assessing whether the sample in the example above with a mean age of 32 came from the population with mean age of 35 , we rejected the null hypothesis of no difference . The chances of selecting, from an average where the average population is 35 years, a sample with an average of 32 or less in 5 only in a thousand.However, we may actually select one of those rare 5-in-1000 samples. The sample may indeed have come from a population with an average age of 35 years , but the sample may just happen to randomly pick up a few especially young people . There is always a risk of such an event , which is why we speak in the terms of probabilities . The question is whether we are prepared to make this error .
A type 2 error occurs when we fail to reject the null hypothesis when in fact it is false . For example, where the sample had above an average age of 36 , we concluded that it did come from a population with an average age of 35 years. The difference between the sample statistics and the hypothesized parameter value is so small that it can be attributed to random sampling error . However, it may in reality be that the population from which the sample is drawn does not have an average age of 35, but our sample just happened to select some unrepresentative people . The relationship between these two possible error types in the table below.