fdid – User Manual
Welcome
This Quarto book serves as a user tutorial for the fdid package in R, which implements the Factorial Difference-in-Differences (FDID) framework introduced by Xu et al. (2026)[Paper]. This design is tailored for panel data settings where all units are exposed to a universal event but vary in a baseline factor \(G\) (currently supported as binary).
fdid provides two main functions:
fdid_prepare(): reshapes long format panel data into a widefdid()-ready format.fdid(): performs factorial difference-in-differences estimation using several methods.
And two S3 methods:
summary(): summarizes the estimation results.plot(): visualizes raw means, dynamic effects, and model comparisons.
Organization
The user tutorial is structured into the following chapters:
Chapter 1 Get Started
Installation instructions and dataset description.Chapter 2 Binary G
Data preparation, estimation with binary \(G\), and basic plots.Chapter 3 Continuous G
Estimation with continuous \(G\) using linear methods.Chapter 4 Visualization Options
Extended visualization options and method comparisons.Chapter 5 Sensitivity Analysis
Sensitivity analysis for unmeasured confounding usingsensemakr.
Contributors
- Rivka Lipkovitz (MIT)
- Enhan Liu (UChicago Harris)
- Yiqing Xu (Stanford)
Report bugs
Please report any bugs to me (yiqingxu [at] stanford.edu) or submit an issue on GitHub. Please include your minimally replicable code and data files and a panelView treatment status plot. Your feedback is highly valued!