This Probability concept is the current idea: keep the same invariant visible across Intuition, Math, Code, Interactive Demo.
Probability
Causal Inference Basics: Correlation versus Intervention
Causal inference separates observing X from setting X, so learners can see when raw association is causal, when adjustment is needed, and when a hidden confounder leaves the effect unidentified.
Concept Structure
Causal Inference Basics: Correlation versus Intervention
Start with the picture, metaphor, or geometric mechanism.
Make the objects explicit and connect them with notation.
Mirror the equations with runnable implementation details.
Manipulate the mechanism and watch the idea respond.
Learner Contract
What this page should let you do.
3 prerequisites listed; refresh them before leaning on the math or code.
Explain the mechanism, trace the main notation, and test one prediction in the live demo.
Read the intuition before the notation; the math should name a mechanism you already felt.
Follow this edge after making one prediction here; the next page should reuse the result, not restart the route.
Claim/source review status
Substantive review recorded
1/1 claims have bounded review metadata; still check caveats and source scope.Metadata-derived; review may be AI-assisted. Not a human certification.01
Intuition
Build the mental picture first so the rest of the page has something to attach to.
A predictive question asks what usually happens when we see .
A causal question asks what would happen if we set .
Those are not the same question. If learners keep only one distinction from this page, keep this one:
Suppose a study program is more common among students who already have stronger preparation , and strong preparation also improves the exam outcome . Then the treated group can look much better even if part of that gap came from , not from the program.
The causal graph is not magic. It does not identify effects by itself. It is a contract about which arrows are allowed to carry causal influence. Once that contract is stated, it tells us what would have to be blocked, randomized, or measured before an association can answer a causal question.
In the small graph
the path
is a back-door path from to . It makes treated and untreated groups differ before treatment happens. If is measured and is the only back-door path, we can compare treated and untreated outcomes inside each value of , then average those within-stratum contrasts using the original population mix of .
If is hidden, the honest answer is not "just control for something nearby." The effect is not identified from the visible table alone.
02
Math
Translate the story into symbols, assumptions, and a derivation you can inspect.
Let be a treatment or action, be an outcome, and be a measured pre-treatment common cause. Observational conditioning is
Intervention uses Pearl's do-operator:
Graphically, cuts incoming arrows into and sets from outside the system. In the toy graph, the intervention deletes the assignment mechanism
while keeping the outcome mechanism
The average causal effect for a binary treatment can be written as
If blocks the back-door path from to , the adjustment formula is
Notice the weighting. We do not use , because that is the biased treatment-group mix. We use the population mix after comparing outcomes inside each stratum.
For the lab numbers:
and the outcome table is
Inside each stratum, treatment adds . Therefore
But if prepared learners are more likely to receive treatment, the raw observed contrast is much larger. That contrast is useful for prediction. It is not automatically the causal effect.
03
Code
Keep the implementation aligned with the notation so the algorithm is legible.
p_c = {0: 0.6, 1: 0.4}
p_x_given_c = {0: 0.2, 1: 0.8} # confounded assignment
p_y = {
(0, 0): 0.10, # X=0, C=0
(1, 0): 0.25,
(0, 1): 0.55,
(1, 1): 0.70,
}
def obs_y_given_x(x):
px = sum(p_c[c] * (p_x_given_c[c] if x else 1 - p_x_given_c[c])
for c in [0, 1])
return sum(p_c[c] * (p_x_given_c[c] if x else 1 - p_x_given_c[c])
* p_y[(x, c)] for c in [0, 1]) / px
def do_y(x):
return sum(p_y[(x, c)] * p_c[c] for c in [0, 1])
raw = obs_y_given_x(1) - obs_y_given_x(0)
adjusted = do_y(1) - do_y(0)
print("raw association:", round(raw, 3))
print("back-door adjusted effect:", round(adjusted, 3))
print("bias from confounding:", round(raw - adjusted, 3))
The runnable code mirrors the math: the raw contrast weights by the treatment-selected mix, while the intervention calculation weights each stratum by the original population mix.
04
Interactive Demo
Use direct manipulation to connect the explanation to a moving system.
Use the Causal Intervention Lab as an observation-versus-action check.
Pick a case, then decide which estimate answers the causal question:
- the raw observed treatment-control contrast,
- the back-door adjusted contrast,
- or "not identified" because the needed confounder is hidden.
Before reveal, the association, adjustment, and intervention ledgers stay locked. After reveal, inspect which arrow was cut, which path was blocked, and whether the visible table was enough.
Live Concept Demo
Explore Causal Inference Basics: Correlation versus Intervention
The stage is code-native and interactive. Use it to test the explanation against the mechanism.
Manipulate one control and predict the visible change.
Commit to what Causal Inference Basics: Correlation versus Intervention should make visible before reading the result.
After The First Pass
Turn the concept into an inspected object.
Once the invariant is visible in the intuition, math, code, and demo, use these panels to inspect the mechanism visually, check source support, practice the idea, and attach a grounded research question.
Mechanism Storyboard
See the idea move before the page explains it
Causal inference separates observing X from setting X, so learners can see when raw association is causal, when adjustment is needed, and when a hidden confounder leaves the effect unidentified.
Start with the picture, metaphor, or geometric mechanism.
Before reading further, choose the kind of change Causal Inference Basics: Correlation versus Intervention should make visible.
Visual Inquiry
Make the image answer a mathematical question
Causal inference separates observing X from setting X, so learners can see when raw association is causal, when adjustment is needed, and when a hidden confounder leaves the effect unidentified.
Which visible object should carry the first intuition?
Pick the cue that should make Causal Inference Basics: Correlation versus Intervention easier to reason about before the page gives the answer.
Source Grounding
Canonical references for the mechanism on this page.
Primary source for structural causal models, the do-operator, intervention as replacing structural equations, and back-door adjustment.
Open sourceCourse-book source for confounding, intervention distributions, and adjustment ideas for observational causal estimation.
Open sourceStanford graduate course notes for potential outcomes, randomized experiments, treatment effects, and the distinction between prediction and causal questions.
Open sourceClaim Review
Causal inference separates observing X from setting X, so learners can see when raw association is causal, when adjustment is needed, and when a hidden confounder leaves the effect unidentified.
Claims without a substantive review badge still need exact source-support review.
pearl-2009-causal-inference-overview, shalizi-2013-causal-estimation, wager-2024-stats361
Use equations, runnable code, and demos to check whether the source support is operational.
The sources support the page's distinction between observed association and intervention, the graph surgery intuition for do(X=x), randomized assignment as a special case where raw treatment-control contrast can be causal, and measured-confounder adjustment as a sufficient back-door strategy in the toy DAG.
Sources: Causal inference in statistics: An overview, Advanced Data Analysis from an Elementary Point of View: Estimating Causal Effects from Observations, STATS 361: Causal InferenceFinite binary teaching graph only; excludes front-door, do-calculus proofs, longitudinal treatment, interference, measurement error, selection bias, transportability, and causal discovery.A bounded review summary is present; still check caveats and exact reference scope.Checked Pearl for do-operator and back-door adjustment framing, Shalizi for observational causal estimation and confounding, and Wager/STATS 361 for potential-outcome and randomized-treatment framing. GPT Pro publication critique remains pending because 127.0.0.1:51672 is unavailable.
Reviewer: codex-local-source-review; reviewed 2026-07-03Source support candidates
paper 2009Causal inference in statistics: An overviewPrimary source for structural causal models, the do-operator, intervention as replacing structural equations, and back-door adjustment.
course-notes 2013Advanced Data Analysis from an Elementary Point of View: Estimating Causal Effects from ObservationsCourse-book source for confounding, intervention distributions, and adjustment ideas for observational causal estimation.
course-notes 2024STATS 361: Causal InferenceStanford graduate course notes for potential outcomes, randomized experiments, treatment effects, and the distinction between prediction and causal questions.
Practice Loop
Try the idea before it explains itself
Causal inference separates observing X from setting X, so learners can see when raw association is causal, when adjustment is needed, and when a hidden confounder leaves the effect unidentified.
Before touching the demo, predict one visible change that should happen in Causal Inference Basics: Correlation versus Intervention.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
A concrete answer is on the canvas.
The answer names why the claim should hold.
It touches the page context or a neighboring idea.
Research Room
Attach the question to a claim, equation, code, or demo
Pick the concept, equation, source, runnable code, claim, misconception, or demo state before asking for help. The handoff keeps that page item in context.Open the draft below to save one note and next action in this browser.
Causal Inference Basics: Correlation versus Intervention
What is the smallest example that makes Causal Inference Basics: Correlation versus Intervention click without losing the math?
Local action draftNo local draft saved yetExpand only when ready to capture one local next action
This draft stays in this browser, attached to the selected learning item.
- References to inspect: attached references on this page.
- Definition, prerequisite, and contrast concept links
- The equation or runnable code that makes the concept operational
- One demo state that shows the invariant instead of a slogan
- The learner can state the mechanism in their own words
- The learner can name the prerequisite that would repair confusion
- The learner can predict how the mechanism changes under one perturbation
I am working in Continuous Function's research reading room. Object: concept - Causal Inference Basics: Correlation versus Intervention Selected item key: recorded for copy. Context: Probability Page anchor: recorded for copy. Open question: What is the smallest example that makes Causal Inference Basics: Correlation versus Intervention click without losing the math? Evidence to inspect: - References to inspect: attached references on this page. - Definition, prerequisite, and contrast concept links - The equation or runnable code that makes the concept operational - One demo state that shows the invariant instead of a slogan What would resolve this: - The learner can state the mechanism in their own words - The learner can name the prerequisite that would repair confusion - The learner can predict how the mechanism changes under one perturbation Answer as a careful research tutor: stay source-grounded, separate verified evidence from assumptions, name the relevant math objects, and end with one next action.
concept/concept-notebook/probability/causal-inference-basics
concept:probability/causal-inference-basics