IDEAS home Printed from https://ideas.repec.org/c/boc/bocode/s459771.html

DIDDESIGN: Stata module to perform Double Difference-in-Differences Estimation

Author

Listed:
  • Xuanyu Cai

    (City University of Macau)

  • Wenli Xu

    (City University of Macau)

Programming Language

Abstract

diddesign implements the Double Difference-in-Differences (Double DID) method from Egami and Yamauchi (2023). The method optimally combines the standard DID estimator with the sequential DID (s-DID) estimator using GMM weights to improve efficiency while maintaining robustness. For standard DID designs (design(did)), the command estimates both DID and s-DID, then computes the GMM-optimal weighted combination (Double DID). When kmax() is set to a value greater than 2 and sufficient pre-treatment periods are available, the command uses the generalized K-DID estimator from Appendix E of Egami and Yamauchi (2023), combining up to K moment conditions via GMM. The k-th component uses the k-th order parallel trends assumption, which can account for (k-1)-th degree polynomial time-varying confounding. For staggered adoption (SA) designs (design(sa)), the command handles multiple treatment timing groups and computes time-weighted averages across cohorts.

Suggested Citation

  • Xuanyu Cai & Wenli Xu, 2026. "DIDDESIGN: Stata module to perform Double Difference-in-Differences Estimation," Statistical Software Components S459771, Boston College Department of Economics, revised 04 Jul 2026.
  • Handle: RePEc:boc:bocode:s459771
    Note: This module should be installed from within Stata by typing "ssc install diddesign". The module is made available under terms of the MIT license (https://opensource.org/licenses/MIT).
    as

    Download full text from publisher

    File URL: http://fmwww.bc.edu/repec/bocode/d/diddesign.ado
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/d/diddesign.sthlp
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/l/ldiddesign.mlib
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_diddesign_display_footer.ado
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_diddesign_display_header.ado
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_diddesign_display_result.ado
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_diddesign_display_table_header.ado
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_diddesign_error.ado
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_diddesign_expand_covariates.ado
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_diddesign_load_mata.ado
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_diddesign_parallel_boot.ado
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_diddesign_parallel_worker.ado
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_diddesign_parse.ado
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_diddesign_prep.ado
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_diddesign_sa.ado
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_diddesign_utils.ado
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/_/_diddesign_warning.ado
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/c/compile_mlib.do
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/d/diddesign_check.ado
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/d/diddesign_mata.do
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/d/diddesign_plot.ado
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/d/diddesign_check.sthlp
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/d/diddesign_intro.sthlp
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/d/diddesign_plot.sthlp
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/e/example_kdid.do
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/e/example_malesky.do
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/e/example_paglayan.do
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/malesky2014.dta
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/p/paglayan2019.dta
    Download Restriction: no
    ---><---

    More about this item

    Keywords

    ;
    ;
    ;

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:boc:bocode:s459771. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Christopher F Baum (email available below). General contact details of provider: https://edirc.repec.org/data/debocus.html .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.