In hypothesis testing, there are two competing hypotheses about a population parameter, such as the population mean. The null hypothesis is a tentative, or temporary, assumption about the population parameter. The alternative hypothesis is the opposite of whatever is stated in the null hypothesis. When developing the null and alternative hypotheses, there are three possible forms of a hypothesis test. They are known as lower tail, upper tail and two-tailed tests. Whatever the test is trying to determine will be the alternative hypothesis.
Type I and type II errors are the two types of errors that can be made when doing a hypothesis test. A type I error is when you reject the null hypothesis when the null is true. A type II error is when you accept the null hypothesis when the alternative is true. In hypothesis testing, we usually choose a level of significance, which is the probability of making a type I error. Since we are not controlling for a type II error, we don't use the phrase "accept the null". Instead, our two options are reject the null or do not reject the null.
When doing hypothesis tests about the population mean, the steps taken depend on the form of the hypothesis test. However, the first step is always to compute the value of the test statistic. The test statistic can then be used with either the p-value approach or critical value approach. In the p-value approach, we compute a p-value, where "p" stands for probability. In a lower tail test, the p-value is the probability of getting a value for the test statistic as small as or smaller than that provided by the sample. In a lower tail test, the critical value is the value of the test statistic corresponding to an area of alpha in the lower tail of the sampling distribution of the test statistic.
The procedure for a two-tailed test differs from a one-tailed test (lower tail and upper tail). The first step, to calculate the test statistic, is the same. However, the p-value in a two-tailed test is the probability of getting a value for the test statistic as unlikely as or more unlikely than that provided by the sample. The rejection rule for the p-value is the same. Their are two critical values in a two-tailed test. The lower critical value is the value of the test statistic corresponding to an area of alpha / 2 in the lower tail. While the upper critical value is the value of the test statistic corresponding to an area of alpha / 2 in the upper tail.
In the sigma unknown case, the t distribution is used instead of the z distribution. The test statistic is thus written as t instead of z. The formulas for the test statistic are the same except that the sample standard deviation is used in place of the population standard deviation. The degrees of freedom for the test statistic is the sample size minus one. For an upper tail test, the p-value is the probability of getting a value for the test statistic as large as or larger than that provided by the sample. The critical value is the value of the test statistic corresponding to an area of alpha in the upper tail of the sampling distribution of the test statistic.
Two-tailed tests in the sigma unknown case are similar to the ones in the sigma known case, except for a few differences. The first difference is that the test statistic follows a t distribution with n-1 degrees of freedom, rather than a z distribution. The p-value is still the probability of getting a test statistic as unlikely as or more unlikely than the sample value. However, you will need to use the t table rather than the z table to get the p-value since the test statistic follows a t distribution. The rejection rule for the p-value approach will be exactly the same. The critical values will be the values of the test statistics that provides areas of alpha/2 in the lower and upper tails. Again, you will have to use the t table instead of the z table to find these critical values since the test statistic follows a t distribution.