Performs placebo-in-time sensitivity analysis to validate causal claims. Use when checking model robustness, verifying lack of pre-intervention effects, or ensuring observed effects are not spurious.
Installation
Details
Usage
After installing, this skill will be available to your AI coding assistant.
Verify installation:
skills listSkill Instructions
name: running-placebo-analysis description: Performs placebo-in-time sensitivity analysis to validate causal claims. Use when checking model robustness, verifying lack of pre-intervention effects, or ensuring observed effects are not spurious.
Running Placebo Analysis
Executes placebo-in-time sensitivity analysis to validate causal experiments.
Workflow
- Define Experiment Factory: Create a function that returns a fitted CausalPy experiment (e.g., ITS, DiD, SC) given a dataset and time boundaries.
- Configure Analysis: Initialize
PlaceboAnalysiswith the factory, dataset, intervention dates, and number of folds (cuts). - Run Analysis: Execute
.run()to fit models on pre-intervention data folds. - Evaluate Results: Compare placebo effects (which should be null) to the actual intervention effect. Use histograms and hierarchical models to quantify the "status quo" distribution.
Key Concepts
- Placebo-in-time: Simulating an intervention at a time when none occurred to check if the model falsely detects an effect.
- Fold: A slice of pre-intervention data used to test a placebo period.
- Factory Pattern: Decouples the placebo logic from the specific CausalPy experiment type.
References
- Placebo-in-time Implementation: Full code for the
PlaceboAnalysisclass, usage examples, and hierarchical status-quo modeling.
More by pymc-labs
View allSelects the appropriate quasi-experimental method (DiD, ITS, SC) based on data structure and research questions. Use when the user is unsure which method to apply.
Interactive development in marimo notebooks with validation loops. Use for creating/editing marimo notebooks and verifying execution.
Fits causal models, estimates impacts, and plots results using CausalPy. Use when performing analysis with DiD, ITS, SC, or RD.
Loads internal CausalPy example datasets. Use when the user needs example data or asks about available demos.