Statistical note
Confounding, mediation, and collider bias
Distinguish variables that open biasing paths from those that close them or lie on the causal pathway.
Which intervention, comparison, and assumptions make a causal effect identifiable from the observed data? This note turns that question into a practical analysis workflow.
Core idea
Distinguish variables that open biasing paths from those that close them or lie on the causal pathway. The method is useful only when its target, data-generating assumptions, and unit of analysis match the scientific question.
The equation is a compact statement of the target; it is not a substitute for checking design and data quality. State what each observation represents, how it entered the sample, and which sources of dependence remain.
Practical workflow
- Write the scientific question and estimand in one sentence.
- Identify biological units, technical replicates, nesting, repeated measurements, and exclusions.
- Visualise raw observations and group structure before fitting the method.
- Check assumptions using design knowledge, diagnostic plots, and sensitivity analyses.
- Report the estimate, uncertainty, effect magnitude, sample sizes at every level, and limitations.
import numpy as np
# Standardised mean difference before adjustment.
treated = np.array([1.2, 1.4, 1.8, 2.0])
control = np.array([0.8, 1.0, 1.1, 1.3])
pooled_sd = np.sqrt((treated.var(ddof=1) + control.var(ddof=1)) / 2)
print((treated.mean() - control.mean()) / pooled_sd)
Interpretation and failure modes
Do not read a software output as an automatic scientific conclusion. Ask whether dependence was modeled, whether preprocessing used information from validation data, whether missingness or selection is informative, and whether the reported uncertainty covers every level of sampling. Prefer estimates and intervals to threshold-only language.
Microscopy case study
Selecting only successfully segmented cells can induce an association between treatment and morphology if both affect segmentation success.
Connections
Use the tags above to continue to notes on design, assumptions, uncertainty, diagnostics, and complementary methods. A robust analysis normally combines several concepts rather than selecting one test in isolation.