# Two-sample hypothesis testing

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Two-sample_hypothesis_testing
> Markdown URL: https://mediated.wiki/source/Two-sample_hypothesis_testing.md
> Source: https://en.wikipedia.org/wiki/Two-sample_hypothesis_testing
> Source revision: 1333880617
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Statistical testing method}}
{{onesource|date=October 2025}}

In [statistical hypothesis testing](/source/statistical_hypothesis_testing), a '''two-sample test''' is a test performed on the data of two [random sample](/source/random_sample)s, each [independent](/source/Paired_data)ly obtained from a different given [population](/source/population_(statistics)). The purpose of the test is to determine whether the difference between these two populations is [statistically significant](/source/statistically_significant).

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 [distribution](/source/distribution_(statistics))s from which the data have been sampled? For example, in many situations it may be assumed that the underlying distributions are [normal distribution](/source/normal_distribution)s. In other cases the data are [categorical](/source/Categorical_data), coming from a [discrete distribution](/source/discrete_distribution) over a [nominal scale](/source/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](/source/population_parameter), for example the [mean](/source/Mean) or the [variance](/source/variance)?
* Is the [hypothesis](/source/Alternative_hypothesis) being tested merely that there is a difference in the relevant population characteristics (in which case a [two-sided test](/source/two-sided_test) may be indicated), or does it involve a specific bias ("A is better than B"), so that a [one-sided test](/source/one-sided_test) can be used?

==Relevant tests==
Statistical tests that may apply for two-sample testing include:
* [Hotelling's T-squared distribution#Two-sample statistic](/source/Hotelling's_T-squared_distribution)
* [Kernel embedding of distributions#Kernel two-sample test](/source/Kernel_embedding_of_distributions)
* [Kolmogorov–Smirnov_test#Two-sample_Kolmogorov–Smirnov_test](/source/Kolmogorov%E2%80%93Smirnov_test)
* [Kuiper's test](/source/Kuiper's_test)
* [Median test](/source/Median_test)
* [Pearson's chi-squared test](/source/Pearson's_chi-squared_test)
* [Student's t-test#Two-sample_t-tests](/source/Student's_t-test)
* [Welch's t-test](/source/Welch's_t-test)
* [Tukey–Duckworth test](/source/Tukey%E2%80%93Duckworth_test)
* [Mann–Whitney U test](/source/Mann%E2%80%93Whitney_U_test)
* [Two-proportion Z-test](/source/Two-proportion_Z-test)
* [Classifier Two-sample test](/source/Classifier_Two-sample_test) (C2ST) <ref>{{cite arXiv | last1=Lopez-Paz | first1=David | last2=Oquab | first2=Maxime | title=Revisiting Classifier Two-Sample Tests | date=2016 | class=stat.ML | eprint=1610.06545 }}</ref>

==See also==
* [A/B testing](/source/A%2FB_testing)

==References==
{{reflist}}

{{statistics-stub}}

Category:Statistical hypothesis testing

---
Adapted from the Wikipedia article [Two-sample hypothesis testing](https://en.wikipedia.org/wiki/Two-sample_hypothesis_testing) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Two-sample_hypothesis_testing?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
