Conditional Distributions

When statisticians study the relationship between two categorical variables, they organize data into a two-way table (also called a contingency table). Each cell in the table shows how many individuals fall into a particular combination of categories. For example, a survey might record both a student's grade level and their preferred music genre, producing a table that cross-classifies every respondent. Reading raw counts from such a table is useful, but it does not immediately reveal whether the two variables are related — that is where conditional distributions come in. A conditional distribution shows the distribution of one categorical variable given a specific value (or condition) of the other variable. Instead of looking at the entire dataset at once, you focus on a single row or column and convert its counts into proportions or percentages. This 'zooming in' lets you compare groups fairly, because proportions account for the fact that different groups may have different total sizes. For instance, saying '120 sophomores prefer pop music' is less informative than saying '60% of sophomores prefer pop music, compared with only 40% of juniors,' because the second statement controls for the number of students in each grade. Conditional distributions are foundational to understanding association between categorical variables. If the conditional distributions of one variable look nearly identical across every category of the other variable, we say the two variables are not associated (they appear independent). If the conditional distributions differ noticeably across categories, we have evidence of an association. This concept connects directly to later topics such as the chi-square test of independence, which provides a formal method to decide whether observed differences in conditional distributions could be due to chance alone.

Key takeaways
  • Identify the Two-Way Table Structure
  • Choose Which Variable to Condition On
  • Compute the Conditional Proportions
  • Compare Conditional Distributions Across Groups
  • State Conclusions Carefully

Identify the Two-Way Table Structure

A two-way table has one categorical variable defining the rows and another defining the columns. Each interior cell contains a frequency (count). The rightmost column and bottom row contain marginal totals — the sum of each row and each column, respectively. The grand total (bottom-right corner) equals the total number of observations, n.

Choose Which Variable to Condition On

Deciding which variable to condition on depends on your research question. If you ask 'Among people who exercise daily, what fraction prefer a plant-based diet?' then exercise habit is the conditioning variable (the explanatory variable), and you will compute conditional distributions of diet within each exercise category — meaning you will work row by row (or column by column, depending on table layout). A common convention is to let the explanatory variable define the columns and compute column conditional distributions.

Compute the Conditional Proportions

To find the conditional distribution of variable Y given category x_i of variable X, divide every count in the column (or row) corresponding to x_i by the marginal total for that column (or row). The resulting proportions must sum to 1 (or 100% if expressed as percentages). For example, if 80 out of 200 daily exercisers prefer a plant-based diet, the conditional proportion is 80/200 = 0.40, or 40%. Repeat this calculation for every category of X to obtain a full set of conditional distributions — one per column.

Compare Conditional Distributions Across Groups

Create a side-by-side segmented bar chart or a table of percentages to visualize all conditional distributions together. Look for differences: if the proportion preferring plant-based diets is 40% among daily exercisers, 25% among occasional exercisers, and 15% among non-exercisers, those differences suggest an association between exercise frequency and diet preference. The larger the differences, the stronger the apparent association.

State Conclusions Carefully

Always describe conditional distributions in context. Avoid causal language unless the data come from a randomized experiment. State which group you are conditioning on, what the proportions are, and what pattern you observe. For example: 'Among daily exercisers, 40% prefer a plant-based diet, compared with 15% of non-exercisers, suggesting a positive association between exercise frequency and plant-based diet preference in this sample.'

The Key Equation

P(Y=yj∣X=xi)=nijni⋅P(Y = y_j \mid X = x_i) = \frac{n_{ij}}{n_{i\cdot}}
  • P(Y = y_j \mid X = x_i) — Conditional proportion (dimensionless (0 to 1)): The proportion of individuals in category x_i of variable X who also fall in category y_j of variable Y.
  • n_{ij} — Joint cell count (individuals): The number of individuals who belong to category x_i of X and category y_j of Y simultaneously.
  • n_{i\cdot} — Row (or column) marginal total (individuals): The total number of individuals in category x_i of the conditioning variable X; the sum of all counts in that row or column.

Worked Example

Problem. A high school surveyed 300 students about their screen-time habits (Low: < 2 hrs/day; High: ≥ 2 hrs/day) and their self-reported sleep quality (Good or Poor). The two-way table is: Low screen time — Good sleep: 96, Poor sleep: 24, Total: 120. High screen time — Good sleep: 72, Poor sleep: 108, Total: 180. Column totals: Good sleep: 168, Poor sleep: 132, Grand total: 300. Find the conditional distribution of sleep quality for each screen-time group and comment on the association.

P(Good∣Low)=96120=0.80,P(Good∣High)=72180=0.40P(\text{Good} \mid \text{Low}) = \frac{96}{120} = 0.80, \quad P(\text{Good} \mid \text{High}) = \frac{72}{180} = 0.40

Answer. Low screen-time: 80% Good, 20% Poor. High screen-time: 40% Good, 60% Poor. The large differences indicate a strong association between screen time and sleep quality.

Figure
Diagram
Conditional Distributions of Sleep Quality by Screen Time(Segmented Bar Chart)80%20%40%60%Low Screen TimeHigh Screen Time100%60%20%0%Good SleepPoor Sleep
Origins · 1 minKarl Pearson and how this was discovered
KP
Karl Pearson
1857–1936 · British

Karl Pearson formalized the analysis of categorical data by developing the chi-square test (1900), which provides a rigorous method to assess whether conditional distributions differ significantly across groups — exactly the question raised by two-way tables. He also coined the term 'contingency table' and developed the contingency coefficient as a measure of association, laying the statistical groundwork that made conditional distributions a central tool in data analysis. Pearson was so dedicated to statistics that he founded the world's first university statistics department at University College London in 1911, and he simultaneously edited his own journal, Biometrika, for over 35 years — essentially acting as author, editor, and referee all at once.

  • Two-Way Tables: Joint and Marginal Distributions — Conditional distributions are computed directly from the cell counts and marginal totals found in a two-way table; understanding the table structure is a prerequisite.
  • Association Between Categorical Variables — Comparing conditional distributions across groups is the primary way to detect and describe association between two categorical variables.
  • Segmented Bar Charts — Segmented bar charts are the standard graphical tool for displaying and comparing multiple conditional distributions simultaneously.
  • Chi-Square Test of Independence — The chi-square test is the formal inference procedure that determines whether the differences observed in conditional distributions are statistically significant.
  • Conditional Probability — Conditional distributions in statistics are a direct application of conditional probability — the proportion P(Y | X) is a sample estimate of the true conditional probability.