Undergraduate

UndergraduateProbability and StatisticsStatistics


Hypothesis Testing


Understanding hypothesis testing is important for analyzing data in statistics, especially when you need to make informed decisions based on quantitative evidence. Hypothesis testing is a method that helps you determine whether there is enough evidence in a sample of data to infer that a certain condition is true for the entire population.

What is a hypothesis?

Before getting into hypothesis testing, it is important to understand what a hypothesis is. In simple terms, a hypothesis is a statement or assumption about a parameter in a population. In the field of statistics, hypotheses are often statements about the mean or proportion of a population.

For example, let's say a factory claims that their bulbs last an average of 1,000 hours. Your hypothesis might be, "The average life of a bulb is 1,000 hours."

Types of hypotheses

There are two main types of hypotheses in hypothesis testing:

1. Null hypothesis (H0)

The null hypothesis is a general statement that there is no relationship between two measured phenomena or no association between groups. It is the default or basic hypothesis that indicates no effect or no difference. For the light bulb example, the null hypothesis is:

H0: μ = 1000

It states that the average life of light bulbs is 1000 hours.

2. Alternative hypothesis (Ha or H1)

The alternative hypothesis is the statement that refutes the null hypothesis. It suggests that there is an effect or difference. As per our example, the alternative hypothesis could be:

Ha: μ ≠ 1000

This shows that the average life of light bulbs is not 1000 hours.

Steps of hypothesis testing

Hypothesis testing follows a structured process. Here is a step-by-step guide on how it is typically done:

1. State the hypothesis

You begin by stating the null and alternative hypotheses. These are usually stated in terms of population parameters.

2. Determine the significance level (α)

The significance level, denoted as alpha (α), indicates the probability of rejecting the null hypothesis if it is true. Common significance levels are 0.05, 0.01, and 0.10.

3. Choose the appropriate test

Choose a statistical test that best suits your data and hypothesis. T-tests and z-tests are common for comparing means, while chi-square tests are used for categorical data.

4. Calculate the test statistic

Using the sample data, calculate the test statistic, which is a standardized value that measures the extent of difference between the observed data and what is expected under the null hypothesis.

5. Determine the p-value or critical value

The p-value indicates the probability of observing the test results under the null hypothesis. If the p-value is less than α, the null hypothesis is rejected. Alternatively, if the critical value approach is used, compare the test statistic to the critical value from the probability distribution.

6. Make a decision

Decide to reject or fail to reject the null hypothesis based on the p-value or critical value comparison.

7. Draw conclusions

Convert statistical judgments into conclusions in the context of the research question.

Visual example

Let us imagine a simple hypothesis test for the difference in means with the following scenario:

Imagine an example of data distribution:

H 0 H A 0 1

In this diagram, two distributions (in blue and red) represent the possible values for the null and alternative hypotheses. The overlapping region represents the common ground where we might fail to reject the null hypothesis.

Examples of hypothesis testing

Example 1: One-sample t-test

Suppose we want to know whether a new drug changes body temperature. The average body temperature is 98.6°F. After giving the drug to 30 people, the average temperature was recorded as 98.4°F with a standard deviation of 0.5°F.

Step 1: State the hypotheses.

H0: μ = 98.6
Ha: μ ≠ 98.6

Step 2: Determine the significance level.

α = 0.05

Step 3: Select a test.

Use a one-sample t-test because the population standard deviation is unknown, and the sample size is small.

Step 4: Calculate the test statistic (t).

t = (98.4 - 98.6) / (0.5/√30) = -2.19

Step 5: Determine the p-value using the t-distribution.

For df = 29, assuming a two-tailed test, the p-value ≈ 0.036.

Step 6: Make a decision.

Since the p-value is (0.036) < α (0.05), the null hypothesis is rejected.

Step 7: Conclusion.

We have enough evidence to suggest that the medicine affects body temperature.

Importance of hypothesis testing

Hypothesis testing plays a vital role in decision making in various fields such as medicine, social sciences, agriculture, business, etc. By relying on statistical evidence, it eliminates the need for guesswork in solving questions of interest.

Errors in hypothesis testing

We must understand that hypothesis testing does not provide certainty. It carries the risk of errors:

1. Type I error

This error occurs when the null hypothesis is true, but we mistakenly reject it. The probability of a Type I error is represented by the chosen α level.

2. Type II error

A Type II error occurs when the null hypothesis is false, but we fail to reject it. The probability of a Type II error occurring is represented by β.

The power of the test

The power of a test is the probability that it will correctly reject a false null hypothesis. Increasing the sample size or effect size can help increase the power of the test.

Conclusion

Hypothesis testing is an invaluable tool that provides a formal structure for testing ideas and theories. While it does not provide absolute proof, it does guide evidence-based decision making, helping analysts and scientists draw conclusions and make predictions with certainty.


Undergraduate → 6.2.3


U
username
0%
completed in Undergraduate


Comments