Skip to main content

Quantile Regression

Quantile Regression estimates the effect of regressors on different quantiles of the distribution of YY — not just the mean as in OLS. It reveals how XX affects the "low", "median" and "high" groups differently (e.g. an effect on low-income vs high-income individuals).

When to use

Use Quantile Regression when you care about heterogeneous effects across the distribution, or when YY is skewed/has outliers so the OLS mean is unrepresentative. Median regression (τ=0.5\tau=0.5) is more robust to outliers than OLS.


Model specification

The τ\tau-th conditional quantile of YY given XX:

Qτ(YiXi)=Xiβ(τ)Q_{\tau}(Y_i \mid X_i) = X_i \beta(\tau)

Estimated by minimizing the asymmetrically weighted absolute errors (check function ρτ\rho_\tau):

β^(τ)=argminβiρτ(YiXiβ),ρτ(u)=u(τ1[u<0])\hat{\beta}(\tau) = \arg\min_{\beta} \sum_{i} \rho_{\tau}\big(Y_i - X_i\beta\big), \quad \rho_\tau(u) = u\,(\tau - \mathbb{1}[u<0])

Running in EcoLab

  1. Modeling module → Quantile regression family → Quantile.
  2. Select YY, the XX variables, and a list of quantiles τ\tau (e.g. 0.1, 0.25, 0.5, 0.75, 0.9).
  3. Run; read β(τ)\beta(\tau) per quantile + the quantile-process plot; bootstrap SE; export the replication code.

Replication code

* --- Quantile Regression ---
* Simultaneous quantile regression with bootstrap SE
sqreg lnwage educ exper, quantiles(0.25 0.5 0.75) reps(100)

* View results for each quantile
estimates table, stats(N)

Limitations

  • SE typically requires bootstrap; heavier computation than OLS.
  • Interpreting many quantiles is more complex than a single mean coefficient.

Video tutorial

Video Tutorial: Running Quantile Regression in EcoLab

See also