Learn R Programming

contdid

An R package for difference-in-differences with a continuous treatment.

Installation

You can install the development version of contdid from GitHub with:

# install.packages("devtools")
devtools::install_github("bcallaway11/contdid")

library(contdid)

Package Status: Alpha Version

This is an alpha version of the contdid package. The core features are implemented and functional, but the package remains under active development. The API may change, and additional functionality is planned.

We welcome feedback and encourage users to report bugs or other issues via the GitHub Issues page.

✅ Currently Supported

  • ☑️ Continuous treatments
  • ☑️ Staggered treatment adoption (i.e., more than two periods and variation in timing across units)
  • ☑️ Aggregations into dose-specific ATT’s or ACRT’s
  • ☑️ Aggregations into ATT or ACRT versions of event studies
  • ☑️ User-specified flexible parametric models for treatment effects as a function of the dose

Copy Link

Version

Install

install.packages('contdid')

Monthly Downloads

205

Version

0.1.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Brantly Callaway

Last Published

July 3rd, 2025

Functions in contdid (0.1.0)

setup_pte_cont

Setup for DiD with a Continuous Treatment
choose_knots_quantile

Choose Knots at Quantiles
cont_two_by_two_subset

Continuous Two-by-Two Subset
choose_knots_even

Choose Evenly Spaced Knots
cont_did_acrt

Compute ACRT's for a Timing Group and Time Period
ggcont_did

Plot Results with a Continuous Treatment
cont_did

Difference-in-differences with a Continuous Treatment
simulate_contdid_data

Simulate data for DiD with a Continuous Treatment
contdid-package

Difference-in-differences with a continuous treatment