week7
Table of contents
- Week 7: Causality
- What could explain the pattern?
- What is a causal effect?
- How can we learn about causal effects?
- How do causal effects inform decisions?
- Week 7 lecture slides
- Looking ahead
1. Week 7: Causality
1.1 Plan for today
This section outlines the lecture's plan for understanding causality. The discussion will cover how to explain observed patterns, define causal effects, and learn about them.
Finally, it will explore how causal effects inform decision-making 2.
- Key questions to be addressed:
- What could explain an observed pattern?
- What is a causal effect?
- How can we learn about causal effects?
- How do causal effects inform decisions 2?
2. What could explain the pattern?
2.1 Storytelling
A story is considered consistent with the data if its logical progression would naturally lead to the observed patterns. This initial phase focuses on brainstorming potential explanations.
It is crucial to distinguish between a story's consistency with the data and its empirical truth. The first question is whether the story logically implies the observed patterns, which is an objective assessment.
The second question is whether the story is actually true, which requires empirical testing to gather evidence that can differentiate between competing stories 4.
2.2 Example: Calçots
Consider the pattern that people in Barcelona who consume calçotades are, on average, healthier than those who do not. Several stories can explain this observation:
- Health benefits of calçots: The calçots themselves or their accompanying sauce might possess inherent health-promoting properties.
- Association with income: Calçotades could be positively correlated with higher income levels. Individuals with greater financial resources may have better health outcomes due to factors like improved access to healthcare and fitness facilities.
- Social interaction: Calçotades are often social gatherings. The positive impact of social contact on health could be a contributing factor.
- Pre-existing health status: Individuals who are already in better health might be more inclined or able to participate in such events.
This observed association alone is insufficient to isolate a direct causal effect of eating calçots on health 5.
📝 People in Barcelona who consume calçotades are, on average, healthier than those who do not. Possible explanations include the health benefits of calçots, an association with higher income, the positive impact of social interaction at these events, or that healthier individuals are more likely to attend 5.
2.3 Example: Pétanque
Imagine a survey of 10,000 Barcelona residents in 2024, with a follow-up in 2025, revealing that individuals who played pétanque in 2024 were more likely to die within the following year. Several potential stories could explain this finding:
- Pétanque as a dangerous sport: The direct causal link would be playing pétanque leading to an increased risk of death.
- Gender differences: Pétanque might be predominantly played by men, who generally have a lower life expectancy than women. In this scenario, sex influences both playing pétanque and the risk of death.
- Age-related factors: Older individuals may be more likely to play pétanque, and older age is independently associated with a higher likelihood of death due to age-related health issues.
6.
3. What is a causal effect?
3.1 Potential outcomes
A potential outcome represents what would happen to a unit (e.g., a person) under a specific condition or intervention. For any given unit, only one potential outcome can be observed at a time, while the others remain unobserved counterfactuals.
- Observed outcome: The result experienced by a unit under the condition that actually occurred.
- Counterfactual outcome (cf): The unobserved result that would have occurred for the same unit if a different condition or intervention had been applied 8.
3.2 Causal versus descriptive statements
Causal statements claim that changing one variable will lead to a change in another, whereas descriptive statements merely summarize observed data without implying such a relationship. A linear predictor indicates an association but does not make a causal claim.
- Causal statement: Asserts that altering a variable X would result in a change in variable Y for the same unit.
- Descriptive statement: Summarizes data and describes associations between variables without claiming that intervening on one would affect the other.
- Linear predictor: A variable X is a linear predictor of Y if there is a non-zero correlation between them, indicating an association 9.
Consider the statement: "The proportion of people in the metro with umbrellas is a predictor of whether it will rain later that day." This is a descriptive statement because it highlights an association between umbrella use and rainfall, but it does not imply that changing umbrella use would alter the weather 10.
3.3 The causal effect of education on wages
The causal effect of an intervention, such as completing a university degree, is the difference between the observed outcome and the counterfactual outcome. For an individual, this is the difference between their wage with a degree and what their wage would have been without one.
While individual causal effects are often unobservable, average causal effects can sometimes be identified under certain assumptions.
- Observed annual wage: The actual income earned by an individual at a specific age, given their educational attainment.
- Counterfactual wage: The hypothetical income an individual would have earned at the same age if they had not pursued a particular educational path 11.
- Causal effect of university: The difference between an individual's wage after attending university and their wage had they not attended 12.

3.4 The wage gap and average causal effects 13 14
Comparing groups with and without a university degree can reveal an observed wage gap. However, this gap may not solely represent the causal effect of university education, as individuals in both groups might have had different earning potentials had their educational paths been reversed.
| Condition | Attended university | Did not attend university |
|---|---|---|
| Observed average annual wage (thousand euros) | 30 | 18 |
| Assumed counterfactual average annual wage (thousand euros) | 24 | 25 |
- The observed wage gap between those who attended university and those who did not is 12 thousand euros (30 - 18) 13.
- The average causal effect for those who attended university is 6 thousand euros (30 - 24).
- The average causal effect for those who did not attend university is 7 thousand euros (25 - 18).
- The observed gap of 12 thousand euros is composed of the causal effect of university for those who attended and the difference in what the university group would have earned without university compared to the group that did not attend 6 14.

3.5 Storks and babies: Association versus causation
An observed association between two variables, such as the number of stork nests and the number of babies born in a city, does not automatically imply a causal relationship. Alternative explanations, like confounding factors, must be considered.
- An association exists between the number of stork nests and the number of new babies born per day, with more nests correlating with more births 15.

Possible explanations for the stork-baby association:
- Story 1: Storks directly cause an increase in births.
- Story 2: Larger cities tend to have more storks and also higher birth rates due to a larger population. In this case, city size is a confounding factor 16.
To distinguish between these stories, one could compare cities of similar population size but with varying numbers of storks. If city size is the sole explanation, no association between storks and births would be found within these similar-sized groups.
If storks do influence births, an association would persist 17.
4. How can we learn about causal effects?
4.1 Advertising and sales
Observational data can show patterns, but inferring causal relationships requires careful consideration. For instance, observing that sales tend to rise and then fall with increasing advertising budgets suggests a causal story: a medium amount of advertising is beneficial, but excessive spending can be detrimental.
However, this pattern could also be explained by other factors, such as firms with lower-quality products spending more on advertising and still achieving lower sales. To establish causality, experiments are often necessary 19.

- Causal inference: This implies that if a company spending a medium amount on advertising were to have spent a large amount instead, its sales would have been worse.
- Observational data limitations: Patterns in observational data can be consistent with multiple causal stories, making it difficult to determine the true relationship without further investigation 19 20.
4.2 An advertising experiment
To determine the causal effect of reducing an annual advertising budget from 9 million EUR to 5 million EUR per market, an experiment can be designed. This involves randomly assigning similar markets to different budget levels and comparing their average sales.
This approach, known as an A/B test, helps isolate the effect of the variable being tested 22.

- Experimental design: Forty similar, independent markets are used, with 20 randomly assigned to a 9 million EUR advertising budget (Group A) and 20 to a 5 million EUR budget (Group B).
- Controlled variables: The product, price, and advertising content are kept consistent across all markets to ensure that any observed differences in sales are attributable to the budget change.
- Outcome measurement: The primary outcome measured is the average annual sales per market for each group 22.
4.3 What random assignment buys us
Random assignment is crucial in experiments because it breaks the link between expected sales and the assigned treatment (in this case, the advertising budget). This process balances out prior differences between groups, including those that are unmeasured.
While random assignment does not guarantee perfectly identical groups in a single experiment due to chance variations, it provides a credible basis for estimating average causal effects 23.
- Balancing prior differences: Random assignment ensures that, on average, the groups being compared are similar in all aspects, both measured and unmeasured, before the intervention.
- Estimating average effects: By minimizing systematic differences between groups, random assignment allows for a more accurate estimation of the average causal effect of the treatment.
- Limitations: Random assignment does not eliminate the possibility of chance differences between groups in any given experiment.
- Alternative methods: While random assignment is a gold standard, causal inference can also be pursued without it if there is another credible method to justify the comparison 23.
4.4 Results of the advertising experiment
An advertising experiment comparing two budget levels, 9 million EUR (Group A) and 5 million EUR (Group B), over 20 markets each, yielded specific results. Group A achieved average annual sales of 20 million EUR per market, while Group B achieved 22 million EUR per market.
This indicates an estimated increase of 2 million EUR per market on average when the budget is reduced 24.

- Estimated effect: The difference in average sales between Group B and Group A (22M EUR - 20M EUR) suggests that reducing the advertising budget by 4M EUR per market leads to an average increase of 2M EUR in sales.
- Uncertainty: The estimate of the effect is subject to uncertainty, and further assessment is needed to understand the reliability of this finding 24.
4.5 Which story does the evidence support?
The experimental results, showing an increase in sales when the advertising budget was reduced from 9 million EUR to 5 million EUR, provide evidence supporting the story that excessive advertising can be detrimental. This suggests that the higher budget might be hurting sales, potentially due to consumer annoyance.
However, the experiment does not specify the exact mechanism behind this effect, such as consumer annoyance versus other factors 25.
- Support for Story 1: The observed increase in sales with a lower advertising budget aligns with the prediction that high advertising levels can reduce sales, possibly due to negative consumer reactions.
- Mechanism ambiguity: While the experiment suggests a causal link between higher advertising spending and lower sales, it does not definitively identify the underlying cause, such as consumer annoyance 25.
4.6 A/B testing online
A/B testing is commonly used online to assess the impact of changes, such as altering the color of a "Buy" button. The process involves randomly assigning users to different versions (A and B) and comparing a predefined outcome, like the purchase rate.
It is crucial to change only one variable at a time to isolate its effect 26.
- Random assignment of users: Each user is randomly assigned to either version A (e.g., blue button) or version B (e.g., green button) and remains in that assigned version throughout the test.
- Controlled comparison: Only the button color is changed between versions A and B; the price and other page elements are kept identical to ensure a clear comparison.
- Outcome definition: The outcome to be measured, such as the proportion of users who make a purchase within seven days, is chosen before the test begins.
- Assessing uncertainty: After the test, the purchase proportions are compared between the groups, and the uncertainty of the results is assessed before drawing conclusions 26.
4.7 Does the test answer the question?
When multiple factors are changed simultaneously in an experiment, random assignment can estimate the combined effect of these changes but cannot isolate the impact of individual factors. For example, if a test compares a blue button at full price (A) with a green button offering a 10% discount (B), any observed difference in purchases cannot be solely attributed to the button color 27.
- Combined effect estimation: If both the button color and the price are changed simultaneously (e.g., blue button at full price vs. green button with a 10% discount), random assignment will allow for the estimation of the combined effect of these changes.
- Inability to isolate effects: However, it will not be possible to isolate the specific impact of the button color alone when other variables, like price, are also altered 27.
4.8 Randomization and execution
Even with random assignment, experimental results can be compromised by poor design or execution. Issues such as a single user being exposed to multiple versions, inconsistent measurement of outcomes across groups, or comparing only users who interacted with the treatment (e.g., clicked the button) can lead to biased estimates.
Well-designed and properly executed randomized experiments are essential for reliably estimating causal effects 28.
- User consistency: Ensure that each user remains in their assigned version throughout the experiment to avoid confounding results.
- Consistent measurement: Purchases and other outcomes must be measured identically for all groups to prevent systematic errors.
- Comparison of all assigned users: Comparing only users who clicked or interacted with the treatment can introduce bias, as these users may already differ systematically from those who did not. The analysis should include all users who were initially assigned to a group.
- Gold standard: Well-designed randomized experiments are considered a gold standard for estimating causal effects due to their ability to control for confounding variables 28.
5. How do causal effects inform decisions?
5.1 Should the company cut its advertising budget?
This section illustrates how causal effects can inform business decisions by analyzing the potential impact of a change in advertising budget on profit. The analysis considers estimated changes in sales revenue and advertising costs to project the effect on profit.
- Scenario: Cutting the annual advertising budget from 9 million euros to 5 million euros per market.
- Estimated sales revenue: increase of 2 million euros.
- Advertising costs: decrease of 4 million euros.
- Estimated annual profit rise: 6 million euros (2 million EUR sales increase + 4 million EUR cost decrease).
- The estimated profit effect is uncertain because the sales effect is an estimate.
- The results suggest that a 5 million euro budget is preferable to a 9 million euro budget, though it is not known if 5 million euros is the optimal budget as other budget levels were not tested 30.
5.2 Counterfactuals and policy changes
Counterfactuals are crucial for understanding potential outcomes under different circumstances, allowing us to use past evidence to predict the effects of future policy changes. This involves estimating what would have happened if a different choice had been made at the time the data were collected.
- Counterfactuals: Describe what outcomes would have been under an alternative scenario at the time data were collected.
- If the causal relationships remain valid, past evidence can help predict future outcomes of policy changes.
- Estimating counterfactuals about the past informs us about the effects of policy changes in the future.
- Policy change: An intervention, such as halving university fees.
- The causal question is: what would happen to university attendance 31?
📝 Halving university fees is a policy change, and the causal question is what would happen to university attendance 31.
5.3 Policy recommendations
A policy recommendation offers advice on how individuals, organizations, or governments should alter their behavior, decisions, or laws. These recommendations are informed by causal evidence, but also depend on objectives, costs, and the level of uncertainty involved.
- Examples of policy considerations:
- A government considering raising the minimum wage: what would be the impact on unemployment and GDP?
- A company considering changing its price: what would be the impact on profit?
- An individual considering walking more: what would be the impact on their health?
- Causal evidence helps predict the outcomes of such changes 32.
📝 A government considering raising the minimum wage, a company considering changing its price, or an individual considering walking more are all examples of policy considerations where causal evidence helps predict outcomes 32.
5.4 A general approach
While each situation is unique, a general approach to making policy recommendations involves several steps, starting with data summarization and moving towards identifying and evaluating potential causal stories.
- General steps for policy recommendations:
- Summarize data patterns descriptively.
- Brainstorm potential "stories" (causal explanations) consistent with the data patterns.
- State a relevant counterfactual for the same unit and time period.
- For each story, logically deduce the counterfactual outcome if that story were true.
- Provide a policy recommendation for each story.
- Investigate which story is most likely to be true 33.
5.5 What we've learned
Multiple stories can be consistent with the same data patterns, necessitating the search for new evidence to differentiate between them. Random assignment in experiments is a key method for balancing prior differences and obtaining reliable causal estimates.
Skepticism towards causal implications derived solely from statistics is important, as misinterpreting a story can lead to potentially harmful policy recommendations.
- Differentiating between stories: New evidence is sought for which only a subset of stories is consistent.
- Example: Randomly assign different advertising budgets (e.g., 5M EUR or 9M EUR) across similar, independent markets for the same product.
- Compare the average sales in each group.
- Random assignment helps avoid biases from choosing budgets based on expected sales and balances prior differences on average.
- Skepticism: Be skeptical of causal implications drawn from statistics alone, as multiple stories may fit a pattern.
- Risk of misinterpretation: Believing a story is true when it is not can lead to potentially dangerous policy recommendations 34.
5.6 Learning outcomes
This section clarifies key concepts related to causality, counterfactuals, and policy recommendations, emphasizing the importance of distinguishing between descriptive and causal statements and the need for additional evidence to support causal claims.
- Story consistency: A story is consistent with data if its truth would logically lead to the observed data patterns.
- Counterfactual outcome: What the same unit would experience under a specified alternative at the same time.
- Causal statement: Asserts what changing one variable (X) would do to another (Y), including the direction and magnitude of the effect.
- Descriptive statement: Describes data without implying causal relationships.
- Policy recommendation: Advice on how to change behavior, decisions, or laws for an individual, organization, or government.
- Assessing causal implications: Additional evidence is required to assess causal implications because multiple stories can fit a given data pattern 35.
6. Week 7 lecture slides
6.1 Section 6: Causality
This section explores the concept of causality, examining its relationship with stories, counterfactuals, experiments, and decisions. It delves into how we understand cause and effect in various contexts.
6.2 Stories, counterfactuals, experiments, and decisions
The understanding of causality is deeply intertwined with how we construct narratives (stories), consider alternative possibilities (counterfactuals), gather evidence through systematic observation (experiments), and make choices (decisions). Each of these areas relies on or informs our grasp of causal relationships 36.
📝 Understanding that "if I had studied harder, I would have passed the exam" is a counterfactual statement that relies on a causal understanding of the relationship between studying and exam performance 36.
7. Looking ahead
7.1 Upcoming activities
This section outlines upcoming course activities and assignments. Students should prepare for Seminar 5, which includes Computer Test 4 and Practical Case 3. The next lecture will focus on relationships with categorical variables.
Additionally, students are required to complete the assigned autonomous work guide and quiz 37.
7.2 Reading for next week
The reading assignment for the upcoming week focuses on categorical variables and their relationships. Students should review specific sections from Moore's "The Practice of Statistics," 9th Edition 38.
7.3 Chapter 6: Two-way tables
This chapter covers two-way tables, focusing on sections 6.1–6.3. These sections detail marginal distributions, conditional distributions, and Simpson's paradox 38.
📝 Two-way tables can reveal Simpson's paradox, where a trend appears in different groups of data but disappears or reverses when these groups are combined 38.
7.4 Section 4.4: Adding categorical variables to scatterplots
This section explores how to incorporate categorical variables into scatterplots, likely to visualize relationships between numerical and categorical data 38.
7.5 Section 5.2: One numerical and one categorical variable
This section addresses scenarios involving one numerical variable and one categorical variable, providing methods for their analysis 38.
© 2026 Maeve. All rights reserved. This content is protected by copyright.