FireCADCalc

Chi-Square Test for a 2×2 Table

Chi-square statistic, p-value and phi coefficient for a 2×2 contingency table, with or without the Yates continuity correction and the smallest expected count.

Inputs

Examples: Illustrative pass rates of two linesSame table with Yates correctionSmall counts with Yates

Accepted: 0 to 1E+9
Accepted: 0 to 1E+9
Accepted: 0 to 1E+9
Accepted: 0 to 1E+9

Results

For a 2×2 table χ² = n(ad − bc)²/[(a + b)(c + d)(a + c)(b + d)] with one degree of freedom; Yates's correction replaces |ad − bc| by |ad − bc| − n/2. With one degree of freedom p = erfc(√(χ²/2)). The approximation needs every expected count (row total × column total / n) to be at least about 5; below that use Fisher's exact test. Phi is the signed correlation between the two binary variables.

Chi-square statistic (1 degree of freedom)3.2054
p-value0.073396
Phi coefficient0.43872
Smallest expected count5.2800

Download PDF CSV Link to this result Compare another case

Log in to save calculations to your dashboard.

Worked example

Example: Illustrative pass rates of two lines. The inputs, in the units selected above:

InputValue
Row 1, column 1 count30.000 -
Row 1, column 2 count20.000 -
Row 2, column 1 count15.000 -
Row 2, column 2 count35.000 -
Continuity correctionNone (Pearson)

Applying the formula below gives:

ResultValue
Chi-square statistic (1 degree of freedom)9.0909
p-value0.002569
Phi coefficient0.30151
Smallest expected count22.500

Open this example in the calculator and change any input.

Formula

\(\chi^2 = \frac{n(|ad - bc| - \delta)^2}{(a+b)(c+d)(a+c)(b+d)}, \quad p = \operatorname{erfc}\sqrt{\chi^2/2}\)

Variables

Symbol Meaning SI unit
\(a\) Row 1, column 1 count -
\(b\) Row 1, column 2 count -
\(c\) Row 2, column 1 count -
\(d\) Row 2, column 2 count -
\(\text{Yates}\) Continuity correction -
\(\chi^2\) Chi-square statistic (1 degree of freedom) -
\(p\) p-value -
\(\phi\) Phi coefficient -
\(E_{min}\) Smallest expected count -

Method and standards

Chi-square test.

Where it is used

  • Comparing pass rates, failure rates or treatments.
  • Quality and reliability data.

Common mistakes

  • Using it with expected counts below 5.
  • Entering percentages instead of counts.

Assumptions and limits

  • Independent observations; counts, not proportions; one degree of freedom.

References

  • Pearson chi-square test of independence

Questions and answers

When should the Yates correction be used?

It makes the test more conservative for small counts; many statisticians now prefer no correction, or Fisher's exact test when counts are small.

What does the p-value mean?

The probability of a table at least this lopsided if the two variables were independent.

What do the defaults represent?

An illustrative trial: 30 of 50 parts from line A pass and 15 of 50 from line B.

Method and article reviewed by FireCAD engineering on 17 November 2026. Every result is checked against an independent calculation on each release: how we verify our calculators.

Sources

Montgomery and Runger, Applied Statistics and Probability for Engineers, 6th ed. (Wiley, 2014)

Related calculators

Free engineering calculators: every page computes in SI and converts to your units. Results are for engineering estimation; verify critical designs against the referenced standards.

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.