
The economist’s data analysis skillset.
We check four assumptions to trust our model’s results.
Today we focus on Assumption 3: Independence: the problem of timeseries.
We often want to model relationships through time.

Data related in time has a special problem:
We can check whether values in timeseries are related to their own past values.
A Lag Plot shows the value today (\(t\)) against the value yesterday (\(t-1\)).

Autocorrelation tells us whether today’s value depends on yesterday’s value.
The standard approach has problems with time series.
\[\text{Y} = \beta_0 + \beta_1 \cdot \text{t} + \varepsilon\]

The standard approach has problems with time series.
\[\text{Y} = \beta_0 + \beta_1 \cdot \text{t} + \varepsilon\]

This model is often wrong in the same direction repeatedly.
This ‘levels’ model shows strong patterns in residuals (autocorrelation).
\[\text{Y} = \beta_0 + \beta_1 \cdot \text{t} + \varepsilon\]

Okun’s Law: when unemployment rises, GDP tends to fall.
We can fix some issues of autocorrelation by looking at changes instead of levels.
\[\Delta \text{Y}_t = \text{Y}_t - \text{Y}_{t-1}\]

Looking at changes instead of levels shows no relationship (correctly here).
What would first differences look like if there WAS a positive trend?
What would first differences look like if there WAS a positive trend?

What would first differences look like if there WAS a positive trend?

The vertical intercept \(\beta_0\) is positive!
The slope coefficient \(\beta_1\) is zero!
First differences reduces but does not eliminate the problem of autocorrelation.

Examine a first difference model of the relationship between GDP and unemployment.
Sometimes we want to measure how two variables move together.
\[\Delta \text{Y}_t = \beta_0 + \beta_1 \times \Delta \text{X}_t + \varepsilon_t\]

Relating changes in X to changes in Y.
\[\Delta \text{Y}_t = \beta_0 + \beta_1 \times \Delta \text{X}_t + \varepsilon_t\]
Examine a double first difference model of the relationship between GDP and unemployment.
\(\beta_1\) now represents the short-term relationship between changes in X and Y
Proportional changes provide interpretable coefficients:
\[g_Y = \frac{\text{Y}_t - \text{Y}_{t-1}}{\text{Y}_{t-1}} = \frac{\Delta \text{Y}_t}{\text{Y}_{t-1}}\]

Proportional changes provide interpretable coefficients:
\[g_Y = \frac{\text{Y}_t - \text{Y}_{t-1}}{\text{Y}_{t-1}} = \frac{\Delta \text{Y}_t}{\text{Y}_{t-1}}\]

Proportional changes provide interpretable coefficients:
\[g_Y = \frac{\text{Y}_t - \text{Y}_{t-1}}{\text{Y}_{t-1}} = \frac{\Delta \text{Y}_t}{\text{Y}_{t-1}}\]

Is the growth in Y related to the growth in X?
\[g_Y = \beta_0 + \beta_1 \times g_X + \varepsilon_t\]

Is the growth in Y related to the growth in X?
\[g_Y = \beta_0 + \beta_1 \times g_X + \varepsilon_t\]
Growth rate models have the advantages of first differences and can scale better.
Examine a growth rates model of the relationship between GDP and unemployment.
# Step 1. Calculate growth rates (percentage changes)
data['gdp_growth'] = data['gdp'].pct_change() # in percentage points
data['unemployment_growth'] = data['unemployment'].pct_change()Autocorrelation can be reduced but not eliminated.
| Model | Equation | \(\beta_1\) Interpretation | Best For |
|---|---|---|---|
| Levels | \(Y = \beta_0 + \beta_1 X + \varepsilon\) | Relationship between levels | Cross-sectional data |
| First Diff | \(\Delta Y = \beta_0 + \beta_1 \Delta X + \varepsilon\) | Short-term relationship between changes | Trending time series |
| Growth Rates | \(g_Y = \beta_0 + \beta_1 g_X + \varepsilon\) | Response of \(Y\)’s growth to \(X\)’s growth | Exponentially growing series |
Always check the residual lag plot. Differencing reduces autocorrelation but rarely eliminates it entirely.