Shifting Variables in Time
Lead/Lag transformations shift variables forward (lead) or backward (lag) in time, allowing you to model delayed or anticipated effects in your MMM.
What Are Lags and Leads?
Lag (Backward Shift)
Definition: Use past values of a variable
Example:
Original TV_Spend:
Week 1: $10,000
Week 2: $12,000
Week 3: $8,000
TV_Spend_lag1 (1-week lag):
Week 1: (missing)
Week 2: $10,000 ← Last week's value
Week 3: $12,000 ← Last week's value
Use Case: Model delayed effects
Lead (Forward Shift)
Definition: Use future values of a variable
Example:
Use Case: Model anticipatory behavior (rare in MMM)
When to Use Lags
Delayed Marketing Effects
Scenario: Direct mail takes 2-3 weeks to generate responses
Solution:
Interpretation: Direct mail sent 2 weeks ago affects today's sales
Price Adjustments
Scenario: Price changes take time for consumers to notice
Solution:
Economic Indicators
Scenario: Macroeconomic factors affect business with delay
Solution:
When NOT to Use Lags
Don't Confuse with Adstock
Lag ≠ Adstock:
Lag: Uses only the past value (single period)
Adstock: Accumulates decaying effects across multiple periods
Example:
For media channels, use Adstock, not Lag
Creating Lead/Lag Variables
In Variable Workshop
Step 1: Select base variable
Step 2: Choose "Lead/Lag Transformation"
Step 3: Configure:
Direction: Lag (backward) or Lead (forward)
Periods: Number of weeks/months to shift (1, 2, 3...)
Step 4: Preview transformation
Step 5: Create variable
Naming Convention
Recommended format:
Testing Different Lag Lengths
Create multiple lags to test:
Test in model: Which lag has highest t-statistic?
Use: Most significant lag period
Distributed Lag Models (Advanced)
Include multiple lags simultaneously:
Captures: Effect distributed across multiple periods
Note: Can cause multicollinearity - use cautiously
Handling Missing Values
First Period Issue
Problem: Lag creates missing value for first observation
Example:
MixModeler Solution: First period automatically filled with zero or excluded from analysis
✅ Use lags for non-media variables (price, promotions, direct mail)
✅ Test multiple lag lengths (1, 2, 3 periods) to find optimal
✅ Use adstock for media channels (not lags)
✅ Document lag choice rationale (why 2 weeks, not 1 or 3?)
❌ Don't over-lag (rarely need more than 4-week lag)
Key Points:
⏮️ Lags shift backward - use past values
⏭️ Leads shift forward - use future values (rare)
⏱️ For delayed effects - direct mail, price changes, economic factors
🎯 Test multiple periods - find optimal lag length
🚫 Not for media channels - use adstock instead for carryover
Simple but powerful transformation for modeling time-delayed relationships!
Last updated