8️⃣ Contingency tables and scatter plots

Data Description | Part III — Two variables and synthesis
Modified

October 17, 2026

Abstract

By the end of this module, you will be able to:

  • Build a contingency table by hand from a list of individuals, and read a cell count \(n_{ij}\) and the margins \(n_{i\cdot}\), \(n_{\cdot j}\) aloud.
  • Compute row and column marginal distributions from a contingency table, as \(n_{i\cdot}/n\) and \(n_{\cdot j}/n\).
  • Compute a conditional distribution — the distribution of one variable restricted to a single modality of the other — and use it to compare sub-groups fairly.
  • Read a share such as \(n_{ij}/n_{i\cdot}\) aloud as a sentence, and write a share described in words in this notation.
  • Draw a scatter plot of two quantitative variables by hand and describe the pattern it shows (direction, form, exceptions).
  • Distinguish “a visible pattern” from “a proven relationship” — formalised numerically in Module 9.

The business question. Every univariate indicator so far described one variable at a time. The real question behind “The Wandering Fork”’s trading is whether two variables move together — does warmer weather really bring more revenue? Do promotions work better on sunny days? This module introduces the two graphical tools for answering that: the contingency table (for two qualitative-or-grouped variables) and the scatter plot (for two quantitative variables). We start with a table and five days small enough to handle by hand, and only then write the notation.

1 Theory

1.1 Sun, rain and medium days

One Wandering Fork truck classified 50 of its trading days by weather (keeping only Sunny and Rainy days) and by revenue level: Low (under €500), Medium (€500 to under €700) and High (€700 or more). The numbers are a simplified extract chosen so that you can compute everything by hand.

Weather  Revenue Low Medium High
Sunny 3 9 18
Rainy 12 6 2

The truck had 9 medium days when it was sunny, and only 6 when it rained. Is a medium day more likely when the sun is out? And what would you tell the owner about High days: is “18 against 2” the right way to compare sunny and rainy weather?

1.2 Contingency table

Where does a table like the one above come from? From a plain list of days, each one described by two variables at once.

Try it. Here are ten days of the same truck’s log. Tally them into the table below, then add the row and column totals. Number the rows \(i = 1\) (Sunny), \(i = 2\) (Rainy) and the columns \(j = 1\) (Low), \(j = 2\) (Medium), \(j = 3\) (High).

Day Weather Revenue level
1 Sunny High
2 Sunny Medium
3 Rainy Low
4 Sunny High
5 Rainy Medium
6 Sunny Low
7 Sunny High
8 Rainy Low
9 Sunny Medium
10 Rainy High
Weather  Revenue Low Medium High Row total
Sunny ? ? ? ?
Rainy ? ? ? ?
Column total ? ? ? ?
  1. How many days were Sunny and High?
  2. Count the Sunny days in the log directly, ignoring revenue. Do you get the Sunny row total?
Weather  Revenue Low Medium High Row total
Sunny 1 2 3 6
Rainy 2 1 1 4
Column total 3 3 4 10
  1. 3 days (Days 1, 4 and 7) were Sunny and High.
  2. Yes: the log has 6 Sunny days, which is the Sunny row total. Each day lands in exactly one cell, so the ten days fill the six cells and every total adds up to 10.

See it. Each day is one dot in exactly one cell — the cell where its row (weather) and its column (revenue level) cross:

Weather  Revenue Low Medium High
Sunny ● (Day 6) ●● (Days 2, 9) ●●● (Days 1, 4, 7)
Rainy ●● (Days 3, 8) ● (Day 5) ● (Day 10)

In plain words: a contingency table is a two-dimensional frequency table. The margins are the row and column totals — they give you back the one-variable frequency tables you already know.

NoteDefinition — contingency table

A contingency table (or cross-tabulation) crosses the modalities of two variables observed on the same individuals: cell \((i,j)\) holds the count \(n_{ij}\) of individuals with modality \(i\) of the first variable and modality \(j\) of the second. The row margin \(n_{i\cdot} = \sum_j n_{ij}\) and column margin \(n_{\cdot j} = \sum_i n_{ij}\) recover each variable’s own (univariate) frequency table from the same data.

NoteNotation decoder — contingency table
Symbol Read aloud In our example (ten days)
\((i,j)\) “cell i, j” — row first, then column \((1,3)\) is the Sunny–High cell
\(n_{ij}\) “n sub i j” \(n_{13} = 3\) Sunny and High days
\(n_{i\cdot}\) “n sub i dot” — the dot replaces the index that was added up \(n_{1\cdot} = 6\) Sunny days
\(n_{\cdot j}\) “n sub dot j” \(n_{\cdot 3} = 4\) High days
\(\sum_j\) “add up over all columns j” across a row: \(1+2+3 = 6\)
\(\sum_i\) “add up over all rows i” down a column: \(3+1 = 4\)

Whole formula as a sentence: “the row margin \(n_{i\cdot}\) is the sum of the counts across row \(i\); the column margin \(n_{\cdot j}\) is the sum of the counts down column \(j\).” Adding all the cells gives the grand total \(n = 10\).

1.3 Marginal distributions

Try it. Go back to the 50-day table of the hook. Complete the totals, then turn each total into a share of all 50 days.

Weather  Revenue Low Medium High Row total % of all days
Sunny 3 9 18 ? ?
Rainy 12 6 2 ? ?
Column total ? ? ? 50
% of all days ? ? ? 100%
Weather  Revenue Low Medium High Row total % of all days
Sunny 3 9 18 30 60%
Rainy 12 6 2 20 40%
Column total 15 15 20 50
% of all days 30% 30% 40% 100%

The truck had 30 Sunny days (\(30/50 = 60\%\)) and 20 Rainy days (\(40\%\)). Separately, 40% of all days were High. Notice that Sunny days are simply more numerous — this already explains part of “9 against 6”.

See it. The two margins are two ordinary one-variable bar charts (each block = 10% of the 50 days):

Variable Modality Share of all 50 days
Weather (row margin) Sunny ██████ 60%
Rainy ████ 40%
Revenue (column margin) Low ███ 30%
Medium ███ 30%
High ████ 40%

Recall. In Module 2 you computed relative frequencies \(f_i = n_i/n\) for one variable. A marginal distribution is exactly that, using the margins of the table as the counts.

In plain words: a marginal distribution is the share of all \(n\) individuals in each modality of one variable, read off the edge of the table — as if the other variable did not exist.

TipFormula — marginal distributions

Dividing each margin by the grand total \(n\) gives the two marginal distributions (relative frequencies, as in Module 2): \[ \frac{n_{i\cdot}}{n} \quad \text{(row variable)}, \qquad \frac{n_{\cdot j}}{n} \quad \text{(column variable)}. \] Each one sums to 1 (100%) and ignores the other variable entirely.

NoteNotation decoder — marginal distributions
Symbol Read aloud In our example (50 days)
\(n\) “n” 50 days
\(n_{i\cdot}\) “n sub i dot” row totals: \(n_{1\cdot} = 30\), \(n_{2\cdot} = 20\)
\(n_{\cdot j}\) “n sub dot j” column totals: 15, 15, 20
\(\frac{n_{i\cdot}}{n}\) “n sub i dot over n” \(30/50 = 60\%\) Sunny, \(20/50 = 40\%\) Rainy
\(\frac{n_{\cdot j}}{n}\) “n sub dot j over n” \(15/50 = 30\%\), 30%, \(20/50 = 40\%\)

Whole formula as a sentence: “the marginal share of a modality is its row (or column) total divided by the grand total.”

1.4 Conditional distribution

Try it. To answer the hook, compute percentages within each row: divide every cell by its own row total (30 for Sunny, 20 for Rainy), not by 50.

Weather  Revenue Low Medium High Total
Sunny (\(\div 30\)) ? ? ? 100%
Rainy (\(\div 20\)) ? ? ? 100%
All days (\(\div 50\)) 30% 30% 40% 100%
  1. Is a medium day more likely when it is sunny?
  2. How do High days compare between the two kinds of weather?
  3. Now read down the High column instead: of the 20 High days, what share were Sunny?
Weather  Revenue Low Medium High Total
Sunny (\(\div 30\)) 10% 30% 60% 100%
Rainy (\(\div 20\)) 60% 30% 10% 100%
All days (\(\div 50\)) 30% 30% 40% 100%
  1. No: \(9/30 = 30\%\) and \(6/20 = 30\%\). “9 against 6” only reflects that there were more Sunny days.
  2. \(18/30 = 60\%\) of Sunny days were High, against \(2/20 = 10\%\) of Rainy days: here the weather really makes a difference.
  3. \(18/20 = 90\%\) of High days were Sunny. This is a different question (“given High”) from question 2 (“given Sunny”), so it has a different answer.

See it. Each row now has its own 100% bar (each block = 10% of that row):

Given Low Medium High
Sunny █ 10% ███ 30% ██████ 60%
Rainy ██████ 60% ███ 30% █ 10%
All days (marginal) ███ 30% ███ 30% ████ 40%

The Medium column is identical in all three rows; the Low and High columns are not — that is where weather and revenue are associated.

In plain words: to compare Sunny vs Rainy days fairly, don’t compare raw counts (Sunny has more days total). Instead, compute percentages within each weather type — that’s the conditional distribution.

NoteDefinition — conditional distribution

A conditional distribution is the distribution of one variable restricted to a single modality of the other — one row (or one column), rescaled to its own row (or column) total instead of the grand total \(n\). It answers “given this category, how is the other variable distributed?”, which the raw counts alone cannot, since row totals differ in size.

TipFormula — conditional distributions

Given row modality \(i\), the share of column modality \(j\) is \[ \frac{n_{ij}}{n_{i\cdot}} \quad \text{(row percentages)}, \] and given column modality \(j\), the share of row modality \(i\) is \[ \frac{n_{ij}}{n_{\cdot j}} \quad \text{(column percentages)}. \] Each conditional distribution sums to 1 (100%) over its own row (or column).

NoteNotation decoder — conditional distributions
Symbol Read aloud In our example (50 days)
\(n_{ij}\) “n sub i j” \(n_{13} = 18\) Sunny and High days
\(n_{i\cdot}\) “n sub i dot” \(n_{1\cdot} = 30\) Sunny days
\(n_{\cdot j}\) “n sub dot j” \(n_{\cdot 3} = 20\) High days
\(\frac{n_{ij}}{n_{i\cdot}}\) “n sub i j over n sub i dot” — “given row i” \(18/30 = 60\%\) of Sunny days were High
\(\frac{n_{ij}}{n_{\cdot j}}\) “n sub i j over n sub dot j” — “given column j” \(18/20 = 90\%\) of High days were Sunny

Whole formula as a sentence: “the conditional share is the count in one cell divided by the total of the row (or column) you are restricting to — not by the grand total.”

1.5 Scatter plot

When both variables are quantitative, grouping them into classes throws information away. Plot the raw pairs instead.

Try it. Five days from the same truck (a simplified extract): temperature \(x\) and number of items sold \(y\).

Day Temperature \(x\) (°C) Items sold \(y\) \(x\) above its mean? \(y\) above its mean?
1 12 40 ? ?
2 16 55 ? ?
3 21 50 ? ?
4 24 70 ? ?
5 27 85 ? ?
Total ? ?
Mean ? ?
  1. On squared paper, draw an \(x\) axis from 10 to 30 °C and a \(y\) axis from 30 to 90 items. Plot one point per day at \((x, y)\).
  2. Compute both means, draw a vertical line at the mean temperature and a horizontal line at the mean number of items, then fill the last two columns.
  3. How many points lie in the lower-left or upper-right quarters of the plot? Which day goes against the trend?
Day \(x\) (°C) \(y\) \(x\) above 20? \(y\) above 60?
1 12 40 no no
2 16 55 no no
3 21 50 yes no
4 24 70 yes yes
5 27 85 yes yes
Total 100 300
Mean 20 60

Four of the five points (Days 1, 2, 4, 5) are in the lower-left or upper-right quarter: warmer days tend to sell more. Day 3 (21 °C, 50 items) is slightly warmer than average but sells below average — the points rise to the right, but not along a perfect line.

See it. Step 1 of the figure shows the five points; step 2 adds the two mean lines and colours each point by the quarter it falls in.

In plain words: each day becomes a dot at (temperature, revenue). The cloud of dots shows the pattern — upward trend, downward trend, curved, or no pattern at all.

NoteDefinition — scatter plot

A scatter plot places one point per individual, using one quantitative variable for the \(x\)-coordinate and another for the \(y\)-coordinate. It is the standard first look at a possible relationship between two quantitative variables, before computing any numerical summary.

2 Worked example

2.1 Contingency table — weather × daily_revenue_eur class

From “The Wandering Fork”’s Harbour 30-day subset (wandering-fork.xlsx, sheet harbour_30d):

Weather  Revenue class [400,500[ [500,600[ [600,700[ [700,800[ [800,900[ Row total
Sunny 0 3 6 3 1 13
Cloudy 3 2 2 3 2 12
Rainy 3 1 0 1 0 5
Column total 6 6 8 7 3 30

Step 1 — check the margins. The row totals (13, 12, 5) match Module 2’s weather frequency table exactly, and the column totals (6, 6, 8, 7, 3) match Module 3’s daily_revenue_eur class table exactly — both are recovered as marginal distributions of the same 30 rows, confirming the table was built correctly.

Step 2 — read the pattern. All 6 days in the lowest revenue class [400,500[ were either Cloudy or Rainy — zero Sunny days earned under €500. Conversely, Sunny days account for 10 of the 18 days earning €600 or more, including 6 of the 8 days in [600,700[. This is a first, purely visual hint that better weather is associated with higher revenue.

Step 3 — conditional distribution. Restricting to Sunny days only (row total 13) and rescaling each cell by 13 instead of 30 gives the conditional distribution of revenue class given Sunny: \(0\%, 23.1\%, 46.2\%, 23.1\%, 7.7\%\) for the five classes (rounded; they sum to \(100\%\) before rounding) — compare this to the unconditional column percentages from Module 3 (20.0%, 20.0%, 26.7%, 23.3%, 10.0%): Sunny days are visibly shifted toward the higher revenue classes, confirming the pattern from Step 2 with actual percentages instead of raw counts.

2.2 Scatter plot — temperature_c vs daily_revenue_eur

Plotting temperature_c (x-axis) against daily_revenue_eur (y-axis) for all 30 Harbour days shows points trending upward and to the right: as temperature rises, revenue tends to rise too, though the points do not fall on a perfect line — there is visible scatter around the trend.

3 Proof / derivation

Let \(n_{ij}\) be the contingency table’s cell counts, with row modalities \(i=1,\dots,r\) and column modalities \(j=1,\dots,c\). Every one of the \(n\) individuals is counted in exactly one cell, so summing across all columns for a fixed row \(i\) recovers that row modality’s total univariate count: \[ n_{i\cdot} = \sum_{j=1}^{c} n_{ij}. \] For “The Wandering Fork”, row \(i=\text{Sunny}\): \(0+3+6+3+1 = 13\), matching Module 2’s Sunny count exactly — this is not a coincidence but a direct consequence of the contingency table partitioning the same 30 rows both by weather and, independently, by daily_revenue_eur class.

4 Visual intuition

A contingency table is a two-dimensional histogram: instead of one row of class counts (Module 3), we now have a grid of counts, and reading down a single column or across a single row projects the two-dimensional picture back onto one axis — exactly recovering the one-variable-at-a-time view from Modules 2–3. A scatter plot’s “upward-and-to-the-right” shape is the visual signature of a positive relationship; Module 9 replaces “shape” with a single number, the correlation coefficient.

Step 2 of the five-day scatter figure shows where that number comes from: the two mean lines cut the plot into four quarters, and a rising cloud puts most points in the lower-left and upper-right quarters (4 of 5 here). Module 9’s covariance adds up exactly this.

5 Interactive demo

Important

TODO: an interactive contingency table builder (drag categories, see conditional distributions update) would be a good OJS demo for this module.

6 Exercises

Out of the 12 Cloudy days, what proportion earned in the top two revenue classes ([700,800[ or [800,900[)?

Solution. Cloudy row: \(3+2=5\) days in the top two classes out of 12 Cloudy days total, i.e. \(5/12 \approx 41.7\%\).

Verify that the column total for [600,700[ (8) is consistent with Module 3’s class frequency table.

Solution. Column [600,700[: \(6\,(\text{Sunny}) + 2\,(\text{Cloudy}) + 0\,(\text{Rainy}) = 8\), matching Module 3’s \(n_{[600,700[}=8\) exactly.

Without computing any number, how would you describe the scatter plot of temperature_c vs. daily_revenue_eur — direction, and is the relationship perfectly linear?

Solution. The direction is positive (points trend upward to the right). The relationship is not perfectly linear — there is visible scatter of points around any trend line one might draw, meaning other factors besides temperature also influence daily revenue.

Use the Harbour 30-day table of the worked example, with rows \(i = 1\) (Sunny), \(2\) (Cloudy), \(3\) (Rainy) and columns \(j = 1\) ([400,500[) to \(j = 5\) ([800,900[).

  1. Read \(\frac{n_{ij}}{n_{i\cdot}}\) aloud as one sentence. Which distribution is it?

  2. Compute \(n_{3\cdot}\), \(n_{\cdot 1}\) and \(\frac{n_{31}}{n_{3\cdot}}\), and say in words what the last number means.

  3. Compute \(\frac{n_{31}}{n_{\cdot 1}}\). Why is it different from (b)?

Solution. (a) “The count in cell \(i\), \(j\) divided by the total of row \(i\)”: the conditional distribution of the column variable given row modality \(i\) (row percentages). (b) \(n_{3\cdot} = 3+1+0+1+0 = 5\) Rainy days; \(n_{\cdot 1} = 0+3+3 = 6\) days in [400,500[; \(\frac{n_{31}}{n_{3\cdot}} = 3/5 = 60\%\): “60% of Rainy days earned under €500”. (c) \(\frac{n_{31}}{n_{\cdot 1}} = 3/6 = 50\%\): “half of the days under €500 were Rainy”. The cell is the same, but (b) restricts to the Rainy row and (c) to the [400,500[ column.

Use the 50-day table of the hook, with rows \(i = 1\) (Sunny), \(2\) (Rainy) and columns \(j = 1\) (Low), \(2\) (Medium), \(3\) (High). Write in symbols, then compute:

  1. “the number of Rainy days with High revenue”;
  2. “the share of all days that were Sunny”;
  3. “among High days, the share that were Sunny”;
  4. “the total number of Medium days, adding down the column”.

Solution. (a) \(n_{23} = 2\). (b) \(\frac{n_{1\cdot}}{n} = 30/50 = 60\%\). (c) \(\frac{n_{13}}{n_{\cdot 3}} = 18/20 = 90\%\). (d) \(n_{\cdot 2} = \sum_i n_{i2} = 9 + 6 = 15\).

7 Common mistakes

WarningWatch out
  • Using raw counts to compare rows with different totals. Always use conditional distributions (% of row/column total) for fair comparison.
  • Confusing marginal and conditional distributions. Marginal = overall (ignoring the other variable); conditional = given a specific value of the other variable.
  • Reading a scatter plot as proof of causation. A pattern only shows association; Module 9 quantifies the linear association, but neither proves causation.
  • Forgetting to group continuous variables for contingency tables. daily_revenue_eur must be binned (e.g., €100 classes) before crossing with weather — PivotTable grouping does this automatically.
  • Using a line chart instead of a scatter plot for two quantitative variables. Line charts imply a sequence (time); scatter plots show the relationship between two variables measured on the same individuals.

8 Exit check

Five minutes, no calculator needed except for question 4.

  1. In one sentence, what is the difference between a marginal and a conditional distribution?
  2. Why compare row percentages rather than raw counts when the row totals differ?
  3. Read \(n_{\cdot j} = \sum_i n_{ij}\) aloud as a sentence.
  4. Harbour had 12 good days and 8 bad days; Campus had 9 good days and 21 bad days. Compute the share of good days given each franchise.
  5. A scatter plot of temperature and items sold rises to the right. Can you conclude that heat causes the extra sales? Why?
  1. A marginal distribution describes one variable over all \(n\) individuals, ignoring the other; a conditional distribution describes it within one modality of the other variable only.
  2. Because a bigger row has bigger counts even when nothing differs: in the hook, 9 vs 6 medium days were 30% vs 30%.
  3. “The column margin \(n_{\cdot j}\) is the sum, over all rows \(i\), of the counts in column \(j\).”
  4. Harbour: \(12/20 = 60\%\); Campus: \(9/30 = 30\%\) (row totals 20 and 30, not the grand total 50).
  5. No: a scatter plot only shows association. Other factors (season, events, foot traffic) can drive both; Module 9 measures the linear association, but neither proves causation.

9 Homework — Excel lab

Reproduce, in Excel, every table and chart you built by hand in class, with COUNTIFS, a PivotTable with two fields (and Show Values As → % of Row Total) and an XY scatter chart, then apply them to the full dataset.

Estimated time: about 50–60 minutes. Any spreadsheet application works, at home or in a campus computer room.

Follow-up: a 10-minute debrief at the start of Module 9. Bring your Step 0 results and any question on Homework 1–4.

9.1 Using Excel

The sheet harbour_30d of wandering-fork.xlsx has the data. The complete list of function names, with their French equivalents, is on the Excel functions page.

Concept Excel function / steps
Contingency table Select the two columns → Insert → PivotTable, one variable in Rows, the other in Columns, Count in Values
Row/column margins The PivotTable’s own “Grand Total” row and column
Conditional distribution In the PivotTable, right-click Values → Show Values As → % of Row Total (or Column Total)
Scatter plot Select the two quantitative columns → Insert → Chart → Scatter (X Y)
Two-way COUNTIFS =COUNTIFS(range1, criterion1, range2, criterion2, …) for cell counts

For the full table (120 days per franchise) use the Excel Table tblFork and add the franchise as one more condition, for example =COUNTIFS(tblFork[franchise],"Harbour",tblFork[weather],"Sunny",tblFork[daily_revenue_eur],">=600",tblFork[daily_revenue_eur],"<700").

9.2 Step 0 — check your class results

  1. Type the ten-day log of the contingency-table Try it in A2:B11 (column A Weather, column B Revenue level, headers in row 1).
  2. Build the 2×3 table either with a PivotTable (Weather in Rows, Revenue level in Columns, Count in Values) or with COUNTIFS, e.g. =COUNTIFS($A$2:$A$11,"Sunny",$B$2:$B$11,"High"), and add the margins with SUM.
  3. Type the 50-day table of the hook (Sunny 3, 9, 18; Rainy 12, 6, 2), compute the row totals with SUM, and the row percentages by dividing each cell by its row total (e.g. =E2/$H2 if the counts are in E2:G3 and the totals in H2:H3), formatted as a percentage.
  4. Type the five (temperature, items sold) pairs in two columns, insert a Scatter (X Y) chart, and compute both means with AVERAGE.
  5. Compare every result with your hand computation.
Ten-day table Low Medium High Row total
Sunny 1 2 3 6
Rainy 2 1 1 4
Column total 3 3 4 10
50-day table, % of Row Total Low Medium High Row total
Sunny 10% 30% 60% 30 days
Rainy 60% 30% 10% 20 days
Grand total (% of all days) 30% 30% 40% 50 days

Scatter plot: five points rising to the right; AVERAGE gives 20 °C and 60 items. If the chart looks wrong, check that temperature is the left-hand column (Excel uses it for the \(x\) axis).

In wandering-fork.xlsx, filter franchise to “Campus” and build a PivotTable crossing weather (Rows) with daily_revenue_eur class (Columns, grouped in €100 bins). What are the row totals? Do they match Module 2’s Campus weather frequencies?

How to. Insert a PivotTable on tblFork, put franchise in Filters (select Campus), weather in Rows and daily_revenue_eur in Columns, then right-click a revenue label → Group… with By = 100.

Solution. Campus 120-day row totals: Sunny 50, Cloudy 48, Rainy 22 (total 120). These match the Campus weather frequencies from Module 2 (Sunny 41.7%, Cloudy 40.0%, Rainy 18.3%).

Using the full 240-row tblFork, build a PivotTable with promo_active (Rows) and daily_revenue_eur class (Columns, €100 bins). Show values as % of Row Total. Compare the conditional distributions for “Yes” vs “No” promo. Is revenue higher when a promo is active?

How to. Same PivotTable as Homework 1 without the franchise filter, promo_active in Rows; right-click a value → Show Values As → % of Row Total, then add up the classes below €200, from €400 and from €600.

Solution. There are 26 promo days and 214 non-promo days. Summing the row percentages: below €200, 15.4% (Yes) vs 19.2% (No); €400 or more, 53.8% vs 48.1%; €600 or more, 23.1% vs 23.4%. Promo days have slightly less mass in the lowest classes, but the top of the two distributions is almost identical. The difference is small and rests on only 26 days — and it is descriptive, not causal (other factors may drive both promo and revenue).

Create a scatter plot of foot_traffic (x) vs daily_revenue_eur (y) for Harbour 120 days. Describe the direction, form, and strength of the pattern.

How to. Filter tblFork to Harbour, select foot_traffic then daily_revenue_eur (x column first), and choose Insert → Chart → Scatter (X Y).

Solution. Strong positive linear trend: more foot traffic clearly associates with higher revenue. The points cluster tightly around an upward line — much tighter than temperature vs revenue. This visually confirms the \(r \ge 0.80\) correlation from the dataset design.

For each franchise (120 days each), compute the conditional share of days with daily_revenue_eur of €500 or more given each weather category. Is the weather–revenue association equally strong at both trucks?

How to. Lay out a 3×2 grid (weather × franchise) and fill each cell with the formula below, changing “Harbour” and “Sunny” each time (or pointing to the row and column header cells).

Solution. For Harbour and Sunny:

=COUNTIFS(tblFork[franchise],"Harbour",tblFork[weather],"Sunny",
          tblFork[daily_revenue_eur],">=500")
 /COUNTIFS(tblFork[franchise],"Harbour",tblFork[weather],"Sunny")
Weather Harbour Campus
Sunny 25/53 = 47.2% 19/50 = 38.0%
Cloudy 11/42 = 26.2% 18/48 = 37.5%
Rainy 2/25 = 8.0% 6/22 = 27.3%

At Harbour the share falls sharply from Sunny to Rainy (47.2% to 8.0%): weather is strongly associated with revenue. At Campus the three shares are much closer (38.0%, 37.5%, 27.3%): the association is weaker, so other factors (such as nearby events) matter more there.

10 Further reading

Source Where What it adds Time Verified
OpenStax IBS 2e §13.1 The Correlation Coefficient r (book pages 536–538) Correlation concept, scatter plots ~2 pages checked against the PDF contents (T046)
OpenStax IBS 2e §13.3 Linear Equations (book pages 539–542) Linear relationship basics ~3 pages checked against the PDF contents (T046)
OpenStax IBS 2e §3.4 Contingency Tables and Probability Trees (book pages 153–164) Contingency tables, conditional distributions (probability framing — skim) ~11 pages checked against the PDF contents (T046)
Khan Academy Unit Analyzing categorical data in the Statistics and probability course; look for lessons on two-way tables and conditional distributions Short videos and practice on contingency tables ~30–45 min (estimate) link check pending (T048)
Khan Academy Unit Exploring bivariate numerical data in the Statistics and probability course; look for lessons on scatter plots and correlation Short videos and practice on scatter plots ~30–45 min (estimate) link check pending (T048)

OpenStax IBS 2e: Alexander Holmes, Barbara Illowsky and Susan Dean, Introductory Business Statistics 2e, OpenStax, Rice University, https://openstax.org/details/books/introductory-business-statistics-2e, licensed under CC BY-NC-SA 4.0. Sections are cited, not reproduced.