Causal Inference and Experiments

Standardise the schedule comparison

BOTIE

Subtract control stratum means from treatment stratum means, then take their weighted average using target proportions.
Ready to test
0 passed · 0 failed · 2 not run

An empty floor. Start with the information your machine needs.

Received result

Your answer will arrive here.

Examples, experiments and workspace controls
Live values

Connect a tool's inputs to see what it produces. You can try a branch before connecting it to Result.

Try your own inputs

Use a copy of the example to try your own data. Keep the problem's assumptions in mind, and predict the effect of a change before checking the output. You can also add another branch to compare two ways of doing the calculation.

Start at an output arrow, then click or drag to an input. Drag empty space to pan. Delete removes a selection. Ctrl/Cmd+Z undoes a change.
Context for this challenge

Subtract control stratum means from treatment stratum means, then take their weighted average using target proportions.

Botie needs both schedules compared in the same target population rather than in different mixtures of starting conditions.

Subtract control from treatment within each stratum, validate the target proportions, then calculate their weighted average.

Examples and results
Treatment stratum means
  1. 04
  2. 19
Control stratum means
  1. 03
  2. 18
Target stratum proportions
  1. 00.6
  2. 10.4
Required result
1
Treatment stratum means
  1. 04
  2. 18
Control stratum means
  1. 03
  2. 14
Target stratum proportions
  1. 00.8
  2. 10.2
Required result
1.6
Try a fresh construction

This clears this draft, including its undo history. Earlier successful attempts stay recorded. Build again without opening hints to record an independent attempt.

Stuck? Inspect a worked construction

The tools below form one possible solution. You can assemble it, follow its signals, and undo that change to return to your own construction.

Assumptions and test precision

Causal interpretation requires a sufficient adjustment set, consistency, overlap, and the other stated design assumptions. Numerical tests allow a difference of 0.001. Lists and structures must also have the right shape.

Compare both groups in the same target population

This check uses the pieces from “Weight condition-specific contrasts by one target mixture”.

BOTIE

Botie has treated and control recovery rates for mild and severe cases. The target population is 60% mild and 40% severe. Calculate the target-weighted within-group difference, keeping both treatments on that same population mix.
Treatment stratum means
  1. 00.9
  2. 10.5
Control stratum means
  1. 00.8
  2. 10.4
Target stratum proportions
  1. 00.6
  2. 10.4

Use a number, text, or an array matching the requested result. For a matrix, put each row in brackets. Saving your prediction runs your current construction on these inputs and checks the earlier examples too.

Build a construction in the workspace above first. This case will test those pieces.

Which assumptions are needed before this standardised contrast can describe a causal effect?

A common target mixture solves a weighting problem; sufficient adjustment, overlap, and consistency still require justification.

Causal interpretation requires a sufficient adjustment set, consistency, overlap, and the other stated design assumptions.

Work through the Python challenges →
Continue the courseReweighting Records Without Inventing Missing Evidence →
← Making a Fair Comparison by Assignment