Kahibaro
Discord Login Register

Hypothesis testing

Understanding Hypothesis Testing

Hypothesis testing is a formal way to use sample data to make decisions or judgments about a population. It turns vague questions like “Did this new teaching method help?” into a clear, step-by-step statistical procedure.

This chapter assumes you already know basic ideas of inferential statistics such as population, sample, and confidence levels.

1. The Basic Idea

Hypothesis testing is about deciding between two competing claims (hypotheses) about a population:

We then use sample data to see which claim is more consistent with what we observed.

The result of a hypothesis test is not “proof,” but a decision:

We never “prove” a hypothesis in an absolute sense; we only see whether the data give us enough reason to doubt the default claim.

2. Null and Alternative Hypotheses

The two competing claims are:

Examples:

  1. Checking a manufacturer’s claim that the mean battery life is 10 hours:
    • $H_0: \mu = 10$ hours (mean life is 10)
    • $H_1: \mu \neq 10$ hours (mean life is not 10)
  2. Testing if a new drug has higher cure rate than the standard 60%:
    • $H_0: p = 0.60$
    • $H_1: p > 0.60$
  3. Checking if a diet reduces mean weight (compared to 80 kg):
    • $H_0: \mu = 80$
    • $H_1: \mu < 80$

The direction of $H_1$ determines the type of test:

You always write $H_0$ as an equality (or including equality, like $\le, \ge$); the strict inequality goes into $H_1$.

3. Test Statistic and Sampling Distribution

To decide between $H_0$ and $H_1$, we transform the sample data into a test statistic.

A test statistic:

The exact formula for the test statistic depends on:

Common examples (you will see specific formulas in other chapters):

The key idea:
If $H_0$ is true, the test statistic behaves like a random draw from a known distribution. We compare the statistic we computed to this distribution to judge how unusual our sample is under $H_0$.

4. Significance Level and Decision Rule

Before looking at the data, we choose a significance level $\alpha$ (alpha). This is a threshold that controls how strong the evidence must be to reject $H_0$.

Typical choices: $\alpha = 0.05$, $0.01$, or $0.10$.

Interpretation of $\alpha$:

Using $\alpha$ and the sampling distribution under $H_0$, we set a rejection region (also called a critical region):

The critical value(s) are the cutoffs separating “not extreme enough” from “extreme enough” given $\alpha$.

Example (conceptual):

5. The $p$-Value

Instead of (or in addition to) using critical values, we can use the $p$-value.

The $p$-value is:

The probability, assuming $H_0$ is true, of obtaining a test statistic at least as extreme as the one we actually observed, in the direction(s) specified by $H_1$.

Key points:

The decision rule using a $p$-value:

Relation to tails:

Interpretation example:

Note: A $p$-value is not the probability that $H_0$ is true. It is a probability about the sample data under the assumption that $H_0$ is true.

6. Types of Errors

Because we base our decision on a sample, mistakes are always possible.

Two kinds of errors can occur:

Let:

Then:

The power of a test is:

$$
\text{Power} = 1 - \beta
$$

Power is the probability that the test correctly rejects $H_0$ when $H_1$ is true. Higher power means we are more likely to detect a real effect.

Trade-off:

Practical choices:

7. Steps of a Hypothesis Test

In practice, a hypothesis test usually follows these steps:

  1. State the hypotheses.
    • Identify the population parameter (mean, proportion, etc.).
    • Write $H_0$ (with equality) and $H_1$ (direction or two-sided).
  2. Choose the significance level $\alpha$.
    • Decide how strong the evidence must be to reject $H_0$.
  3. Select the appropriate test and test statistic.
    • Decide whether to use a $z$-test, $t$-test, or another test, based on:
      • Type of data,
      • Sample size,
      • What is known (e.g., population standard deviation).
  4. Compute the test statistic from the sample data.
  5. Calculate the $p$-value (or compare the statistic to critical values).
  6. Make a decision.
    • If $p \le \alpha$, reject $H_0$.
    • If $p > \alpha$, fail to reject $H_0$.
  7. State the conclusion in context.
    • Relate the statistical decision back to the real-world question in plain language.

Example of a clear conclusion:

or

Notice the language “sufficient evidence” and “do not have sufficient evidence” instead of “prove” or “disprove.”

8. One-Sided vs Two-Sided Tests

The choice between a one-sided and a two-sided test is important and must be made before looking at the data.

Effect on $p$-value:

9. Practical Considerations and Common Misinterpretations

Some important points to keep in mind:

10. Overview of Common Tests (Conceptual)

This chapter focuses on the general framework of hypothesis testing, not on specific formulas. However, it is useful to know some common hypothesis tests that fit into this framework:

Each of these uses the same core structure:

  1. Set $H_0$ and $H_1$.
  2. Choose $\alpha$.
  3. Compute an appropriate test statistic.
  4. Find the $p$-value or compare to critical values.
  5. Make a decision and interpret it.

Later chapters will provide the details, formulas, and conditions for each specific test.

Views: 11

Comments

Please login to add a comment.

Don't have an account? Register now!