fdid – User Tutorial

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, Zhao, and Ding (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 wide fdid()-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:

Contributors

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!

fect: Lifecycle: experimental License: MIT downloads: CRAN