Statistics & Data Analytics

Hypothesis Testing: Null and Alternative Hypotheses, p-values, Errors and Power

Ask precise questions. Weigh the evidence. Draw careful conclusions.

Hypothesis testing is the logic behind most statistical results you will read or report. This guide explains what a test actually tells you, how to read a p-value correctly, and why effect sizes and confidence intervals matter just as much.

  • Undergraduate · Masters · PhD
  • 6 min read
  • Practice questions
  • 2 learning resources

What is hypothesis testing?

Hypothesis testing is a formal procedure for judging whether sample data provide enough evidence against a stated claim about a population. It underpins t-tests, ANOVA, chi-square tests, correlation tests and regression coefficients.

  • Null hypothesis (H₀): usually "no effect" or "no difference" (for example, mean scores are equal in two groups).
  • Alternative hypothesis (H₁): what you would conclude if the evidence is strong enough (the means differ; or, for a one-tailed test, group A is higher).
  • Significance level (α): the false-positive rate you are willing to accept, conventionally 0.05, chosen before seeing the data.

Watch the topic explained

Video lesson · about 10 minutes · in production

Hypothesis Testing Explained

An original lesson that teaches hypothesis testing with diagrams and a worked example, with captions and a transcript. These are the chapters it will cover; each links to the matching part of this guide.

  1. 01Null and alternative hypotheses
  2. 02Test statistics and sampling distributions
  3. 03What a p-value means
  4. 04Type I and Type II errors
  5. 05Power, effect sizes and confidence intervals
Get notified on YouTube

The logic, step by step

  1. State H₀ and H₁ in terms of population parameters.
  2. Choose α and whether the test is one- or two-tailed, with justification.
  3. Choose the test that suits your question, data type and design (see the test selector).
  4. Check assumptions (for example independence, approximate normality, equal variances).
  5. Calculate the test statistic (t, z, F, χ²), which measures how far the data are from H₀ relative to sampling variability.
  6. Find the p-value from the statistic’s sampling distribution.
  7. Decide: if p ≤ α, reject H₀; otherwise, do not reject H₀ (which is not the same as proving it).
  8. Interpret with the effect size, confidence interval and context.

Decision errors and power

H₀ is actually true H₀ is actually false
Reject H₀ Type I error (probability α) Correct: detected a real effect (power, 1 − β)
Do not reject H₀ Correct Type II error (probability β)

Power increases with a larger sample size, a larger true effect, less variability and a higher α. Studies often aim for 80% power. For two independent groups, detecting a medium effect (d = 0.5) with α = 0.05 and 80% power needs about 64 participants per group. Explore this with the error and power simulator.

p-values: what they do and do not mean

  • A small p-value means the observed data would be unusual if H₀ were true.
  • It does not give the probability that H₀ is true, the probability your result is a fluke, or the size or importance of an effect.
  • p = 0.049 and p = 0.051 are practically the same evidence; avoid treating 0.05 as a cliff edge.
  • With very large samples, trivially small effects can be "significant"; with small samples, important effects can be missed.

Confidence intervals and effect sizes

A 95% confidence interval gives a range of plausible values for the population parameter; if it excludes the null value (for example 0 for a difference), the two-sided test at α = 0.05 is significant. Effect sizes such as Cohen’s d, r, η² or odds ratios express magnitude on an interpretable scale.

Worked example: an independent-samples t-test

Fictional data. A researcher compares exam scores between students who attended revision workshops (n = 40, M = 72.4, SD = 9.8) and those who did not (n = 42, M = 67.1, SD = 10.6).

  • H₀: μ₁ = μ₂. H₁: μ₁ ≠ μ₂. α = 0.05, two-tailed.
  • Pooled SD ≈ 10.22; standard error of the difference ≈ 2.26.
  • t(80) = 2.35, p = .021.
  • Mean difference = 5.3 points, 95% CI 0.8 to 9.8.
  • Cohen’s d ≈ 0.52 (a medium effect by common conventions).

Interpretation: attenders scored on average about 5 points higher, a difference unlikely under H₀. The interval is wide (0.8 to 9.8), so the true difference could be small or fairly large. Students chose whether to attend, so motivation might explain part of the difference; the study shows association, not that workshops caused higher scores.

Common mistakes

  • "p > 0.05, so there is no effect." You failed to find evidence, which may reflect low power.
  • Choosing a one-tailed test after seeing the data.
  • Running many tests without adjusting for multiple comparisons (for example Bonferroni or false discovery rate).
  • Ignoring assumptions or using independent tests on paired data.
  • Equating statistical and practical significance.
  • p-hacking: trying analyses until something is significant. Pre-specify your analysis.

Explore learning resources

Worked examples, worksheets and checklists to use alongside this guide. They are learning tools, not answers to an assessment: adapt them to your own task and your institution’s requirements.

TemplateHypothesis statement builderWrite hypotheses that match your test.
Element Example Yours
Population First-year students at one university
Parameter Mean exam score
H₀ μ(workshop) = μ(no workshop)
H₁ (two-tailed) μ(workshop) ≠ μ(no workshop)
α and tails 0.05, two-tailed
Test Independent-samples t-test
Effect size to report Cohen’s d with 95% CI
GuideReporting results in APA styleModel sentences.
  • "Workshop attenders (M = 72.4, SD = 9.8) scored higher than non-attenders (M = 67.1, SD = 10.6), t(80) = 2.35, p = .021, d = 0.52, 95% CI [0.8, 9.8]."
  • "There was no statistically significant difference, t(58) = 1.12, p = .27, d = 0.29, 95% CI [−2.1, 7.4]; the study may have been underpowered to detect small effects."

Try the interactive tools

Free tools that let you practise hypothesis testing hands-on. They run in your browser, explain every result and keep what you type private.

See all learning tools

Check your understanding

4 short questions. Choose an answer for each, then check. Every answer comes with an explanation.

1. p = .03 means…
Show the answer

Answer: If H₀ were true, data this extreme would occur about 3% of the time. The p-value is computed assuming H₀ is true.

2. A Type I error is…
Show the answer

Answer: Rejecting a true null hypothesis. A Type I error is a false positive.

3. Which change increases power?
Show the answer

Answer: Larger sample. Larger samples reduce standard error and increase power.

4. The 95% CI for a mean difference is −1.2 to 6.0. At α = .05 (two-tailed), the difference is…
Show the answer

Answer: Not significant, because the interval includes 0. An interval containing the null value corresponds to a non-significant two-sided test.

A learning activity to check your own understanding. It is not an assessment and nothing is recorded.

Take your learning further

Learn hypothesis testing with a specialist Academic Expert

Sometimes a concept needs more than a written explanation. A live 1:1 session with an Academic Expert who works in hypothesis testing lets you ask your own questions, work through examples at your pace and get feedback on your own thinking.

What you can work on together

  • Write hypotheses that match your research question
  • Choose the right test and check assumptions
  • Interpret p-values, confidence intervals and effect sizes
  • Plan sample size with a power analysis
  • Report results accurately in APA style
  • Get feedback on your own results chapter

How sessions help

  • Make sense of your brief and marking criteria, so you know exactly what is being asked.
  • Ask the questions you would not ask in a big class, as often as you need.
  • Get timely, specific feedback on work you have written yourself.
  • Practise explaining your reasoning out loud, ready for vivas, presentations and practicals.
  • Extra support with academic English and conventions if English is not your first language.

Teach → coach → review. Experts explain, demonstrate and give feedback. You stay the author of your work and make the decisions in it.

Frequently asked questions

Should I use a one-tailed or two-tailed test?

Use a two-tailed test unless you had a strong, pre-registered reason to test only one direction. Deciding after seeing data is not appropriate.

What if my results are not significant?

Report them honestly with effect sizes and intervals, discuss power and what the interval tells you about plausible effect sizes.

Do qualitative studies use hypothesis testing?

Generally no. Qualitative research is guided by open research questions rather than statistical hypotheses.

Our academic integrity commitment

UniLearno supports learning, understanding and independent academic development. Our Academic Experts explain concepts, demonstrate methods, guide research and give feedback on work you have created. We do not complete assessed work, fabricate data or references, or produce anything for you to submit. You remain responsible for your own ideas, analysis, conclusions and final submission, and for following your institution’s academic integrity and AI-use rules.

Why a shortcut costs more than it saves
  • It is more visible than it looks. Markers notice when work does not match what they know of you; document history, reference lists and follow-up conversations about your work are all used to check authorship.
  • It creates a lasting risk. Services that sell completed assignments have threatened students afterwards, demanding money not to tell their university.
  • The gap does not go away. Later units, supervised exams, vivas, placements and the job itself all assume you have the skill.
  • Help that teaches is the safer route. Understanding the brief, getting feedback early and practising with an expert closes the gap for good.

Read our full integrity and responsible AI approach →

Sources and about this guide

  1. Wasserstein, R. L., & Lazar, N. A. (2016). The ASA statement on p-values. The American Statistician, 70(2), 129–133.
  2. Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Erlbaum.
  3. Cumming, G. (2014). The new statistics: Why and how. Psychological Science, 25(1), 7–29.
Written by
UniLearno Learning Team
Last reviewed
Found an error?
Tell us and we will check and correct it.

What do you want to develop next?

  1. Tell us what you're working on.
  2. Find the right expertise.
  3. Start learning.
Find my academic expert