Skip to main content
v2026.11,772 entries · CC-BY 4.0

The Phi Coefficient: Correlation for Two Binary Variables

How the phi coefficient measures correlation between two binary variables, its exact identity with chi-square and Pearson’s r, and why unequal marginal distributions cap its maximum value below 1.

Ask CASRAI · included with Regulatory Radar

Ask about The Phi Coefficient: Correlation for Two Binary Variables

Ask CASRAI answers research-administration questions about this guide and cites the passages behind every claim — and says so when the corpus does not cover something, instead of guessing. It comes with a Regulatory Radar subscription at $29 a month, alongside the daily digest of regulatory changes and the dashboard of what changed.

150 questions a day, on this site, over the API, or inside your own tools through the CASRAI MCP server.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Written and maintained by CASRAI Editorial Board

Last updated

The phi coefficient (φ) is the correlation measure for two binary (dichotomous) variables — it is what you get when you compute a Pearson correlation on two variables that each take only two values (yes/no, present/absent, exposed/unexposed). It is not a separate statistic invented for categorical data: it is derived directly from the same 2×2 chi-square test of independence you would run on the same table, and it is numerically identical to Pearson’s r computed on the raw 0/1-coded data. This page covers the exact formula, that identity with chi-square and Pearson’s r, and a property that surprises people who treat φ as a plain correlation coefficient: when the two variables have unequal marginal distributions — one category much rarer than the other — φ cannot reach 1 even for the strongest association the data could possibly show.

What phi measures

Phi applies specifically to a 2×2 contingency table: two variables, each with exactly two categories. Label the cells a, b, c, d as below:

  Variable 2 = present Variable 2 = absent Row total
Variable 1 = present a b a + b
Variable 1 = absent c d c + d
Column total a + c b + d n

Phi can be computed two equivalent ways. Directly from the cell counts:

φ = (ad − bc) / √[(a+b)(c+d)(a+c)(b+d)]

Or from the table’s own chi-square statistic and sample size:

φ = √(χ² / n)

These two formulas always agree — the second is just the first with the numerator and denominator both expressed through χ². Because a square root is always non-negative, the chi-square-based formula on its own only gives you the magnitude of φ; the sign (direction of the association) comes from whether ad is greater or less than bc in the direct formula.

Worked example: phi from a 2×2 table

Illustrative example, not real data. Suppose a hypothetical study of 120 participants records whether each completed a training program (yes/no) and whether each passed a subsequent certification exam (pass/fail):

  Passed exam Failed exam Row total
Completed training 45 15 60
Did not complete 25 35 60
Column total 70 50 120

Applying the direct formula: φ = (45×35 − 15×25) / √(60×60×70×50) = 1200 / √12,600,000 ≈ 0.338. The table’s chi-square statistic (1 degree of freedom) works out to χ² ≈ 13.71, and √(13.71 / 120) ≈ 0.338 — the same value, confirming the two formulas agree, as they always will. (Both figures were computed directly from these cell counts, not estimated.) A φ of about 0.34 indicates a moderate positive association: completing training and passing the exam tend to occur together more often than chance alone would produce.

Phi is a special case of Pearson’s r

This is not an analogy — it is an exact numerical identity. If you code each binary variable as 0/1 (did not complete = 0, completed = 1; failed = 0, passed = 1) and run an ordinary Pearson correlation on those two columns across all 120 cases, you get precisely the same number as the φ computed from the contingency table above — not an approximation, the identical value to floating-point precision. This is why some sources call φ the “four-point correlation” or introduce it as “Pearson’s r for two dichotomies” rather than as a distinct statistic: mechanically, it is the same computation, and the 2×2-table shortcut exists only because it is faster to compute from counts than from raw 0/1 vectors when you already have a cross-tabulation. Practically, this means φ inherits everything true of Pearson’s r: it ranges from −1 to +1 in principle, a value of 0 means no linear association, and the sign tells you the direction of the relationship given how the categories were coded (which category is “1” is an arbitrary choice, so the sign itself is not inherently meaningful without knowing the coding).

Why phi can’t reach 1 when the marginals are unequal

The caveat in “ranges from −1 to +1 in principle” matters more for φ than it does for a continuous-variable correlation. When the two binary variables have unequal marginal distributions — one category much more common than the other, on either variable — the maximum value φ can possibly reach, even for the single most extreme table consistent with those margins, is pulled below 1. This constraint on φ’s range under class-imbalanced margins is documented in the methodological literature, notably Davenport & El-Sanhury’s 1991 review “Phi/Phimax: Review and Synthesis” (Educational and Psychological Measurement, 51(4)).

Illustrative example, not real data. Suppose one binary variable has a 90/10 split (row totals 90 and 10 out of 100) and the other has an 85/15 split (column totals 85 and 15). Given only those four margins, there is exactly one degree of freedom left in the table — once you pick the value of any one cell, the other three are forced. The table below is the most extreme one those margins allow: every one of the 10 cases in the smaller row category also falls in the smaller column category, and the smaller column total (85) is packed entirely into the larger row category as far as it will fit.

  Column = present (85) Column = absent (15) Row total
Row = present 85 5 90
Row = absent 0 10 10
Column total 85 15 100

This is the strongest possible association those margins can express — every case in the rarer row category lines up with the rarer column category, with zero exceptions. Computing φ on this most-extreme-possible table gives φ = (85×10 − 5×0) / √(90×10×85×15) ≈ 0.793, not 1.0. There is no table consistent with a 90/10 and an 85/15 split that produces a higher φ than that — the ceiling is a property of the margins themselves, not of how strong the real-world association happens to be. Practically, this means two φ values are only directly comparable when the marginal splits behind them are similar; comparing a φ of 0.5 from roughly-balanced variables against a φ of 0.5 from heavily-imbalanced variables is comparing two numbers on different effective scales, since the imbalanced case had far less room to reach 1 in the first place.

Interpreting the size of phi

Because φ behaves like a correlation coefficient, the same rough, field-dependent benchmarks commonly applied to Pearson’s r get applied to it: around 0.1 as a small association, around 0.3 as medium, and around 0.5 or above as large. Treat these as approximate conventions rather than fixed thresholds — and, per the section above, treat them with extra caution whenever the underlying variables have noticeably unequal marginal splits, since the achievable ceiling in that case may sit well below 1 regardless of how strong the real association is.

Phi vs. Cramér’s V vs. the odds ratio

Phi is the 2×2-specific case of a broader family of chi-square-based association measures covered in CASRAI’s chi-square test guide. For a table larger than 2×2 (more than two categories on one or both variables), φ itself is not defined in its simple form; Cramér’s V is the generalization, dividing by the smaller of (rows − 1) and (columns − 1) so the statistic stays bounded between 0 and 1 for any table size. For a 2×2 table specifically, Cramér’s V and φ are numerically identical (V reduces exactly to |φ|). The odds ratio is a different kind of summary for the same 2×2 table — instead of an abstract correlation-like number, it expresses the association as a ratio of odds, which is often more directly interpretable in clinical and epidemiological reporting and does not share φ’s marginal-dependent ceiling. Which one to report depends on the audience: φ and Cramér’s V read naturally alongside other effect sizes in behavioral and social-science reporting; the odds ratio is the convention in most clinical and epidemiological contexts.

When phi is the wrong tool

Phi (like the chi-square test it is derived from) assumes the observations in the table are independent — each case contributes to exactly one cell, with nobody counted twice. If the same subjects were measured twice on a binary outcome (before/after an intervention, or two raters classifying the same cases), the counts are paired rather than independent, and a standard φ/chi-square framework is the wrong tool; see CASRAI’s guide to McNemar’s test for the paired 2×2 case instead. Phi also assumes the same expected-cell-count conditions that apply to the underlying chi-square test: badly sparse cells (very low expected counts) make both the chi-square p-value and the φ estimate unreliable.

Frequently asked questions

Is the phi coefficient the same as Pearson’s correlation?

Yes, exactly, when both variables are binary (0/1-coded). Computing an ordinary Pearson correlation on two 0/1 columns and computing φ from the equivalent 2×2 contingency table produce the identical number — φ is a special case of Pearson’s r, not a separate formula that happens to behave similarly.

What is a good phi coefficient value?

The commonly cited rough benchmarks are around 0.1 (small), 0.3 (medium), and 0.5+ (large), treated as approximate rather than fixed cutoffs — and interpreted with extra caution whenever the two variables’ marginal splits are unequal, since the maximum φ achievable in that case can sit well below 1.

Can the phi coefficient be negative?

Yes. The sign indicates the direction of the association given how the two categories were coded on each variable; because which category is coded “1” is an arbitrary choice, the sign by itself is only meaningful once you know the coding.

What’s the difference between phi and Cramér’s V?

For a 2×2 table they are numerically identical (Cramér’s V reduces to |φ|). Cramér’s V is the generalization used for any r×c table larger than 2×2, where φ in its simple form no longer applies.

Why can’t phi reach 1 even for a strong association?

Because φ is computed from a fixed 2×2 table, and the table’s own row and column margins constrain how extreme the cell counts can possibly be. When one or both variables have an unequal (imbalanced) split, even the single most extreme table consistent with those margins falls short of a perfect φ of 1 — the ceiling is a property of the margins, documented by Davenport & El-Sanhury (1991), not a flaw in a particular dataset.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →

Regulatory Radar

Stop finding out after the fact

$29/month, cancel anytime. Daily digest updates from our analysis, a dashboard holding the same items, and a cited assistant for everything they raise.

  • Federal Register, Federal Register+, Grants.gov, Regulations.gov, NSF News, UKRI, plus CASRAI’s own published content.
  • 44,322 indexed passages, and every answer cites the ones it drew on.