Skip to content

Quantile Regression Tutorials

Learning Path

Prerequisites: Static Models tutorials, basic understanding of quantiles Time: 4--8 hours Level: Intermediate -- Advanced

Overview

Standard regression focuses on the conditional mean. Quantile regression extends this to model the entire conditional distribution, revealing how covariates affect different parts of the outcome distribution differently. For example, a policy might reduce income inequality not by changing the mean but by raising the lower quantiles relative to the upper ones.

These tutorials cover pooled quantile regression, fixed effects quantile methods (Canay two-step and penalized approaches), location-scale models, bootstrap inference, and quantile treatment effects (QTE). You will learn to estimate quantile processes, test for heterogeneous effects, and ensure monotonicity across quantiles.

The existing Quantile Treatment Effects Tutorial provides additional depth on QTE methods, and the Panel Quantile Regression notebook offers a self-contained introduction.

Notebooks

# Tutorial Level Time Colab
1 Quantile Regression Fundamentals Intermediate 45 min Open In Colab
2 Multiple Quantiles & Process Plots Intermediate 45 min Open In Colab
3 Fixed Effects (Canay Two-Step) Intermediate 45 min Open In Colab
4 Fixed Effects (Penalized) Advanced 45 min Open In Colab
5 Location-Scale Models Advanced 45 min Open In Colab
6 Advanced Diagnostics Advanced 45 min Open In Colab
7 Bootstrap Inference Advanced 45 min Open In Colab
8 Monotonicity & Non-Crossing Advanced 45 min Open In Colab
9 Quantile Treatment Effects Advanced 60 min Open In Colab
10 Dynamic Quantile Models Advanced 60 min Open In Colab

Learning Paths

Essential (4 hours)

Core quantile methods for applied research:

Notebooks: 1, 2, 3, 5

Covers fundamentals, quantile process estimation, fixed effects quantile (Canay), and location-scale models.

Complete (8 hours)

Master every quantile technique:

Notebooks: 1--10

Adds penalized FE, diagnostics, bootstrap inference, non-crossing constraints, QTE, and dynamic models.

Key Concepts Covered

  • Quantile regression: Modeling conditional quantiles instead of the mean
  • Quantile process: Estimating a full range of quantiles (e.g., 0.10 to 0.90)
  • Canay two-step: Fixed effects quantile regression via mean-demeaning
  • Penalized FE quantile: Alternative approach with regularization
  • Location-scale models: Joint modeling of location and scale
  • Bootstrap inference: Resampling-based confidence intervals and tests
  • Monotonicity: Ensuring quantile functions do not cross
  • QTE: Quantile treatment effects for heterogeneous impacts
  • Dynamic quantile: Quantile regression with lagged dependent variables

Quick Example

from panelbox.models.quantile import CanayTwoStep

# Canay two-step FE quantile regression
model = CanayTwoStep(
    data=data,
    formula="wage ~ education + experience",
    entity_col="id",
    time_col="year",
    quantiles=[0.10, 0.25, 0.50, 0.75, 0.90]
).fit()

print(model.summary())

Solutions

Tutorial Solution
01. Fundamentals Solution
02. Multiple Quantiles Solution
03. Canay Two-Step Solution
04. Penalized FE Solution
05. Location-Scale Solution
06. Advanced Diagnostics Solution
07. Bootstrap Inference Solution
08. Non-Crossing Solution
09. QTE Solution
10. Dynamic Quantile Solution