The Causal Layer
  • Home
  • Series
    • All Series

    • Causal Inference
    • Pricing & Demand
    • Forecasting
  • All Posts
  • Projects
  • Resources
  • About

On this page

  • Posts in this series

🟢 Causal Inference

Identification strategies, potential outcomes, and the methods behind defensible decisions.

Every business decision is a causal question in disguise. Did this work? Was it worth the money? What would have happened without it? The methods on this page are the ones I reach for when the answer matters and the data is not a randomized trial.

This is the foundation arc of the blog. The other two — pricing and forecasting — build on the vocabulary and habits established here.


Posts in this series

What Is a Counterfactual?

The fundamental question of causal inference: what would have happened? And how we construct that answer in practice to support business decisions.

Jun 4, 2026
23 min

The Causal Compass: From Classical DiD to the Callaway–Sant’Anna Framework

Why staggered rollout analyses using TWFE can be misleading, and how to fix it. A practitioner’s guide from the canonical 2×2 DiD to cohort-time ATTs, with full R implementation.

Jun 8, 2026
44 min

From RCTs to A/B Tests: A Practitioner’s Guide to Trustworthy Experimentation

The RCT is the gold standard of causal inference. The A/B test is its industrial implementation, and it is harder to do correctly than most organisations admit. A complete practitioner guide covering design, diagnostics, power, sequential testing, fat tails, interference, and Bayesian decision theory. With full R implementation.

Jun 14, 2026
86 min

When A/B Tests Lie: Spillovers, Interference, and SUTVA Violations

The fundamental assumption of A/B testing fails silently in every platform where users share content, compete for attention, or trade in the same market. A complete practitioner guide to detecting, measuring, and designing around spillovers, with real cases from Kuaishou, Amazon, and Facebook. With full R implementation.

Jun 22, 2026
101 min

A/B Testing with Spillovers: A Runbook

The practical companion to ‘When A/B Tests Lie’: a step-by-step path from detection to design to estimator for experiments where units can contaminate each other, with full R code.

Jun 29, 2026
55 min

A/B Testing Is an Optimization Problem

Statistical significance was built for scientific inference, not for profit. A practitioner’s guide to reframing A/B tests as a Test & Roll decision problem, with the closed-form sample size that maximises expected profit instead of minimising false positives.

Jul 6, 2026
61 min

Price Elasticity Estimation: From OLS to Causal Methods

Why naive log-log regressions on pricing data lie, and what to do about it. A practitioner’s guide from OLS and fixed effects to IV, hierarchical Bayes, and double machine learning, with full R implementation.

Jul 13, 2026
74 min

Propensity Score Done Right: A Masterclass in Observational Causal Inference

A complete, code-first masterclass on estimating a causal effect from observational data: why OLS is an illusion under poor overlap, how the propensity score restores a data-verified comparison, matching and weighting, machine learning for the propensity score, doubly robust estimation, the sensitivity analysis that stress-tests the whole thing, and a decision matrix that maps business questions to methods. Full R implementation throughout.

Jul 27, 2026
108 min

Forecasting is not causal inference: a practitioner’s bridge

A practitioner’s guide to a distinction that quietly wrecks business decisions: predicting what will happen next is not the same task as predicting what would happen if you changed something. The bridge between this blog’s causal inference series and its forecasting series.

Aug 3, 2026
51 min

CUPED: The Highest-ROI Technique in Experimentation

A practitioner’s walkthrough of CUPED, the modern extensions the largest platforms actually run in production (CUPAC, MLRATE, CUPED++), the classical adjustment methods it generalises (DiD, ANCOVA, Freedman-Lin), and the five failure modes that make the estimator quietly wrong in production.

Aug 4, 2026
59 min

Switchback Experiments: How Marketplaces Test Under Interference

A practitioner’s walkthrough of switchback experiments in marketplace settings: why user-level A/B tests fail, the closed-form variance penalty formalised by Pankratev (2026), how to choose block length, the failure modes that survive good design, and the review checklist for marketplace switchback analyses.

Aug 17, 2026
63 min

When Good Features Kill Each Other: Cannibalization and the Illusion of Growth

A practitioner’s walkthrough of cannibalization as a general measurement bias: why gross lift on a local metric is not the ATE on the total metric, why smart teams keep missing this in practice, how to measure the gap using MMM cross-elasticities, portfolio decomposition, incrementality experiments and cohort-total tracking, and a review checklist for growth results.

Aug 24, 2026
72 min

Why Raising Prices Can Reduce Revenue in Two-Sided Markets

A practitioner’s walkthrough of two-sided market pricing: why single-sided elasticity models mislead, the chicken-and-egg problem for launch platforms, three modelling approaches (structural, reduced-form, Bayesian), and the review checklist for marketplace pricing analyses.

Aug 31, 2026
62 min

Synthetic Control: When You Have No Control Group

From the operational dilemma to SDID, a practitioner’s guide to causal inference with aggregate units. With full R implementation.

Sep 7, 2026
53 min

Dynamic Pricing Is Not Revenue Management. Confusing Them Is How Markets Get Worse for Everyone.

A practitioner’s walkthrough of pricing systems: the fifty-year revenue management foundation, the four legitimate extensions modern dynamic pricing added, the five failure modes where the modern wave went off the rails, a four-regime typology of the pricing problem, the causal-inference bridge to off-policy evaluation, a five-layer system architecture, an R simulation of classical dynamic programming versus naive reinforcement learning under a capacity constraint, and a review checklist for pricing-system architectures.

Sep 14, 2026
79 min

G-Computation: The Causal Tool You Should Be Using After Regression

Why reading regression coefficients directly is rarely sufficient for decision-making, and how g-computation delivers the causal estimates that actually answer business questions. With full R implementation using marginaleffects.

Sep 28, 2026
34 min

Long-Term Effects & Universal Holdouts: When Your Lift Disappears

Short-run A/B tests systematically overstate long-run business impact due to novelty and learning effects. This post explores why your initial lift disappears over time and details the universal holdout designs built to catch it, ensuring you measure the true, sustained impact of your product changes.

Oct 5, 2026
67 min

The Average Treatment Effect Is Often the Wrong Metric

A practitioner’s walkthrough of why the average treatment effect is the default and wrong estimand for most decisions: what the ATE hides, the CATE for heterogeneity, the QTE for distributional effects, policy learning for assignment rules, a four-estimand decision map, a five-layer analysis architecture, an R simulation where two experiments with the same ATE demand opposite decisions, and a review checklist for choosing the estimand.

Oct 12, 2026
69 min

Instrumental Variables: Finding Causal Effects with a Lucky Accident

When treatment and outcome share an unobserved cause, no amount of covariate adjustment fixes the bias. A practitioner’s guide to instrumental variables: from the Vietnam draft lottery to weak-instrument diagnostics, with full R implementation on three classic natural experiments.

Oct 19, 2026
64 min

The Sharp Edge of the Cutoff: A Practitioner’s Guide to Regression Discontinuity Design

Imagine you manage the analytics function at a large retailer. Your loyalty programme awards “Gold” status (and a 15% discount) to any customer who spends at least £5,000 in…
Oct 25, 2026
61 min

Marketing Mix Modeling: The Bayesian Way

A practitioner’s walkthrough of Bayesian marketing mix modeling: what an MMM is, why the Bayesian framing is used, the five ways it fails to identify what it claims to measure, the three dominant frameworks, the calibration bridge to experimental and quasi-experimental causal identification, a five-layer system architecture, an R simulation where an unobserved confounder flips the channel ranking until a lift-test anchor corrects it, and a review checklist for MMMs.

Nov 2, 2026
70 min
No matching items

Back to top
Source Code
---
title: "🟢 Causal Inference"
subtitle: "Identification strategies, potential outcomes, and the methods behind defensible decisions."
toc: true
toc-depth: 3
page-layout: full
listing:
  - id: causal-posts
    contents:
      - "../posts/**/*.qmd"
    include:
      categories: ["causal-inference","causal inference" ]
    sort: "date asc"
    type: default
    fields: [date, title, description, reading-time]
    max-items: 30
---

Every business decision is a causal question in disguise. *Did this
work? Was it worth the money? What would have happened without it?*
The methods on this page are the ones I reach for when the answer
matters and the data is not a randomized trial.

This is the foundation arc of the blog. The other two — pricing and
forecasting — build on the vocabulary and habits established here.

---

## Posts in this series

::: {#causal-posts}
:::

---

© 2026 João Vieira

The Causal Layer — Applied writing on causal inference, pricing, and forecasting.