IDEAS home Printed from
   My bibliography  Save this article

Estimation of pre- and posttreatment average treatment effects with binary time-varying treatment using Stata


  • Giovanni Cerulli

    () (National Research Council of Italy)

  • Marco Ventura

    () (Sapienza University of Rome)


In this article, we describe tvdiff, a community-contributed command that implements a generalization of the difference-in-differences estimator to the case of binary time-varying treatment with pre- and postintervention peri- ods. tvdiff is flexible and can accommodate many actual situations, enabling the user to specify the number of pre- and postintervention periods and a graphical representation of the estimated coefficients. In addition, tvdiff provides two dis- tinct tests for the necessary condition of the identification of causal effects, namely, two tests for the so-called parallel-trend assumption. tvdiff is intended to sim- plify applied works on program evaluation and causal inference when longitudinal data are available.

Suggested Citation

  • Giovanni Cerulli & Marco Ventura, 2019. "Estimation of pre- and posttreatment average treatment effects with binary time-varying treatment using Stata," Stata Journal, StataCorp LP, vol. 19(3), pages 551-565, September.
  • Handle: RePEc:tsj:stataj:v:19:y:2019:i:3:p:551-565
    DOI: 10.1177/1536867X19874224
    Note: to access software from within Stata, net describe

    Download full text from publisher

    File URL:
    File Function: link to article purchase
    Download Restriction: no


    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.

    Cited by:

    1. Crespi, Gustavo & Figal Garone, Lucas & Maffioli, Alessandro & Stein, Ernesto, 2020. "Public support to R&D, productivity, and spillover effects: Firm-level evidence from Chile," World Development, Elsevier, vol. 130(C).
    2. Ana Maria Diaz & Luz Magdalena Salas & Ana María Tribín-Uribe, 2020. "Hidden benefits of peace: The case of sexual violence," Borradores de Economia 1124, Banco de la Republica de Colombia.
    3. Cappelletti, Giuseppe & Ponte Marques, Aurea & Salleo, Carmelo & Martín, Diego Vila, 2020. "How do banking groups react to macroprudential policies? Cross-border spillover effects of higher capital buffers on lending, risk-taking and internal markets," Working Paper Series 2497, European Central Bank.


    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:tsj:stataj:v:19:y:2019:i:3:p:551-565. See general information about how to correct material in RePEc.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: (Christopher F. Baum) or (Lisa Gilmore). General contact details of provider: .

    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 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.

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

    IDEAS is a RePEc service hosted by the Research Division of the Federal Reserve Bank of St. Louis . RePEc uses bibliographic data supplied by the respective publishers.