# Hypothesis Testing

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. Two such hypotheses are defined: the **Null Hypothesis** (assumed to be true), which is a statement meant to be rejected; and the **Alternate Hypothesis**, which is the statement meant to stand after the test is performed. The method is based on how does the null-hypothesis withstands the chance to be compared with a chosen threshold, which is the probability of rejecting the null-hypothesis given that it was true. The two hypotheses must be chosen to be mutually exclusive, moreover, in most applications the two are complementary (one, the negation of the other). A word of advice, this method gives no definitive answer, it gives the likelihood that the right assumption was chosen.

## Definitions and Methodology

In statistical inference, properties (parameters) of the distribution of values 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 \(H_0\)), is a statement that is assumed to be true. If the null hypotheses is rejected, then there is enough evidence (statistical significance) to accept thealternate hypothesis(denoted \(H_1\)). Before doing any test for significance, both hypothesis 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 errorand it is denoted \(\alpha\), which is also its probability of occurrence. Failing to reject the null hypothesis, given that it is false, is called aType II errorand it is denoted \(\beta\), which is also its probability of occurrence. Also \(\alpha\) is known as thesignificance level, and \(1-\beta\) is known as thepowerof the test.

\(H_0\) \(\textbf{is true}\) \(H_0\) \(\textbf{is false}\) \(\textbf{Reject}\) \(H_0\) Type I error Correct Decision \(\textbf{Reject}\) \(H_1\) Correct Decision Type II error The

test statisticis 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. TheP-valueis the probability of observing an extreme test statistic in the direction of the alternate hypothesis, given that the null hypothesis is true. Thecritical valueis the value of the assumed distribution of the test statistic such that the probability of making a Type I error is small.

MethodologiesGiven an estimator \(\hat \theta\) of a population statistic \(\theta\), following a probability distribution \(P(T)\), computed from a sample \(\mathcal{S}\). Given a significance level \(\alpha\) and test statistic \(t^*\).

- Define \(H_0\) and \(H_1\).
- Compute the test statistic \(t^*\).

P-value Approach (most prevalent)

- Find the P-value using \(t^*\) (right-tailed).
- If the P-value is at most \(\alpha\) reject \(H_0\). Otherwise, reject \(H_1\).

Critical Value Approach

- Find the critical value solving the equation \(P(T\geq t_\alpha)=\alpha\) (right-tailed).
- If \(t^*>t_\alpha\), reject \(H_0\). Otherwise, reject \(H_1\).
Note: Failing to reject \(H_0\) only means inability to accept \(H_1\), does not mean to accept \(H_0\).

## Examples

Assume a normally distributed populations cholesterol levels are recorded and various statistics computed. It was found that from a sample of 100 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 larger than 200 mg/dL.

Hypothesis TestWe will perform a hypothesis test using the P-value approach with a significance level \(\alpha=0.05\).

Define \(H_0\): \(\mu=200\).

Define \(H_1\): \(\mu>200\).

Since our values are normally distributed, the test statistic is \(z^*=\frac{\bar X - \mu_0}{\frac{s}{\sqrt{n}}}=\frac{214.12 - 200}{\frac{45.71}{\sqrt{100}}}\approx 3.09\).

Using a standard normal distribution we find that our P-value is approximately \(0.001\).

Since the P-value is at most \(\alpha=0.05\). We reject \(H_0\).

Therefore, we can conclude that the test shows sufficient evidence to support the claim that \(\mu\) is larger than \(200\) mg/dL.

Let us modify our problem, so we can compare how the normal and t-distributions behave under similar assumptions with smaller sample sizes. Also the question itself must be managed by a double tail test.

Assume a populations cholesterol levels are recorded and various statistics computed. It was found that 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.

Hypothesis TestWe will perform a hypothesis test using the P-value approach with a significance level \(\alpha=0.05\) and the t-distribution with 24 degrees of freedom.

Define \(H_0\): \(\mu=200\).

Define \(H_1\): \(\mu\neq 200\).

Using the t-distribution, the test statistic is \(t^*=\frac{\bar X - \mu_0}{\frac{s}{\sqrt{n}}}=\frac{214.12 - 200}{\frac{45.71}{\sqrt{25}}}\approx 1.54\).

Using a t-distribution with 24 degrees of freedom, we find that our P-value is approximately \(2(0.068)=0.136\). 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 P-value is larger than \(\alpha=0.05\). We fail to reject \(H_0\).

Therefore, the test does not show sufficient evidence to support the claim that \(\mu\) is not equal to \(200\) mg/dL.

## Hypothesis Test and Confidence Intervals

Observe that the complement of the rejection region on a two tailed hypotheses test (with significance level \(\alpha\)) for a population parameter \(\theta\), is equivalent to finding a confidence interval (with confidence level \(1-\alpha\)) for the population parameter \(\theta\). If the assumption on the parameter \(\theta\), falls inside the confidence interval means that the test have failed to reject the null-hypothesis (with P-value more than \(\alpha\)). Otherwise, if \(\theta\) does not fall in the confidence interval means that the null-hypothesis is rejected in favor of the alternate (with P-value at most \(\alpha\)).

## See Also

**Cite as:**Hypothesis Testing.

*Brilliant.org*. Retrieved from https://brilliant.org/wiki/hypothesis-testing/