Statistics & probability

Tetrachoric correlation calculator from a two by two table

Estimate a latent continuous correlation from a two-by-two count table under a bivariate normal threshold model.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Estimate a latent continuous correlation from a two-by-two count table under a bivariate normal threshold model. The observed row and column margins determine two fitted thresholds; the joint lower-cell proportion determines the latent correlation. The page reports those thresholds and the reproduced cell probabilities. It deliberately distinguishes a model-based latent correlation from correlation of the observed binary labels.

THE FORMULAh=Φ⁻¹((n00+n01)/N), k=Φ⁻¹((n00+n10)/N); solve Φ₂(h,k;ρ)=n00/N. Remaining probabilities are Φ(h)−p00, Φ(k)−p00 and 1−Φ(h)−Φ(k)+p00. With balanced margins: ρ=sin[2π(p00−1/4)].

A worked example

The table [[30,10],[10,30]] has eighty observations and equal row/column margins, so both thresholds are zero. Its lower/lower proportion is .375. The normal quadrant identity gives ρ=sin(π/4)=.70710678. The observed binary phi correlation is .5; the two values differ because they refer to different variables.

Good to know

Exactly 2×2 positive integer cell counts, each ≤10,000,000. Rows and columns encode lower/upper latent categories in that order. Marginal probabilities must stay more than 10⁻⁵ from zero or one; latent correlation must be resolved inside (−.999,.999). Two-step marginal thresholds with numerical bivariate-normal inversion; no zero-cell correction, standard errors, sampling weights, latent-normality test or causal interpretation.

The correlation belongs to hidden continuous variables

Imagine two continuous latent measurements, each split into a lower and upper category at a threshold. The table records the resulting binary pairs. Tetrachoric correlation is the correlation assigned to the latent measurements under a bivariate normal model.

Many different latent mechanisms can produce the same observed table. The estimate therefore depends on a distributional assumption that binary labels cannot verify by themselves. Its magnitude should not be treated as a recovered assumption-free property of the observations.

Tetrachoric correlation calculator from a two by two table worked exampleOne observed table, two correlation meanings30 / 80 = .37510 / 80 = .12510 / 80 = .12530 / 80 = .375Thresholds: 0 and 0Latent ρ = .707107Binary phi = .5Rows and columns: lower category first
Scroll across to see the full diagram.
The table [[30,10],[10,30]] has eighty observations and equal row/column margins, so both thresholds are zero. Its lower/lower proportion is .375. The normal quadrant identity gives ρ=sin(π/4)=.70710678. The observed binary phi correlation is .5; the two values differ because they refer to different variables.

Compare this with the Chi square contingency independence calculator. Observed-table association does not estimate a latent continuous correlation.

Category order fixes the sign

Enter the lower category first in both rows and columns. The top-left cell is the count below both latent thresholds; the row and column margins determine how common the two lower categories are.

Reversing one category order flips the interpretation of concordance and the sign of the estimated correlation. Reversing both orders preserves concordance. Record the original label mapping with the analysis, because a numerical table without that mapping can be interpreted backwards.

Margins determine the threshold estimates

A standard normal variable falls below threshold h with probability Φ(h). Matching that probability to the observed first-row proportion gives h; the first-column proportion similarly gives k.

This two-step construction fixes the thresholds before solving for correlation. It is not a fit of arbitrary latent means and standard deviations: those are standardized for identification. The latent thresholds have standard-normal units rather than the units of an unobserved physical measurement.

The balanced eighty-observation example

For [[30,10],[10,30]], each lower category occurs forty times, making h=k=0. The probability of both lower categories is 30/80=.375. The identity Φ₂(0,0;ρ)=1/4+asin(ρ)/(2π) then gives ρ=.70710678.

In contrast, directly correlating the binary labels gives .5. Neither number is an arithmetic correction of the other: .5 describes the observed dichotomies, while .7071 describes the assumed continuous Gaussian variables before thresholding.

Why numerical inversion works

With finite fixed thresholds, the bivariate-normal lower-rectangle probability increases as correlation increases. That monotonic relationship permits a bracketed root search rather than an unconstrained two-dimensional optimizer.

The prototype evaluates the probability through an integral in correlation and uses bisection. It verifies that the requested joint proportion lies inside the numerical bracket and reconstructs every cell probability, providing a direct check on the fitted table.

Zero cells and near-perfect dependence

A zero off-diagonal cell or a nearly deterministic margin can push the latent estimate toward a correlation boundary. Adding a small constant to every cell would change the observed table and impose a continuity correction.

This page rejects zero cells and unresolved near-boundary estimates instead. Small positive cell counts can still imply substantial uncertainty, which is not supplied here. A finite root is not evidence that its last decimal places are well estimated from the sample.

Comparing tables without confusing precision and magnitude

Multiplying every cell by the same factor preserves all proportions, thresholds and the fitted latent correlation. It increases the number of observations and would change sampling uncertainty in a method that estimates it.

This is a useful check on what the output represents. The page returns the same point estimate for proportional tables and no standard error. Comparing correlations from two groups requires an additional sampling analysis, rather than comparing the number of displayed digits.

A few questions, answered

Why is the answer different from phi correlation?

Phi correlates observed binary labels. Tetrachoric correlation refers to assumed underlying continuous normal variables.

Can I add .5 to zero cells?

This page does not. Any correction changes the table and must be justified separately.

Does a table prove latent normality?

No. The normal threshold model is an assumption used to identify the latent correlation.

Does doubling all cell counts change the estimate?

No. It preserves proportions and the point estimate, while sampling uncertainty would change.

Find your calculator

Start typing to explore the library.