1. Home
  2. Explore
  3. Statistics
  4. Hypothesis Testing: Randomization Tests

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Hypothesis Testing: Randomization Tests

Hypothesis Testing: Errors, Significance, Power, and Confidence Intervals

The five-step hypothesis-testing process

A hypothesis test uses sample data to assess a claim about a population parameter. The test begins with a null hypothesis and an alternative hypothesis, then determines whether the observed sample result would be unusual if the null hypothesis were true.

  1. Choose the appropriate test and state the hypotheses.
    Hypotheses are written about population parameters, not sample statistics. The null hypothesis includes equality, such as H0:μ=25H_0:\mu=25H0​:μ=25. The alternative hypothesis describes the evidence or relationship being investigated; it may be one-sided, such as HA:μ<25H_A:\mu<25HA​:μ<25, or two-sided, such as HA:ρ≠0H_A:\rho\ne 0HA​:ρ=0.

  2. Construct a randomization distribution under the null hypothesis.
    The distribution represents the sample statistics that could occur if the null hypothesis were true. It can be generated using resampling software or another appropriate randomization procedure.

  3. Find the ppp-value.
    The ppp-value is the probability, assuming the null hypothesis is true, of obtaining a statistic at least as extreme as the observed statistic in the direction specified by the alternative hypothesis. It is represented by the relevant tail area of the null distribution.

  4. Make a decision by comparing the ppp-value with the significance level.
    The significance level is denoted by α\alphaα.

    • If p≤αp\leq\alphap≤α, reject the null hypothesis.

    • If p>αp>\alphap>α, fail to reject the null hypothesis.

    Failing to reject does not prove that the null hypothesis is true. It means that the sample did not provide sufficient evidence to reject it at the chosen significance level.

  5. State a conclusion in the context of the research question.
    The conclusion should explain what the decision means for the original real-world question, rather than simply repeating “reject” or “fail to reject.”

Unless there is a reason to choose another level, a common default is α=0.05\alpha=0.05α=0.05.


Type I and Type II errors

A hypothesis-test decision can be compared with what is actually true in the population. Since researchers usually have only sample data, the true population condition is generally unknown; the comparison is a conceptual way to describe possible errors.

Possible decisions and outcomes

  • Reject H0H_0H0​ when H0H_0H0​ is false: correct decision.

  • Reject H0H_0H0​ when H0H_0H0​ is true: a Type I error, also called an alpha error.

  • Fail to reject H0H_0H0​ when H0H_0H0​ is true: correct decision.

  • Fail to reject H0H_0H0​ when H0H_0H0​ is false: a Type II error, also called a beta error.

A Type I error is a false positive: the test indicates evidence against the null hypothesis even though the null hypothesis is true. A Type II error is a false negative: the test fails to detect a real difference or relationship.

A Type I error means rejecting a true null hypothesis; a Type II error means failing to reject a false null hypothesis.

Example: Mean number of cookies per pack

Suppose a test asks whether the population mean number of cookies per pack is less than 252525:

H0:μ=25H_0:\mu=25H0​:μ=25
HA:μ<25H_A:\mu<25HA​:μ<25

The test produces p=0.14p=0.14p=0.14. With α=0.05\alpha=0.05α=0.05, the result is greater than the significance level, so the null hypothesis is not rejected. If the actual population mean is μ=24\mu=24μ=24, then the null hypothesis is false. The test failed to reject a false null hypothesis, so this outcome is a Type II error.

Example: Relationship between age and height

Suppose a test assesses whether age and height are correlated in a population:

H0:ρ=0H_0:\rho=0H0​:ρ=0
HA:ρ≠0H_A:\rho\ne 0HA​:ρ=0

The test produces p=0.04p=0.04p=0.04. With α=0.05\alpha=0.05α=0.05, the null hypothesis is rejected. If a census later shows that there is no population relationship, then ρ=0\rho=0ρ=0 and the null hypothesis was actually true. Rejecting it was a Type I error.


Choosing a significance level

The significance level, or alpha level, is the largest ppp-value at which the null hypothesis will be rejected. It sets the threshold for statistical significance and controls the probability of a Type I error when the null hypothesis is true.

Common choices of α\alphaα

  • α=0.05\alpha=0.05α=0.05 is a common default.

  • Larger levels, such as α=0.10\alpha=0.10α=0.10 or α=0.15\alpha=0.15α=0.15, may be used in pilot studies. A pilot study is a small preliminary study intended to inform a later, larger study. Its results are often exploratory and are not usually used alone to make important decisions.

  • Smaller levels, such as α=0.01\alpha=0.01α=0.01 or α=0.001\alpha=0.001α=0.001, may be appropriate when a Type I error would have especially serious consequences, such as incorrectly concluding that an ineffective medical treatment works.

Choosing a smaller α\alphaα makes it harder to reject the null hypothesis because the observed ppp-value must be smaller. This reduces the chance of a Type I error, but also makes it harder for a test to detect a real effect.


Multiple hypothesis tests and publication bias

For a single test with α=0.05\alpha=0.05α=0.05, if the null hypothesis is true, there is a 5%5\%5% chance of obtaining a statistically significant result by chance—that is, making a Type I error. Across many tests, false positives can accumulate.

If 100100100 separate tests are conducted when their null hypotheses are all true, approximately 555 may be statistically significant by chance when each test uses α=0.05\alpha=0.05α=0.05. These significant results do not necessarily indicate real population effects.

When tests are independent and each uses the same significance level, the probability of at least one Type I error across mmm tests is:

1−(1−α)m1-(1-\alpha)^m1−(1−α)m

Thus, conducting more tests increases the overall chance of at least one false positive. The expression assumes independence; the exact overall probability can differ when tests are related.

Publication bias

Publication bias occurs when studies with statistically significant results are more likely to be published than studies without significant results. If chance-significant studies are preferentially published, the published research record can overrepresent false positives and underrepresent studies that found no statistically significant evidence. As a result, a review of published literature may not reflect all the studies that were conducted.

Bonferroni adjustment

One simple way to account for conducting multiple tests on the same data is the Bonferroni method. The method divides the overall significance level by the number of tests:

αtest=αoverallm\alpha_{\text{test}}=\frac{\alpha_{\text{overall}}}{m}αtest​=mαoverall​​

where mmm is the number of tests.

For example, if six tests are conducted with an overall significance level of 0.050.050.05, each test is compared with:

0.056≈0.0083\frac{0.05}{6}\approx 0.008360.05​≈0.0083

A result must have a ppp-value at or below this adjusted level to be considered significant under this correction. The adjustment makes rejection more difficult for each individual test, helping to limit false positives across the collection of tests.


Statistical significance and practical significance

A result is statistically significant when its ppp-value is at or below the chosen α\alphaα level. Statistical significance concerns whether the sample provides evidence for a difference or relationship in the population.

However, statistical significance does not indicate how large or important the observed difference is. With a very large sample, even a small difference may produce a small ppp-value. Therefore, the size and real-world meaning of an effect should also be considered.

Practical significance concerns whether the observed difference is large or meaningful in context. It is often assessed using an effect-size measure.

Common effect-size measures

Cohen’s ddd

For two independent samples, Cohen’s ddd expresses the difference between the sample means in pooled standard-deviation units:

d=xˉ1−xˉ2spooledd=\frac{\bar{x}_1-\bar{x}_2}{s_{\text{pooled}}}d=spooled​xˉ1​−xˉ2​​

The size of ddd indicates how far apart the sample means are relative to the variation within the groups. Common approximate interpretations are:

  • 0≤∣d∣<0.20\leq |d|<0.20≤∣d∣<0.2: little or no effect

  • 0.2≤∣d∣<0.50.2\leq |d|<0.50.2≤∣d∣<0.5: small effect

  • 0.5≤∣d∣<0.80.5\leq |d|<0.80.5≤∣d∣<0.8: medium effect

  • ∣d∣≥0.8|d|\geq 0.8∣d∣≥0.8: large effect

These categories are guidelines, not universal judgments of importance. Whether an effect matters depends on the subject area and the consequences of the difference.

For a one-sample mean test, the difference between the observed sample mean and the hypothesized value can be expressed in standard-deviation units:

xˉ−μ0s\frac{\bar{x}-\mu_0}{s}sxˉ−μ0​​

This standardizes the difference, much as a zzz-score expresses a value relative to a standard deviation.

Relative risk

For two independent groups and a binary outcome, relative risk compares the outcome proportions in the groups:

Relative risk=risk in Group 1risk in Group 2\text{Relative risk}=\frac{\text{risk in Group 1}}{\text{risk in Group 2}}Relative risk=risk in Group 2risk in Group 1​

Here, “risk” is the proportion of individuals in a group who experience the outcome. Relative risk describes the size of the difference or ratio between the group proportions.

Coefficient of determination

For correlation or regression, R2R^2R2, the coefficient of determination, is used to describe how much variation in the outcome is accounted for by the model or relationship. Its interpretation depends on the statistical setting and the variables involved.

Two different questions

  • Statistical significance: Is there evidence of a difference or relationship in the population?

  • Practical significance: How large is the observed difference, and does that size matter in real life?

A complete interpretation considers both the evidence for an effect and its magnitude.


Statistical power

Statistical power is the probability of rejecting the null hypothesis when the null hypothesis is actually false. In that situation, rejection is the correct decision. If the probability of a Type II error is β\betaβ, then power is:

Power=1−β\text{Power}=1-\betaPower=1−β

Power concerns a test’s ability to detect a real population difference or relationship. Several factors affect it.

Factors that influence power

  • Sample size: Increasing the sample size generally decreases the standard error. A smaller standard error makes the sampling distribution more concentrated, which can make a real effect easier to detect and increase power.

  • Effect size: A larger true difference between groups—or between a sample and the hypothesized value in a one-sample test—generally increases power. Larger effects are easier to distinguish from random variation.

  • Significance level: Increasing α\alphaα makes rejection easier and generally increases power. The tradeoff is that a larger α\alphaα also increases the probability of a Type I error.

  • Standard error: A larger standard error generally decreases power because estimates vary more from sample to sample, making a real effect harder to distinguish from chance variation.

Power is therefore affected by choices made in designing a study as well as by the size of the effect and the variability in the data.


Confidence intervals and hypothesis tests

Confidence intervals and hypothesis tests are both inferential procedures. Each uses sample data to learn about a population parameter, and both can be constructed using resampling methods.

Resampling approaches

  • A confidence interval can be constructed with bootstrapping, which resamples the observed data to estimate the sampling distribution of a statistic.

  • A hypothesis test can use randomization procedures, which generate a distribution based on the null hypothesis.

The key difference is the value around which the resampling distribution is constructed:

  • In a randomization test, the distribution is generated under the null hypothesis and is centered on the value specified by that hypothesis.

  • In bootstrapping, the distribution is based on the observed sample data and is centered on the observed sample statistic.

Approximate relationship between a confidence interval and a test

A 95%95\%95% confidence interval is approximately equivalent to a two-sided hypothesis test conducted at α=0.05\alpha=0.05α=0.05. In general, if the null value lies outside the interval, the corresponding two-sided test will reject that null value; if it lies inside, the test will generally fail to reject it.

This relationship is approximate rather than universal. In particular, confidence intervals and tests may not correspond exactly for some procedures, including certain methods for proportions, especially when the proportion is near 000 or 111.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent