Continuous treatments and regression estimands

There’s an easy but false intuition that if you randomly assign a continuous treatment, a simple regression of the outcome on the treatment will get you an estimate of some type of average treatment effect.

If by the average treatment effect you mean something like “the change in \(Y\) induced by changing \(X\) from the bottom to the top of its range,” or “the change in \(Y\) induced by small changes in \(X\), averaged across all levels of \(X\)” then you might be disappointed. That’s not what the regression coefficient aims for.

In the below example the average effect (under both above definitions) is +1. But regression returns an estimate of -1.

So, wildly different.

Estimands

Yitzhaki (1996) describes the estimand that is targeted by the regression of \(Y\) on \(X\). It can indeed be interpreted as a weighted average of local average effects. But the weights aren’t obviously substantively relevant weights. In the case in which \(X\) is uniformly assigned (as above), the estimand puts a lot more weight on effects close to the middle of the \(X\) range.

Below is an implementation of the version of the estimand provided in Angrist and Krueger (1999) (equation (34), p 1312), which is good when \(X\) values are evenly spaced (though not necessarily uniform); for example if \(X\) is the number of years of schooling received by students.

# weights function
W <- function(x)
  sapply(unique(x) |> sort(), function(S)
    ((mean(x[x >= S]) - mean(x[x < S])) * (mean(x >= S) * (1 - (
      mean(x >= S)
    )))))

# estimand: assuming data at all values in integer range
yonx_estimand <- function(x, f) {
  xs <- unique(x) |> sort()
  ds <- ((f(xs) - f(lag(xs))) / (xs - lag(xs)))[-1]
  ws <- W(x)[-1]/sum(W(x)[-1])
  list(df = data.frame(local_effects=ds, weights = ws), 
       estimand = weighted.mean(ds, ws))
}

The example above is obviously an evil example but the issue arises more generally. In the below illustration there is a monotonic cubic function and we see much more weight on regions with small local effects.

# Illustration
f <- function(x) x ^ 3
x <- -5:5
y <- f(x)

yonx_estimand(x, f)$df |> ggplot(aes(local_effects,  weights)) + geom_point()

c(estimand = yonx_estimand(x, f)$estimand, estimate = (lm(y ~ x) |> coef())[2])
  estimand estimate.x 
      17.8       17.8 

References

Angrist, Joshua D, and Alan B Krueger. 1999. “Empirical Strategies in Labor Economics.” In Handbook of Labor Economics, 3:1277–1366. Elsevier.
Yitzhaki, Shlomo. 1996. “On Using Linear Regressions in Welfare Economics.” Journal of Business & Economic Statistics 14 (4): 478–86.