A hypothesis test is a statistical inference method used to test the significance of a proposed (hypothesized) relation between population statistics (parameters) and their corresponding sample estimators. In other words, hypothesis tests are used to determine if there is enough evidence in a sample to prove a hypothesis true for the entire population.
The test considers two hypotheses: the null hypothesis, which is a statement meant to be tested, usually something like "there is no effect" with the intention of proving this false, and the alternate hypothesis, which is the statement meant to stand after the test is performed. The two hypotheses must be mutually exclusive; moreover, in most applications, the two are complementary (one being the negation of the other). The test works by comparing the -value to the level of significance (a chosen target). If the -value is less than or equal to the level of significance, then the null hypothesis is rejected.
When analyzing data, only samples of a certain size might be manageable as efficient computations. In some situations the error terms follow a continuous or infinite distribution, hence the use of samples to suggest accuracy of the chosen test statistics. The method of hypothesis testing gives an advantage over guessing what distribution or which parameters the data follows.
In statistical inference, properties (parameters) of a population are analyzed by sampling data sets. Given assumptions on the distribution, i.e. a statistical model of the data, certain hypotheses can be deduced from the known behavior of the model. These hypotheses must be tested against sampled data from the population.
The null hypothesis denoted is a statement that is assumed to be true. If the null hypothesis is rejected, then there is enough evidence (statistical significance) to accept the alternate hypothesis denoted Before doing any test for significance, both hypotheses must be clearly stated and non-conflictive, i.e. mutually exclusive, statements.
Rejecting the null hypothesis, given that it is true, is called a type I error and it is denoted , which is also its probability of occurrence. Failing to reject the null hypothesis, given that it is false, is called a type II error and it is denoted , which is also its probability of occurrence. Also, is known as the significance level, and is known as the power of the test.
Type I error Correct Decision Correct Decision Type II error
The test statistic is the standardized value following the sampled data under the assumption that the null hypothesis is true, and a chosen particular test. These tests depend on the statistic to be studied and the assumed distribution it follows, e.g. the population mean following a normal distribution. The -value is the probability of observing an extreme test statistic in the direction of the alternate hypothesis, given that the null hypothesis is true. The critical value is the value of the assumed distribution of the test statistic such that the probability of making a type I error is small.
Given an estimator of a population statistic , following a probability distribution , computed from a sample and given a significance level and test statistic
- define and
- compute the test statistic
-value Approach (most prevalent):
- Find the -value using (right-tailed).
- If the -value is at most reject . Otherwise, reject .
Critical Value Approach:
- Find the critical value solving the equation (right-tailed).
- If , reject . Otherwise, reject .
Note: Failing to reject only means inability to accept , and it does not mean to accept .
Assume a normally distributed population has recorded cholesterol levels with various statistics computed. From a sample of 100 subjects in the population, the sample mean was 214.12 mg/dL (milligrams per deciliter), with a sample standard deviation of 45.71 mg/dL.
Perform a hypothesis test, with significance level 0.05, to test if there is enough evidence to conclude that the population mean is larger than 200 mg/dL.
We will perform a hypothesis test using the -value approach with significance level
- Define : .
- Define : .
- Since our values are normally distributed, the test statistic is .
- Using a standard normal distribution, we find that our -value is approximately .
- Since the -value is at most we reject .
Therefore, we can conclude that the test shows sufficient evidence to support the claim that is larger than mg/dL.
If the sample size was smaller, the normal and -distributions behave differently. Also, the question itself must be managed by a double-tail test instead.
Assume a population's cholesterol levels are recorded and various statistics are computed. From a sample of 25 subjects, the sample mean was 214.12 mg/dL (milligrams per deciliter), with a sample standard deviation of 45.71 mg/dL.
Perform a hypothesis test, with significance level 0.05, to test if there is enough evidence to conclude that the population mean is not equal to 200 mg/dL.
We will perform a hypothesis test using the -value approach with significance level and the -distribution with 24 degrees of freedom:
- Define : .
- Define : .
- Using the -distribution, the test statistic is .
- Using a -distribution with 24 degrees of freedom, we find that our -value is approximately . We have multiplied by two since this is a two-tailed argument, i.e. the mean can be smaller than or larger than.
- Since the -value is larger than we fail to reject .
Therefore, the test does not show sufficient evidence to support the claim that is not equal to mg/dL.
The complement of the rejection on a two-tailed hypothesis test (with significance level ) for a population parameter is equivalent to finding a confidence interval with confidence level for the population parameter . If the assumption on the parameter falls inside the confidence interval, then the test has failed to reject the null hypothesis with -value greater than Otherwise, if does not fall in the confidence interval, then the null hypothesis is rejected in favor of the alternate with -value at most