The threshold model
Many discrete traits act as if a hidden normal liability had been cut at thresholds: a disease past one cutoff, a survey answer one step up at each. Move the thresholds and the category frequencies follow. With two traits, a correlation between the liabilities becomes a contingency table, and a table can be turned back into that correlation.
A hidden liability, cut into categories
The liability is normal with SD 1. Each category is the area between two thresholds, shown again as a bar. Drag a numbered handle to move its threshold.
Liability and thresholds
Two correlated liabilities make a table
Liabilities of the two traits. Ellipses hold 50%, 90% and 99% of individuals; lines are the thresholds (drag the numbered handles); dots are the sampled individuals.
The cells as a table, laid out like the plane: probability of each pair of categories (and the sample's count), with each trait's frequencies in the margins.
Liabilities
0 for none. The same seed draws the same people, so moving a control moves each dot.
Counts
Rows are trait 1's categories, columns trait 2's, both in order.
The latent model behind the table
The fitted latent model: liabilities standardised to mean 0, thresholds placed so each margin matches, and the correlation that best reproduces the cells.
Observed and fitted counts
Fitted counts in parentheses. A 2 × 2 table is reproduced exactly; larger tables test whether one bivariate normal can explain every cell.
How it works
Categories from a liability
The liability has SD 1, because only its position relative to the thresholds can be observed: doubling every distance changes nothing you could count. A category's frequency is the normal probability between its two thresholds, so equal steps in the mean make unequal steps in frequency once the bulk of the curve has crossed a threshold.
Correlation shows up attenuated
With two traits, each cell of the table is the bivariate normal probability of a rectangle, computed exactly. Scoring the categories 0, 1, 2, … and correlating the scores gives a smaller number than the latent ρ, more so with few or lopsided categories. The polychoric correlation (tetrachoric for 2 × 2) undoes this by fitting ρ to the table.
Fitting a table
Thresholds come from the cumulative margins (the normal quantile of each running share), then ρ maximises the multinomial likelihood of the cells with the thresholds held fixed. This is the two-step estimate that R's polycor package gives by default; its standard error treats the thresholds as known.
The cos-π shortcut
The shortcut cos(π / (1 + √(AD/BC))), where A, D are the concordant and B, C the discordant counts, is exact only when both traits are split at their medians. With unequal margins, use the bivariate normal probabilities fitted here. The API provides the same computations.