ArticleslgStudy

mathematics

Two-sample hypothesis testing

Two-sample hypothesis testing is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Two-sample hypothesis testing rather than just read about it. In short: In statistical hypothesis testing, a two-sample test is a test performed on the data of two random samples, each independently obtained from a different given population. The purpose of the test is to determine whether the difference between these two populations is statistically significant.

Key takeaways

  • Two-sample hypothesis testing belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Two-sample hypothesis testing to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Two-sample hypothesis testing from memory before moving on to harder problems.

Reference excerpt

In statistical hypothesis testing, a two-sample test is a test performed on the data of two random samples, each independently obtained from a different given population. The purpose of the test is to determine whether the difference between these two populations is statistically significant. When the only knowledge of the two populations is given through the samples, two-sample hypothesis testing becomes an instance of universal hypothesis testing. There are a large number of statistical tests that can be used in a two-sample test. Which one(s) are appropriate depend on a variety of factors, such as:

Which assumptions (if any) may be made a priori about the distributions from which the data have been sampled? For example, in many situations it may be assumed that the underlying distributions are normal distributions. In other cases the data are categorical, coming from a discrete distribution over a nominal scale, such as which entry was selected from a menu. Does the hypothesis being tested apply to the distributions as a whole, or just some population parameter, for example the mean or the variance? Is the hypothesis being tested merely that there is a difference in the relevant population characteristics (in which case a two-sided test may be indicated), or does it involve a specific bias ("A is better than B"), so that a one-sided test can be used? Two-sample testing does not mean that only two random variables can be used for inference (as is sometimes incorrectly assumed). Instead, it gets its name because the problem involves data from two populations, distinct from one-sample hypothesis testing in which samples from a single population are used to make a decision.

Relevant tests Statistical tests that may apply for two-sample testing include:

Hotelling's T-squared distribution#Two-sample statistic Kernel embedding of distributions#Kernel two-sample test Kolmogorov–Smirnov_test#Two-sample_Kolmogorov–Smirnov_test Kuiper's test Median test Pearson's chi-squared test Student's t-test#Two-sample_t-tests Welch's t-test Tukey–Duckworth test Mann–Whitney U test Two-proportion Z-test Classifier Two-sample test (C2ST) Plug in statistics using empirical measures (usually for discrete distributions)

Mathematical Definition Given samples Xn=(X1,…,Xn) taken independently and identically distributed (iid) from a population P, and Ym=(Y1,…,Ym) taken iid from a population Q, the goal of a two sample test is to determine which of the two hypothesis are correct:H0:P=QH1:P≠QIn many instances of two-sample hypothesis testing, the only information that we have about the populations comes from the samples, meaning that any test needs to be non-parametric.

Optimal Error Exponent When considering tests with fixed (or vanishing) false positive rate, the best achievable exponent for the false negative rate is the log of the Bhattacharya distance or equivalently with the Renyi divergence. The first test known to achieve this optimal error exponent was based on maximum mean discrepancy.

See also A/B testing Universal hypothesis testing

References

Worked examples

Example 1 — a first encounter with Two-sample hypothesis testing

Start with the simplest possible case. Write down what Two-sample hypothesis testing claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Two-sample hypothesis testing before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Two-sample hypothesis testing ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Two-sample hypothesis testing

In research
Two-sample hypothesis testing appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Two-sample hypothesis testing in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Two-sample hypothesis testing is common in secondary-school and first-year university syllabi. It links to neighbouring topics Statistical hypothesis testing, Statistics stubs, so understanding it makes those chapters shorter.
In everyday life
Look for Two-sample hypothesis testing outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Two-sample hypothesis testing” →

How to study Two-sample hypothesis testing in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Two-sample hypothesis testing means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Two-sample hypothesis testing out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Two-sample hypothesis testing in simple terms?

In statistical hypothesis testing, a two-sample test is a test performed on the data of two random samples, each independently obtained from a different given population. The purpose of the test is to determine whether the difference between these two populations is statistically significant.

Why does Two-sample hypothesis testing matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Two-sample hypothesis testing?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Two-sample hypothesis testing.

Tags

  • Statistical hypothesis testing
  • Statistics stubs

Keep exploring