Skip to content

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qte — Quantile Treatment Effects in Python

This is an attempt at a Python implementation of the qte R package by Brantly Callaway from here.

The main features are:

  • Availability of cross-sectional quantile treatment effects and quantile treatment effects on the treated estimators (simple ,IPW, outcome regression, doubly robust);
  • Fast:
    • as opposed to the R-package we can use highly optimized Numpy functions for computing weighted quantiles;
    • quantile regression is magnitudes faster than in other Python packages since we use highly optimized Fortran code directly;
    • parallelism for bootstrapped standard errors;
    • batching and vectorization in performance critical places;
    • built natively on Polars;
  • Beautiful: Graphs and tables for the console, the web, and latex powered by Altair, Great Tables and Rich.

Installation


Example

  from qte.cross_sectional import estimate_aipw_qte
  from qte.datasets import load_lalonde

  ds = load_lalonde()

  res = estimate_aipw_qte(
      ds=ds,
      outcome_c="re78",
      treatment_c="treat",
      or_x_formular="age + education",
      ps_x_formular="age + education",
  )

  print(res)  # Rich table (not shown good for console) 
  res.plot()  # Vega-Altair plot (see below)
  res.tabulate() # Great Tables output (see below)

QTE Results Plot

AIPW QTE Results

QTE Results Table

AIPW QTE Table


Development

About

Quantile Treatment Effects in Python

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages