Skip to content

getrecast/bad-controls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bad Controls — Companion Code

This repository contains the companion code and figures for the article "Bad Controls: Variable Selection Mistakes Hiding Within Marketing Models" by Recast. The article makes the case that variable selection in marketing mix models is a causal question, not a statistical one: including the wrong controls (mediators or colliders) can bias your estimates just as badly as omitting the right ones.

To demonstrate this, the article walks through three simulated scenarios at a fictional crypto exchange and HVAC chain where the true incremental ROI is known up front (the "oracle"), and then compares what a correctly-specified model recovers against what a model with one extra "bad" control reports.

The code here reproduces the claims and figures in the article: companion-scripts/included-variable-bias-crypto.py and included-variable-bias-crypto.R implement three scenarios — the mediator trap (paid social → organic search → sales, oracle ROI 1.2x), the collider trap (ad spend and sales both cause customer inquiries, oracle ROI 1.5x), and the HVAC noise scenario (BTC price is correlated with ad spend but not on any causal path to sales, oracle ROI 1.0x).

The .qmd and .mmd files render the DAGs used in the article, and figures/ holds the final PNGs. Data is generated inline in each script — there are no external data dependencies.

About

Bad Controls: Variable Selection Mistakes Hiding Within Marketing Models

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors