# 皮尔逊卡方检验

**皮尔逊卡方检验**是一种针对分类数据的显著性检验，其统计量 \( \chi^{2} = \sum_{i=1}^{k} (O_{i}-E_{i})^{2}/E_{i} \)，即各单元格观测计数减期望计数之差的平方除以期望计数后求和，通过与卡方分布比较来判断观测计数是否与某一原假设相容。它主要有三种使用形式：作为单个名义变量对理论分布的拟合优度检验，作为二维列联表中的独立性检验，以及作为各总体间比例齐性的检验。卡尔·皮尔逊（Karl Pearson）于1900年提出该检验，1984年一家科普杂志的编辑将其选为二十世纪改变我们生活的二十项发现之一。<sup>[1](https://itl.nist.gov/div898/handbook/eda/section3/eda35f.htm)</sup><sup> • </sup><sup>[2](http://groupelavigne.free.fr/stigler08.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 统计量 | \( \chi^{2} = \sum (O_{i}-E_{i})^{2}/E_{i} \)，其中 \( E_{i} = N \) 乘以第 \( i \) 个分箱的模型概率<sup>[1](https://itl.nist.gov/div898/handbook/eda/section3/eda35f.htm)</sup> |
| 自由度 | 对 \( k \) 个单元格完全指定的原假设为 \( k-1 \)；当用有效最大似然估计 \( p \) 个参数时为 \( k-1-p \)；对 \( r \times c \) 独立性表为 \( (r-1)(c-1) \)<sup>[3](https://www.stat.umn.edu/geyer/5421/notes/multi-simple.pdf)</sup><sup> • </sup><sup>[4](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.mstats.chisquare.html)</sup><sup> • </sup><sup>[5](https://www.afs.enea.it/software/imsl/help/stat/docs/ctchi.htm)</sup>  |
| 经典单元格计数规则 | 所有期望频数至少为5；科克伦（Cochran）1954年的规则允许在少数单元格低于5时最低为1，模拟研究表明名义0.05水平在最小期望值接近1时通常能够达到<sup>[6](https://www.tandfonline.com/doi/full/10.1080/00031305.2017.1286260)</sup> |
| 小样本替代方案 | 期望计数较小时使用费希尔精确检验（Fisher's exact test）；坎贝尔（Campbell）2007年的研究发现，当最小期望计数至少为1时，N−1校正卡方检验可将第一类错误率控制在 \( \alpha \) 附近，而最小期望计数低于1时费希尔精确检验表现最佳<sup>[8](https://onlinelibrary.wiley.com/doi/10.1002/sim.2832)</sup> |
| 最接近的亲属 | 似然比统计量 \( G^{2} \) 与 \( \chi^{2} \) 渐近等价，并以相同自由度检验同一假设<sup>[5](https://www.afs.enea.it/software/imsl/help/stat/docs/ctchi.htm)</sup> |
| 软件默认设置 | R的chisq.test仅对2×2表应用耶茨校正，并为二维列联表提供B = 2000次重复的蒙特卡洛p值；SciPy的chi2_contingency现在接受置换法和蒙特卡洛方法<sup>[9](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/chisq.test.html)</sup><sup> • </sup><sup>[10](https://github.com/scipy/scipy/pull/20989)</sup>  |

## 历史渊源：皮尔逊1900年与费希尔的校正

皮尔逊1900年的论文《论给定偏差系统……的判据》旨在研究“关于观测误差系统的任一理论下概率的判据”，并首先将其应用于理论概率先验已知的情形。<sup>[11](https://jhanley.biostat.mcgill.ca/bios601/Proportion/Pearson1900.pdf)</sup>他通过一个关于 \( n \) 个变量、服从正态分布且具有散布矩阵 \( V \) 的偏差的预备命题，将卡方定义为二次型 \( x'V^{-1}x \)。普拉克特（Plackett）的综述记录了该论文的缺陷，包括省略的理论细节和关于估计效应的错误，但也记录了其影响范围：它开创了拟合优度、列联表和关联度量等至今仍然活跃的研究方向，并被称为二十世纪统计学的伟大丰碑之一。<sup>[12](https://www.floppybunny.org/robin/web/virtualclassroom/stats/basics/articles/chi_square/chi_square_review_plackett_1983.pdf)</sup>

**费希尔的校正。** 皮尔逊错误地声称，在原假设下估计参数时无需对自由度进行校正。这一错误直到1915年才被格林伍德（Greenwood）和尤尔（Yule）察觉，罗纳德·费希尔（Ronald Fisher）于1922年和1924年给出了最终修正。<sup>[2](http://groupelavigne.free.fr/stigler08.pdf)</sup>费希尔1922年的论文表明，当卡方检验应用于列联表时，由于偏差的行和与列和必然为零，必须取“不是单元格数，而是自由度数目加一”。<sup>[13](https://jhanley.biostat.mcgill.ca/bios601/Proportion/FisherChiSqDegreesFreedom1922.pdf)</sup>正是在1922年关于 \( r \times c \) 列联表情形的这篇评论中，费希尔引入了“自由度”一词。皮尔逊立即在《生物计量学》（*Biometrika*）上予以反驳，错误地认为费希尔混淆了不同的抽样模型；1924年费希尔证明两个卡方统计量之差渐近服从标准正态变量平方的分布，从而解决了这一问题。<sup>[2](http://groupelavigne.free.fr/stigler08.pdf)</sup>2025年的一篇回顾性文章将该检验追溯至皮尔逊十九世纪末和二十世纪初的论文，并指出皮尔逊曾提出但未证明该统计量服从卡方分布。<sup>[14](https://arxiv.org/html/2505.06318)</sup>

## 检验统计量及其分布

每个单元格贡献 \( (O_{i}-E_{i})^{2}/E_{i} \)，即按该单元格预期变异程度缩放的平方偏差；除以 \( E_{i} \) 将期望计数不同的单元格置于共同尺度上，因此给定的绝对差异在预期观测较少处权重更大。对于拟合优度检验，期望计数为 \( E_{i} = N \) 乘以第 \( i \) 个分箱的模型概率。<sup>[1](https://itl.nist.gov/div898/handbook/eda/section3/eda35f.htm)</sup>

**为什么是卡方。** 皮尔逊统计量是拉奥检验统计量（Rao test statistic，也称得分检验或拉格朗日乘子检验）的特例，一般渐近理论表明，此类统计量在原假设下渐近服从卡方分布，其自由度等于所比较模型之间的维数差。<sup>[3](https://www.stat.umn.edu/geyer/5421/notes/multi-simple.pdf)</sup>直接推导给出相同结果：在简单原假设下，当 \( n \to \infty \) 时，\( Q_{k,n} = \sum_{i} (N_{i} - n p_{0,i})^{2} / (n p_{0,i}) \) 依分布收敛于自由度为 \( k-1 \) 的卡方随机变量。<sup>[15](https://m-hikari.com/ams/ams-2014/ams-133-136-2014/buonocoreAMS133-136-2014.pdf)</sup>损失的自由度来自多项分布的约束——各单元格计数之和等于固定总数；对计数的进一步线性约束会再移除自由度。<sup>[16](http://www.stat.yale.edu/~pollard/Courses/610.fall2001/notes/categorical.pdf)</sup>

**实践中的自由度。** 对于 \( r \times c \) 独立性表，统计量具有 \( (r-1)(c-1) \) 个自由度。<sup>[5](https://www.afs.enea.it/software/imsl/help/stat/docs/ctchi.htm)</sup>当用有效最大似然估计 \( p \) 个参数时，正确自由度为 \( k-1-p \)；若以不同方式估计参数，自由度可能介于 \( k-1-p \) 与 \( k-1 \) 之间。<sup>[4](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.mstats.chisquare.html)</sup>每个估计参数消耗一个自由度，而R的chisq.test无法被告知此类估计，因此用户必须手动调整。<sup>[3](https://www.stat.umn.edu/geyer/5421/notes/multi-simple.pdf)</sup>

**近似失效的情形。** 当 \( n \) 增长而单元格数 \( k \) 保持固定时，卡方极限成立。当 \( k \) 随 \( n \) 增长、甚至可能超过 \( n \) 时，该统计量在一般条件下反而收敛于正态分布。<sup>[17](https://pmc.ncbi.nlm.nih.gov/articles/PMC10062227/)</sup>分类数据分析中使用的某些卡方统计量，特别是在整群抽样下或大型稀疏多项分布情形中，根本不具有渐近卡方分布。<sup>[18](https://conservancy.umn.edu/bitstreams/af78634d-d594-4b4b-8a42-9773dc7c8c1a/download)</sup>

## 变体：拟合优度、独立性、齐性

拟合优度形式适用于取两个或更多值的单个名义变量，检验每个类别中的观测数是否符合理论期望，如1:1的性别比或遗传杂交中1:2:1的分离比；若任一期望计数过小，则应改用精确检验。<sup>[19](http://biostathandbook.com/chigof.html)</sup>用软件术语来说，原假设是总体概率等于指定向量 \( p \) 中的值，或在未给出 \( p \) 时所有概率相等。<sup>[9](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/chisq.test.html)</sup>

独立性和齐性两种形式都作用于二维表。对于二维表，多项分布抽样下的独立性检验与乘积多项分布抽样下的比例齐性检验给出相同的最大似然期望计数、相同的皮尔逊统计量和相同的自由度，因此抽样方案不改变计算；不同之处在于对原假设的解释。<sup>[3](https://www.stat.umn.edu/geyer/5421/notes/multi-simple.pdf)</sup>两种情况下统计量均为单元格贡献之和 \( (x_{ij} - e_{ij})^{2}/e_{ij} \)，自由度为 \( (r-1)(c-1) \)，检验 \( H_{0} \colon p_{ij} = p_{i\cdot}\, p_{\cdot j} \)。<sup>[5](https://www.afs.enea.it/software/imsl/help/stat/docs/ctchi.htm)</sup>

## 用数字说话：期望计数、样本量与近似精度

每个期望频数至少为5这一常见规则可追溯至科克伦，他承认数字5是任意选定的。<sup>[8](https://onlinelibrary.wiley.com/doi/10.1002/sim.2832)</sup>科克伦1954年的指南已经相对宽松：当只有少数期望值低于5时——例如5个或更多单元格中有1个，或10个或更多中有2个——计算 \( X^{2} \) 时可容忍低至1的期望值。<sup>[6](https://www.tandfonline.com/doi/full/10.1080/00031305.2017.1286260)</sup>奥多罗夫（Odoroff，1970）、亚诺尔德（Yarnold，1970）和拉尔尼茨（Larntz，1978）的蒙特卡洛研究发现，在名义0.05显著性水平下，当最小期望单元格值约为1.0时，拟合优度统计量通常能达到所需水平，因此经典规则偏保守。<sup>[7](http://hdl.handle.net/11299/199311)</sup>CRAN的chisquare包引用文献指出，所有单元格的平均期望频数至少为5应足以在0.05水平上保证可靠性。<sup>[20](https://cran.r-project.org/web/packages/chisquare/refman/chisquare.html)</sup>

**样本量。** SciPy的文档报告了一项建议：观测总数应超过13；低于此值时，应使用巴纳德精确检验（Barnard's exact test）等精确检验，因为它们不会过度拒绝。<sup>[4](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.mstats.chisquare.html)</sup>对于2×2表，科克伦建议若总数 \( N < 20 \)，或 \( 20 < N < 40 \) 且最小期望值低于5，则使用费希尔精确检验；若 \( N > 40 \)，则使用连续性校正的 \( X^{2} \)。<sup>[6](https://www.tandfonline.com/doi/full/10.1080/00031305.2017.1286260)</sup>

**稀疏表。** 当 \( k \) 相对于 \( n \) 过大导致期望频数过小时，正如哈伯曼（Haberman）所指出的，皮尔逊检验可能有偏；所提出的替代方法在模拟中功效更高且无偏，小样本可使用置换或自助法。科勒（Koehler）和拉尔尼茨在 \( n^{2}/k \) 相当大时为正态近似的精度提供了经验证据。<sup>[17](https://pmc.ncbi.nlm.nih.gov/articles/PMC10062227/)</sup>在极小样本量下，离散性也很重要：在每行每列仅有4个观测的表中，唯一可能的卡方值为8、2和0。<sup>[21](https://www.uvm.edu/~statdhtx/methods8/Supplements/Chi-Square-Folder/ChiSquareTests.pdf)</sup>对于小期望频数，科克伦（1954）引入了使用哈尔丹（Haldane，1940）精确均值和方差的正态近似，纳斯（Nass，1959）和拉瓦尔与厄普顿（Lawal and Upton，1984）研究了伽马和对数正态近似。<sup>[22](https://arxiv.org/html/2409.14255)</sup>

## 与其他检验的比较

似然比统计量 \( G^{2} \) 以相同自由度检验相同的独立性假设，并与 \( \chi^{2} \) 渐近等价；一篇临床统计学综述在比较分类变量的备选方法中列出了G检验和古德曼检验（Goodman test）用于比例间的对比，同时指出它们之间的绝对优劣尚未被系统定义。<sup>[5](https://www.afs.enea.it/software/imsl/help/stat/docs/ctchi.htm)</sup><sup> • </sup><sup>[23](https://pmc.ncbi.nlm.nih.gov/articles/PMC8992732/)</sup>

**精确检验与中p检验。** 2003年一项关于2×2表中精确皮尔逊卡方检验、似然比检验和费希尔检验的功效比较发现，中p版本和随机化版本比标准版本具有更高功效，其第一类错误概率很少超过名义水平，且皮尔逊卡方检验和费希尔检验的功效往往几乎相等，在许多情况下都高于似然比检验。<sup>[24](https://onlinelibrary.wiley.com/doi/10.1002/sim.1671)</sup>坎贝尔2007年针对2×2表的大型抽样研究发现，在所有抽样设计下，卡尔·皮尔逊之子埃贡·皮尔逊（Egon Pearson）提出的一个统计量在大多数情况下表现最佳。<sup>[25](https://www.uvm.edu/~statdhtx/StatPages/R/Chi-Square-Folder/Chi%20square%20test%20analysis%20of%20contingency%20tables_David_Howell%20.pdf)</sup>一项对七种双侧检验的计算机密集型比较得出结论：最优策略是“N−1”卡方检验（即埃贡·皮尔逊的校正），当最小期望数至少为1时使用；否则按欧文规则（Irwin's rule）使用费希尔–欧文检验（Fisher–Irwin test）；与科克伦的建议相比，该策略提高了功效。<sup>[8](https://onlinelibrary.wiley.com/doi/10.1002/sim.2832)</sup>当前教科书建议：只要期望单元格频数至少为5，就继续使用标准皮尔逊卡方检验；期望频数较小时使用费希尔精确检验，因为无论抽样方案如何，它都表现良好。<sup>[21](https://www.uvm.edu/~statdhtx/methods8/Supplements/Chi-Square-Folder/ChiSquareTests.pdf)</sup>

## 常见误用与局限

**违反期望计数条件。** 当科克伦条件不满足时，补救方法是合并期望频数较小的行或列，或使用费希尔精确检验。<sup>[26](https://www.itl.nist.gov/div898/software/dataplot/refman1/auxillar/chistest.htm)</sup>

**耶茨校正。** 一些作者建议使用连续性校正，即将每个观测减期望的绝对差减少0.5，校正后的差值不低于零，而软件做法不同：R对2×2表默认应用耶茨校正（correct=TRUE为默认值），而SciPy在自由度为1且correction=True时应用。<sup>[26](https://www.itl.nist.gov/div898/software/dataplot/refman1/auxillar/chistest.htm)</sup><sup> • </sup><sup>[9](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/chisq.test.html)</sup><sup> • </sup><sup>[27](https://scipy.github.io/devdocs/reference/generated/scipy.stats.chi2_contingency.html)</sup><sup> • </sup><sup>[32](https://library.virginia.edu/data/articles/continuity-corrections-imperfect-responses-to-slight-problems)</sup><sup> • </sup><sup>[33](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.contingency.chi2_contingency.html)</sup> 对此，《美国统计学家》（*The American Statistician*）对科克伦规则的综述称，对于边际固定的2×2表，耶茨校正过于保守；而SciPy问题跟踪器中引用的一篇《医学统计学》（*Statistics in Medicine*）论文认为不应再使用该校正，因为它假设所有边际和都是固定的。<sup>[6](https://www.tandfonline.com/doi/full/10.1080/00031305.2017.1286260)</sup><sup> • </sup><sup>[28](https://github.com/scipy/scipy/issues/13875)</sup>

**两阶段残差检验。** 仅在整体 \( X^{2} \) 检验显著后才对残差进行显著性检验的做法不可取；一种替代的单阶段检验可保持第一类错误率。<sup>[29](https://journals.sagepub.com/doi/10.1177/0962280220902480)</sup>

**调查加权。** 对于复杂调查数据，将普通检验应用于未加权计数是核心陷阱。2025年《美国统计学家》对调查卡方检验的比较直接针对这一情形，跨软件比较了沃尔德（Wald）、拉奥-斯科特（Rao-Scott）、拉奥-斯科特似然比和对数线性沃尔德检验类型。<sup>[30](https://ideas.repec.org/a/taf/amstat/v79y2025i4p480-491.html)</sup>

## 软件实现

R的chisq.test默认从卡方分布计算渐近p值，仅在2×2情形下应用耶茨连续性校正（correct=TRUE为默认值），对于二维列联表，可改用B次重复计算蒙特卡洛p值；默认B = 2000意味着最小p值约为0.0005，即 \( 1/(B+1) \)。<sup>[9](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/chisq.test.html)</sup>SciPy的chi2_contingency默认计算皮尔逊统计量，通过lambda_参数提供Cressie-Read幂散度替代方案，并在自由度为1且correction=True时应用耶茨校正，将每个观测值向相应期望值调整0.5。<sup>[27](https://scipy.github.io/devdocs/reference/generated/scipy.stats.chi2_contingency.html)</sup>CRAN的chisquare包实现了传统卡方检验、\( (N-1)/N \) 校正卡方检验和G检验，计算回顾性功效、关联度量、残差，并使用皮普森和史密斯（Phipson and Smyth，2010）的精确p值计算提供置换或蒙特卡洛p值，确保p值永不为零且第一类错误率得到正确控制。其决策逻辑建议：当总计至少为单元格数的5倍时，对2×2表使用传统卡方检验；当最小期望计数至少为1时，使用 \( (N-1)/N \) 校正检验；否则使用置换或蒙特卡洛方法。<sup>[20](https://cran.r-project.org/web/packages/chisquare/refman/chisquare.html)</sup>

## 近期进展

**SciPy的method参数。** SciPy为chi2_contingency添加了method参数，使 \( R \times C \) 列联表能够使用置换和蒙特卡洛p值，解决了小表渐近p值不准确的问题，并为fisher_exact支持 \( R \times C \) 铺平了道路。<sup>[10](https://github.com/scipy/scipy/pull/20989)</sup>当前SciPy文档指出，常被引用的指南是每个单元格的观测频数和期望频数应至少为5，并建议当二维表总数较小时传入PermutationMethod或MonteCarloMethod并设置correction=False。<sup>[27](https://scipy.github.io/devdocs/reference/generated/scipy.stats.chi2_contingency.html)</sup>

**向精确检验的转变。** 2025年发表的一篇文章认为，由于卡方检验对任何样本量都可轻松作为精确检验执行，因此无论获得的数据如何，都应常规使用精确检验，这种方法允许预先指定特定检验。<sup>[31](https://pubmed.ncbi.nlm.nih.gov/40156377/)</sup>这与较早的、基于模拟的指导方针并存，后者在最小期望计数至少为1时倾向于N−1校正卡方检验。<sup>[8](https://onlinelibrary.wiley.com/doi/10.1002/sim.2832)</sup>

**调查表。** 2025年《美国统计学家》的比较发现，不同软件包中同一类型的调查卡方检验产生相似结果，而不同类型的卡方检验可能产生差异，这为应用分析人员在SAS、R、Python和SUDAAN中选择沃尔德、拉奥-斯科特和对数线性变体提供了具体依据。<sup>[30](https://ideas.repec.org/a/taf/amstat/v79y2025i4p480-491.html)</sup>

## References

1. [NIST/SEMATECH e-Handbook 1.3.5.15 Chi-Square Goodness-of-Fit Test](https://itl.nist.gov/div898/handbook/eda/section3/eda35f.htm)
2. [Stigler, "Karl Pearson's Theoretical Errors and the Advances They Inspired"](http://groupelavigne.free.fr/stigler08.pdf)
3. [Geyer, Stat 5421 Lecture Notes: Simple Chi-Square Tests for Contingency Tables, University of Minnesota](https://www.stat.umn.edu/geyer/5421/notes/multi-simple.pdf)
4. [SciPy Manual: scipy.stats.mstats.chisquare](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.mstats.chisquare.html)
5. [IMSL CTCHI documentation](https://www.afs.enea.it/software/imsl/help/stat/docs/ctchi.htm)
6. [The Tale of Cochran's Rule, The American Statistician](https://www.tandfonline.com/doi/full/10.1080/00031305.2017.1286260)
7. [Read & Cushing, The Use of Chi-Square Statistics for Categorical Data Problems](http://hdl.handle.net/11299/199311)
8. [Chi-squared and Fisher–Irwin tests of two-by-two tables with small sample recommendations, Statistics in Medicine](https://onlinelibrary.wiley.com/doi/10.1002/sim.2832)
9. [R: Pearson's Chi-squared Test for Count Data (chisq.test)](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/chisq.test.html)
10. [SciPy PR #20989: stats.chi2_contingency: add method parameter](https://github.com/scipy/scipy/pull/20989)
11. [Karl Pearson (1900), "On the criterion that a given system of deviations..."](https://jhanley.biostat.mcgill.ca/bios601/Proportion/Pearson1900.pdf)
12. [Plackett, "Karl Pearson and the Chi-Squared Test" (1983)](https://www.floppybunny.org/robin/web/virtualclassroom/stats/basics/articles/chi_square/chi_square_review_plackett_1983.pdf)
13. [Fisher (1922), "On the Interpretation of χ² from Contingency Tables, and the Calculation of P"](https://jhanley.biostat.mcgill.ca/bios601/Proportion/FisherChiSqDegreesFreedom1922.pdf)
14. [Critical issues with the Pearson's chi-square test (arXiv, 2025)](https://arxiv.org/html/2505.06318)
15. [Buonocore et al. (2014), Applied Mathematical Sciences](https://m-hikari.com/ams/ams-2014/ams-133-136-2014/buonocoreAMS133-136-2014.pdf)
16. [Categorical data notes, Pollard, Yale Stat 610](http://www.stat.yale.edu/~pollard/Courses/610.fall2001/notes/categorical.pdf)
17. [Pearson's goodness-of-fit tests for sparse distributions (PMC)](https://pmc.ncbi.nlm.nih.gov/articles/PMC10062227/)
18. [University of Minnesota technical report on chi-square statistics for categorical data](https://conservancy.umn.edu/bitstreams/af78634d-d594-4b4b-8a42-9773dc7c8c1a/download)
19. [Chi-square test of goodness-of-fit, Handbook of Biological Statistics](http://biostathandbook.com/chigof.html)
20. [chisquare R package reference manual (CRAN)](https://cran.r-project.org/web/packages/chisquare/refman/chisquare.html)
21. [Chi-square tests supplement, University of Vermont](https://www.uvm.edu/~statdhtx/methods8/Supplements/Chi-Square-Folder/ChiSquareTests.pdf)
22. [On the asymptotic distributions of some test statistics for two-way contingency tables (arXiv, 2024)](https://arxiv.org/html/2409.14255)
23. [Comparing categorical variables in clinical and experimental studies (PMC)](https://pmc.ncbi.nlm.nih.gov/articles/PMC8992732/)
24. [Power comparison of two-sided exact tests for association in 2 × 2 contingency tables, Statistics in Medicine (2003)](https://onlinelibrary.wiley.com/doi/10.1002/sim.1671)
25. [Chi-Square Test: Analysis of Contingency Tables, David C. Howell](https://www.uvm.edu/~statdhtx/StatPages/R/Chi-Square-Folder/Chi%20square%20test%20analysis%20of%20contingency%20tables_David_Howell%20.pdf)
26. [NIST Dataplot Reference Manual: Chi-Square Independence Test](https://www.itl.nist.gov/div898/software/dataplot/refman1/auxillar/chistest.htm)
27. [scipy.stats.chi2_contingency, SciPy v2.0.0.dev Manual](https://scipy.github.io/devdocs/reference/generated/scipy.stats.chi2_contingency.html)
28. [SciPy issue #13875: chi2_contingency with Yates correction](https://github.com/scipy/scipy/issues/13875)
29. [Asymptotic versus exact methods in the analysis of contingency tables, Statistical Methods in Medical Research](https://journals.sagepub.com/doi/10.1177/0962280220902480)
30. [Much Ado About Survey Tables, The American Statistician (2025)](https://ideas.repec.org/a/taf/amstat/v79y2025i4p480-491.html)
31. [The Choice Between Pearson's χ2 Test and Fisher's Exact Test for 2 × 2 Tables (2025)](https://pubmed.ncbi.nlm.nih.gov/40156377/)
32. [Continuity Corrections: Imperfect Responses to Slight Problems, UVA Library](https://library.virginia.edu/data/articles/continuity-corrections-imperfect-responses-to-slight-problems)
33. [chi2_contingency, SciPy v1.18.0 Manual](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.contingency.chi2_contingency.html)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Statistical inference, estimation, sampling, and testing › Hypothesis testing

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/pearsons-chi-squared-test

English original: https://www.edgepedia.org/pearsons-chi-squared-test
