Grade 12

Grade 12Probability and StatisticsStatistics


Hypothesis Testing


Hypothesis testing is a fundamental and important concept in statistics, particularly in the field of inferential statistics. It provides a method for making judgements about a population based on sample data.

What is hypothesis testing?

In short, hypothesis testing is a process that allows you to make an estimate or educated guess about a population parameter. It involves forming a hypothesis, collecting sample data, and then determining whether the data supports the hypothesis. Here is a description of the key terms in hypothesis testing:

  • Null hypothesis (H0): This is a statement that there is no effect or no difference, and is assumed to be true unless evidence indicates otherwise.
  • Alternative hypothesis (H1 or Ha): This is a statement that there is an effect or difference, and it is the one you want to support with your data.
  • Significance level (α): This is the threshold to decide whether to reject the null hypothesis. Common significance levels are 0.05, 0.01, and 0.10.
  • P-value: This is the probability of obtaining the observed result, or a more extreme one, assuming the null hypothesis is true. A small p-value indicates strong evidence against the null hypothesis.

Hypothesis testing procedure

The process of hypothesis testing involves several steps:

  1. State the null and alternative hypotheses.
  2. Determine the significance level (α).
  3. Collect sample data and calculate test statistics.
  4. Calculate the p-value or use the critical value to make a decision.
  5. Draw a conclusion: reject or fail to reject the null hypothesis.

Examples of hypothesis testing

Example 1: Tossing a coin

Suppose you have a coin and you want to test whether it is fair or not. In statistics, a fair coin means that whenever you flip it, it has a 50% chance of landing on heads and a 50% chance of landing on tails. Your hypotheses might be:

    H0: p = 0.5 (The coin is fair) 
H1: p ≠ 0.5 (The coin is not fair)

You flip a coin 100 times and get heads 45 times. Your sample proportion of heads is 0.45.

Significance level: Let's use α = 0.05.

Calculate the test statistic:

    Test Statistic (z) = (p̂ - p) / sqrt((p * (1 - p)) / n) 
where p̂ = sample proportion, p = proportion under null hypothesis, n = number of trials 
z = (0.45 - 0.5) / sqrt((0.5 * (0.5)) / 100) 
z ≈ -1.0

Decision: Compare the p-value to your significance level or use z-tables to look up the critical value. Generally, if the p-value is less than 0.05, reject H0.

In this example, the z-score of -1.0 does not fall into the critical region, so you "fail to reject" H0, which indicates that there is not enough evidence to say that the coin is unfair at the 0.05 significance level.

Example 2: Effectiveness of a drug

Suppose a new drug claims to lower blood pressure. The known average blood pressure level is 120 mmHg. You have the following hypotheses:

    H0: μ = 120 (The drug does not affect blood pressure) 
H1: μ ≠ 120 (The drug affects blood pressure)

Sample data: You conduct an experiment with 30 patients and find a mean blood pressure of 115 mmHg with a standard deviation of 10 mmHg.

Significance level: α = 0.05.

Calculate the test statistic:

    Test Statistic (t) = (x̄ - μ) / (s / sqrt(n)) 
where x̄ = sample mean, μ = population mean, s = standard deviation, n = sample size 
t = (115 - 120) / (10 / sqrt(30)) 
t ≈ -2.74

Decision: If the t-score falls in the significant region from the t-table or the p-value is less than 0.05, reject H0.

Here, the t-score of -2.74 is outside the significant range (about ±2.045 for a two-tailed test with df=29), so you reject H0, which indicates that the drug significantly lowers blood pressure at the 0.05 level.

Visualization of hypothesis testing

In hypothesis testing, visualization often involves plotting the distribution of test statistics under the null hypothesis. Typically, bell-shaped (normal) curves depict significance regions.

α/2 α/2 Important Areas ← → Important Areas

The curve above shows the distribution of the test statistic assuming the null hypothesis is true. The shaded regions are the "critical regions", where, if the test statistic falls within these, you reject the null hypothesis, meaning that any result here is statistically significant at the chosen significance level.

Factors affecting hypothesis testing

Several factors can affect the outcome of a hypothesis test:

  • Sample size: Larger sample sizes usually yield more reliable results, as they provide a more accurate estimate of the population parameter.
  • Variability: Data with low variability (low standard deviation) can lead to more conclusive tests.
  • Significance level (α): A low significance level (e.g., 0.01) means you need strong evidence to reject the null hypothesis.
  • Type I and Type II Errors:
    • Type I error (α): rejecting the null hypothesis when it is true.
    • Type II error (β): failing to reject the null hypothesis when the alternative hypothesis is true.

Balancing errors

A common challenge in hypothesis testing is to balance the probability of Type I and Type II errors. Reducing one often increases the other. Careful selection of significance level and sample size can help manage these risks.

The power of the test

The power of a statistical test is the probability that it correctly rejects the null hypothesis when the alternative hypothesis is true. A test with high power is good because it means there is a better chance of detecting an effect if it really exists.

Conclusion

Hypothesis testing is a core component of statistical analysis, which is important in many disciplines such as science, business, engineering, and health sciences. It provides a systematic way to use sample data to make inferences or draw conclusions about a population. It is a balancing of risks, where understanding the underlying principles helps researchers and analysts make informed decisions based on the data.

By understanding the concepts of null and alternative hypotheses, significance levels, test statistics, and understanding probable errors, one can effectively conduct hypothesis testing. Although covered here with relatively simple examples, these same concepts are applicable to more complex analyses and larger datasets, highlighting the important nature of hypothesis testing in statistical methods.


Grade 12 → 3.2.4


U
username
0%
completed in Grade 12


Comments