AI Glossary / Statistics and probability / Intermediate

Contingency table

Definition

A contingency table organizes observations by combinations of categorical variables. In a two-way table, rows represent categories of one variable, columns represent categories of another, and each cell contains the count for that combination. The table makes joint patterns, group sizes, and conditional proportions visible. It is a descriptive structure that can support statistical analysis, rather than a test or causal conclusion by itself.

What it means

Suppose each support request has a channel and a resolution outcome. A contingency table can show how many chat requests were resolved, how many were unresolved, and the corresponding counts for telephone requests. Row totals, column totals, and the grand total summarize the margins.
The same table supports different questions depending on the denominator. Resolved requests as a share of chat requests differ from chat requests as a share of resolved requests. Clearly labeled counts and percentages help readers distinguish these questions instead of treating every percentage as interchangeable.

How it works

Define the observational unit and categorical variables. Specify categories that are meaningful and, for an ordinary single-response table, mutually exclusive and exhaustive. Decide how missing, unknown, and inapplicable values will be handled before counting. Multiple-response questions require a different interpretation because one person can contribute to several categories.
Place each observation in the appropriate cell, then verify the row totals, column totals, and grand total. Calculate row percentages for the distribution of column categories within rows, column percentages for the reverse conditioning, or total percentages for joint proportions. State which one is shown.
To compare the observed table with independence, expected counts are row total times column total divided by the grand total. Pearson's chi-square statistic summarizes discrepancies, while measures such as Cramer's V summarize association. Suitable tests depend on sampling assumptions and cell counts; exact or simulation-based methods may be appropriate in some sparse settings.
Repeated observations from the same unit, paired outcomes, survey weights, and structural impossibilities require special care. A simple count table can still be informative, but an ordinary independence test may not fit the design. Inspect individual cells and substantive differences rather than relying only on an overall test result.

Three practical examples

  • A customer team cross-tabulates preferred support channel by subscription category.
  • An AI evaluation team tabulates predicted class against reference class, producing a confusion matrix as a particular kind of contingency table.
  • A quality analyst compares defect categories across production lines to identify patterns that merit further investigation.

Think of it this way

Think of a contingency table as a set of labeled compartments. Every eligible observation goes into the compartment matching its combination of categories. The compartments reveal how the variables occur together, while the totals tell you how large each relevant comparison group is.

Worked example

Consider an original table of 200 support requests. Chat has 54 resolved and six unresolved requests, for a row total of 60. Telephone has 56 resolved and 24 unresolved, totaling 80. Email has 36 resolved and 24 unresolved, totaling 60.
The column totals are 146 resolved and 54 unresolved. The grand total is 60+80+60=200, which also equals 146+54. Resolution proportions by channel are 54/60=90%, 56/80=70%, and 36/60=60%.
The share of resolved requests that came through chat is 54/146, approximately 37.0%. The joint share of all requests that were both chat and resolved is 54/200=27%. These are different quantities from chat's 90% resolution proportion.
Under independence, the expected chat-resolved count is 60 times 146/200=43.8, and the expected chat-unresolved count is 60 times 54/200=16.2. Expected counts need not be integers even though observed counts are integers.
The observed differences do not establish that changing the channel would change resolution. Case difficulty, customer selection, and other factors could differ across channels.

Illustrative case study

In a fictional company, Silverline Support receives a dashboard showing that telephone handled the most resolved requests. A manager concludes that telephone must have the highest resolution rate. An analyst adds row totals and row percentages, revealing that workload volume and resolution proportion answer different questions.
The team also checks whether repeated contacts for the same issue are being counted as independent requests and whether unresolved cases have had enough time to reach an outcome. It documents these definitions before comparing channels.
The revised table supports a clearer operational discussion without attributing the differences to channel effects. This fictional case illustrates denominator and unit checks; it does not report actual company performance.

Common misconceptions and mistakes

A larger count does not necessarily mean a higher rate. Row and column percentages condition on different groups. Missing values are not automatically equivalent to a negative outcome. Expected counts under independence can be fractional. A confusion matrix is a special table, not a synonym for every contingency table. Association does not establish causation. Pooling across groups can conceal or reverse patterns, so context may require stratified tables.

Business use

Businesses use contingency tables to summarize survey responses, service outcomes, error types, and customer characteristics. They are often the clearest starting point for checking a complex analytical claim. Show counts as well as relevant percentages, define the unit, and identify the period. When decisions depend on small groups or repeated observations, bring the data structure into the statistical analysis rather than treating the display as proof that ordinary test assumptions hold.

People also ask

Can a contingency table involve more than two variables?

Yes; multiway tables cross-classify additional categorical dimensions.

Must every cell have a positive count?

No. Sampling zeros can occur, while structural zeros represent combinations that are impossible by definition and need separate consideration.

Is a percentage-only table enough for inference?

Usually not; sample size and design information are needed to assess uncertainty appropriately.

Check your understanding

What denominator gives the chat resolution proportion?

Answer: The 60 chat requests.

What denominator gives chat's share of resolved requests?

Answer: The 146 resolved requests.

Why is the expected count 43.8 legitimate?

Answer: It is a model-based expectation, not a requirement that a fraction of an actual request was observed.

Can the table isolate a channel's causal effect?

Answer: No, not by itself.

Related terms

  • Categorical variable
  • Marginal totals
  • Expected frequencies
  • Chi-square test
  • Confusion matrix
  • Cross-tabulation
  • marginal total
  • conditional proportion
  • joint proportion
  • expected frequency
  • Fisher's exact test
  • structural zero

Learn next

Practice reading the same table using row, column, and total percentages. Then calculate expected counts under independence and compare them with observations. Next study how paired data, clustering, and survey sampling change the choice of statistical method, and why effect sizes complement tests.

  • Paired data

More in Statistics and probability

  • Conjoint analysis - Conjoint analysis is a family of methods for studying how people evaluate alternatives described by several attributes.
  • Constellation model - A constellation model is a probabilistic, part-based model for recognizing object categories in images.
  • Contingency coefficient - The contingency coefficient, usually meaning Pearson's contingency coefficient C, is a nonnegative measure of association between categorical variables...
  • Continuity correction - A continuity correction adjusts a boundary when a continuous distribution approximates a discrete one.
  • Continuous probability distribution - A continuous probability distribution describes uncertainty in a quantity whose probability is spread across a continuum, rather than concentrated on...
  • Continuous random variable - A continuous random variable represents an uncertain numerical quantity through a distribution that assigns zero probability to each individual value.

Sources

David Howell, Statistical Methods for Psychology glossary, Contingency table: https://www.uvm.edu/~statdhtx/methods8/Glossary/Glossary.html SciPy official documentation, chi2_contingency: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.contingency.chi2_contingency.html SciPy official documentation, contingency association measures: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.contingency.association.html

Previous: Contingency Matrix Next: Continual Learning

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer