Skip to content

Phi Coefficient

The signed Pearson correlation of two varying binary variables, computed from the normalized cross-product difference of their 2×2 table.

Version
v1 · 2026-10-03 · History
Domain-specific #
13500
Domain group
Formal Sciences
Origin domain
Experimental Design & Statistics
Subdomains
Categorical Association, Binary Statistics → Experimental Design & Statistics

Core Idea

The phi coefficient is signed Pearson correlation for two paired, nonconstant binary variables. With counts \(a=n_{11}\), \(b=n_{10}\), \(c=n_{01}\) and \(d=n_{00}\), it is \(\phi=(ad-bc)/\sqrt{(a+b)(c+d)(a+c)(b+d)}\). All four margins must be positive; otherwise the statistic is undefined. The value is between \(-1\) and $1$ when defined, and swapping one variable's labels reverses its sign.[1][2]

How would you explain it like I'm…

The Go-Together Number

Imagine asking a group of kids two yes-or-no questions: "Do you have a dog?" and "Do you like walks?" The phi coefficient is a number that tells you whether the kids who say yes to one tend to say yes to the other, or whether yes to one tends to go with no to the other, or whether there's no pattern at all.

Yes/No Matching Score

The phi coefficient measures how strongly two yes/no things are linked, using pairs of answers from the same people or items. You sort everyone into four boxes: yes-yes, yes-no, no-yes, and no-no. If most people land in yes-yes or no-no, phi is positive, up to 1. If most land in yes-no or no-yes, phi is negative, down to −1. If knowing one answer tells you nothing about the other, phi is near 0. It only describes the data you have — it doesn't prove that one thing causes the other.

Binary Correlation Coefficient

The phi coefficient (φ) measures the association between two paired binary variables, each coded 0 or 1. You build a 2×2 table of counts: a (both 1), b (first 1, second 0), c (first 0, second 1), and d (both 0). Then φ = (ad − bc) / √((a+b)(c+d)(a+c)(b+d)). It equals the ordinary Pearson correlation between the two 0/1 columns, so it ranges from −1 to 1. Its sign depends on the coding: flipping the 0/1 labels on one variable reverses the sign, while flipping both keeps it the same. If either variable never varies, the formula divides by zero and φ is undefined. Phi describes the observed data; it is not a p-value or a measure of cause and effect.

 

The phi coefficient φ is the signed association between two paired, varying binary variables. From the 2×2 contingency table with a = n₁₁, b = n₁₀, c = n₀₁, d = n₀₀, φ = (ad − bc) / √((a+b)(c+d)(a+c)(b+d)), defined when all four margins are positive. It is exactly the Pearson correlation of the two 0/1-coded columns: the numerator contrasts concordant and discordant cross-products, and the denominator normalizes by the variation in both variables. The sign reflects which cells dominate under the declared coding; recoding one variable flips the sign, recoding both preserves it. Values lie in [−1, 1], and if any margin is zero, one variable is constant and φ is undefined. Phi is descriptive of the observed pairings, not a p-value, a causal effect, or proof of dependence in a population. In binary classification the same formula is the binary Matthews correlation coefficient, with a = TP, b = FN, c = FP, d = TN when rows encode truth and columns encode prediction; the multiclass MCC goes beyond this 2×2 identity.

Scope of Application

NIST's hypothetical two-process by two-outcome table \((2,5;3,2)\) yields \(\phi=-11/35\) by applying the formula to its published counts; NIST itself uses the table to teach a separate Fisher test. Scikit-learn's four-case binary prediction example has \(TP=2\), \(FN=1\), \(FP=1\), \(TN=0\) and yields binary MCC/phi \(=-1/3\), rounded in its guide to \(-0.33\). Multiclass MCC is a different extension.[3][2]

Clarity

State which cells are $11\(, \$10\), $01$ and $00$, and report both variables' margins. A zero cell is allowed; a zero margin makes the denominator vanish. Binary MCC is an exact formula match under truth/prediction labeling, but unsigned phi-squared, Youden's \(J\), Fowlkes–Mallows and Cramér's \(V\) are not signed-phi aliases. “Doolittle Skill Score” remains an unresolved historical naming question and is not adopted as an alias.[2][4]

Manages Complexity

Phi compresses a fourfold table into one directional association score, while its algebraic equality to Pearson \(r\) checks the calculation. The compression hides marginal constraints: with fixed row-1 total \(r_1\) and column-1 total \(c_1\), \(a\) can range only from \(\max(0,r_1+c_1-n)\) to \(\min(r_1,c_1)\). Thus a fixed-margin table may not attain both \(-1\) and $1$ even though the general mathematical range is \([-1,1]\).[3][2]

Abstract Reasoning

Pair both binary observations by unit, declare coding, count the four cells, check that every row/column margin is positive, then compute the signed normalized cross-product. Interpret the result as a sample binary correlation. A test, uncertainty statement or causal conclusion requires additional assumptions and methods: zero observed phi does not prove underlying population independence. The exact equality to Pearson correlation justifies the proposed strict live Pearson parent.[1][3]

Knowledge Transfer

Industrial process/outcome comparisons and classifier truth/prediction comparisons have the same paired-binary/four-cell/signed-normalization structure. Only the labels and evaluation purpose change. Do not transfer a classifier-quality verdict to a process comparison, or interpret NIST's separate Fisher-test result as phi's intrinsic significance. The statistic is descriptive in both settings.[3][2]

Relationships to Other Abstractions

Local relationship map for Phi CoefficientParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Phi CoefficientDOMAINDomain-specific abstraction: Pearson correlation coefficient — is a kind ofPearson correla…DOMAIN

Current abstraction Phi Coefficient Domain-specific

Parents (1) — outgoing typed relations

Hierarchy path (1) — routes to 1 parentless root

Neighborhood in Abstraction Space

Phi Coefficient sits in a sparse region of the domain-specific corpus (67th percentile for distinctiveness): few abstractions share its structure, so a faithful description tends to retrieve it precisely.

Family — Clinical Trial & Research Methodology (20 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-11-14

References

[1] H. P. Edmundson, “A Correlation Coefficient for Attributes or Events,” in Statistical Association Methods for Mechanized Documentation, original National Bureau of Standards proceedings (1964), p.41 onward, Abstract and §3; only official indexed passages were inspectable because the full PDF exceeded viewer size. registry ↩a ↩b

[2] Scikit-learn maintainers, “Metrics and scoring,” §3.4.4.13, original binary MCC formula, multiclass extension and worked example. registry ↩a ↩b ↩c ↩d ↩e

[3] NIST/SEMATECH, Engineering Statistics Handbook, §7.3.3, original fourfold hypothetical process table and separate Fisher test. registry ↩a ↩b ↩c ↩d

[4] SciPy maintainers, scipy.stats.contingency.association, Notes on related Cramér's \(V\) and Tschuprow's \(T\). registry ↩