Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

  import polars as pl

  from qte.cross_sectional import estimate_aipw_qte

  df = pl.read_csv("lalonde.csv")

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

  print(res)

Development

About

Quantile Treatment Effects in Python

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages