Skip to content

Log-Linear Analysis

Fit and compare expected-count models for categorical contingency tables by using log-scale interaction terms to express joint and conditional associations.

Version
v2 · 2026-10-03 · History
Domain-specific #
13398
Domain group
Formal Sciences
Origin domain
Experimental Design & Statistics
Subdomains
Categorical Data Analysis, Contingency Tables → Experimental Design & Statistics
Aliases
Loglinear analysis, Log-linear modeling of contingency tables

Core Idea

Log-linear analysis studies associations among categorical variables by modeling the expected count in every cell of their contingency table. It represents the logarithm of an expected count as an overall term plus selected main-effect and interaction terms. Omitting an interaction can express an independence restriction; retaining terms permits specified dependencies. Two-way as well as larger tables qualify.[1]

The analyst fits and compares such structures under a stated sampling model, then interprets the supported associations. Likelihood-ratio comparisons are common, but sparse data or impossible cell combinations can undermine routine chi-square approximations. This is a method of categorical inference, not simply taking the logarithm of each observed count.[1][2]

How would you explain it like I'm…

Do Things Go Together?

Say you sort your toys into boxes by color and by shape, and count what's in each box. Then you ask: do red toys tend to be round, or do color and shape have nothing to do with each other? Log-linear analysis is a way to answer questions like that from the counts.

Which Things Go Together?

Say you sort a big group of people into a table by a few categories, like favorite color and favorite season, and count how many fall in each box. Log-linear analysis asks which connections between the categories you need to explain those counts. You build a model that predicts each box's count, either with or without a link between, say, color and season. If the model without the link fits the counts well, the two may be unrelated. You don't have to pick one category as the 'answer' you're explaining; all of them are treated together.

Modeling Associations in Count Tables

Log-linear analysis studies tables of counts formed by cross-classifying several categorical variables (a contingency table). It models the expected count in each cell, writing its logarithm as an overall term plus chosen main effects and interactions. Leaving out an interaction states a hypothesis; for a two-way table, dropping the A-by-B term means A and B are independent. The model is fitted to observed counts, and fit is checked with tools like deviance and comparisons of nested models. Unlike logistic regression, which explains one outcome from the others, log-linear analysis models the joint pattern of all the variables, with none singled out as the outcome. Sparse tables or impossible cells can make the usual tests unreliable.

 

Log-linear analysis asks which associations among categorical variables are required to explain the counts in their cross-classification. Each admissible cell of the contingency table gets an expected count μ, and log μ is modeled as an overall term plus selected main effects and interactions; for a two-way table, the saturated model is log μ_ij = λ + λ_i^A + λ_j^B + λ_ij^AB, and dropping λ^AB expresses independence of A and B. In larger tables, constraints on interaction terms express joint, conditional, and higher-order association hypotheses. The analysis fits expected counts to observed frequencies under a stated sampling model, interprets the restrictions, and assesses fit, commonly with likelihood-ratio deviance and comparisons of nested models. The chi-square calibration of these statistics is not guaranteed: sparse or structurally impossible cells can undermine estimation and approximations, and a sampled zero is not automatically a structural zero. The defining orientation is the joint table, with no designated outcome; a logistic model, by contrast, targets one conditional response, though the two can give related fit results.

Scope of Application

Penn State uses the Berkeley graduate-admissions table—department, sex and decision—to compare joint and conditional association structures. Bickel and colleagues' original paper supplies the underlying admissions data, not the later course's log-linear fit.[1][3] Vinciotti and Wit use a much larger table of 69 General Social Survey answers to estimate a dependence structure with methods suited to extreme sparsity. Both cases preserve the same expected-cell and interaction logic, though their computational regimes differ.[4]

Clarity

The method distinguishes a relationship seen in a pooled table from one that persists after another categorical variable is represented. It also differs from logistic regression: a logit model identifies a response to explain conditionally, while a log-linear contingency model represents the joint categorical distribution. Some specifications have corresponding fit results, but the questions and parameterizations are not identical.[1]

Manages Complexity

A multiway table has many cells and possible dependencies. A small set of interaction restrictions summarizes what the model treats as independent or associated. Simpler models are easier to interpret but may miss structure; saturated models fit the sample more closely but explain less parsimoniously. As dimensions rise, most possible cells may be empty, so the sample's support and estimator must be examined rather than applying a fixed expected-count cutoff.[1][2][4]

Abstract Reasoning

Identify the categorical variables and observed cells, state a candidate interaction structure, fit expected counts under the relevant sampling assumptions, and compare the model with a defensible alternative. Then ask which omitted term explains a meaningful misfit and whether uncertainty assessment remains valid for the table's sparsity. The result concerns statistical association, not a causal effect by itself.[1][4]

Knowledge Transfer

The same method maps from a modest admissions table to a huge survey table: cells contain category-combination counts, interaction terms express dependence claims, and fit connects those claims to observations. The proposed DAG parent is live Statistical Inference, whose sample-to-model reasoning travels more broadly. Log-linear analysis itself stays domain-specific because its expected-cell machinery and sparse-table diagnostics require categorical count data.

Relationships to Other Abstractions

Local relationship map for Log-Linear AnalysisParents 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.Log-Linear AnalysisDOMAINPrime abstraction: Statistical Inference — is a kind ofStatisticalInferencePRIME

Current abstraction Log-Linear Analysis Domain-specific

Parents (1) — outgoing typed relations

  • Log-Linear Analysis is a kind of Statistical Inference Prime

    Log-linear analysis infers categorical association structure from sampled cell counts under an explicit stochastic model.

Hierarchy paths (3) — routes to 3 parentless roots

Neighborhood in Abstraction Space

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

Family — Causal Inference & Regression Modeling (15 abstractions)

Nearest neighbors

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

References

[1] Pennsylvania State University, “STAT 504: Lesson 10 — Log-Linear Models,” Overview, §§10.1–10.2.6 and §10.3, including Berkeley Example 10.3. Indexed original course text checked; direct HTML fetch returned 502 during authoring. registry ↩a ↩b ↩c ↩d ↩e ↩f

[2] Pennsylvania State University, “STAT 504: Lesson 12 — Inference for Log-linear Models: Sparse Data,” sparse-data and zero-cell discussion; indexed text checked, direct HTML fetch unavailable. registry ↩a ↩b

[3] P. J. Bickel, E. A. Hammel and J. W. O'Connell, “Sex bias in graduate admissions: data from Berkeley,” Science 187 (1975), 398–404, original dataset context only. registry ↩

[4] Veronica Vinciotti and Ernst C. Wit, “Loglinear modelling of huge contingency tables,” Statistics and Computing 36, article 209 (2026), Abstract, Introduction and §5. Original open-access study. registry ↩a ↩b ↩c