IDEAS home Printed from https://ideas.repec.org/p/bdm/wpaper/2024-09.html

Policy Effect Estimation and Visualization in Linear Panel Event-Study Designs: Introducing the xtevent Package

Author

Listed:
  • Simon Freyaldenhoven
  • Christian B. Hansen
  • Jorge Pérez Pérez
  • Jesse M. Shapiro
  • Constantino Carreto

Abstract

Linear panel models and the "event-study plots" that often accompany them are popular tools for learning about policy effects. In this paper, we introduce the "xtevent" package for Stata, which enables the construction of event-study plots following the suggestions in Freyaldenhoven et al. (forthcoming). The package implements various procedures to estimate the policy effects that underlie the plots, and allows for non-binary policy variables and estimation adjusting for pre-event trends.

Suggested Citation

  • Simon Freyaldenhoven & Christian B. Hansen & Jorge Pérez Pérez & Jesse M. Shapiro & Constantino Carreto, 2024. "Policy Effect Estimation and Visualization in Linear Panel Event-Study Designs: Introducing the xtevent Package," Working Papers 2024-09, Banco de México.
  • Handle: RePEc:bdm:wpaper:2024-09
    as

    Download full text from publisher

    File URL: https://www.banxico.org.mx/publications-and-press/banco-de-mexico-working-papers/%7B51E05FBE-873C-0672-EA70-80F5056E5950%7D.pdf
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Goodman-Bacon, Andrew, 2021. "Difference-in-differences with variation in treatment timing," Journal of Econometrics, Elsevier, vol. 225(2), pages 254-277.
    2. Jonathan Roth, 2022. "Pretest with Caution: Event-Study Estimates after Testing for Parallel Trends," American Economic Review: Insights, American Economic Association, vol. 4(3), pages 305-322, September.
    3. Hansen, Christian B., 2007. "Generalized least squares inference in panel and multilevel models with serial correlation and fixed effects," Journal of Econometrics, Elsevier, vol. 140(2), pages 670-694, October.
    4. Simon Freyaldenhoven & Christian Hansen & Jesse M. Shapiro, 2019. "Pre-event Trends in the Panel Event-Study Design," American Economic Review, American Economic Association, vol. 109(9), pages 3307-3338, September.
    5. Kurt Schmidheiny & Sebastian Siegloch, 2023. "On event studies and distributed‐lags in two‐way fixed effects models: Identification, equivalence, and generalization," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 38(5), pages 695-713, August.
    6. Jonas Hjort & Jonas Poulsen, 2019. "The Arrival of Fast Internet and Employment in Africa," American Economic Review, American Economic Association, vol. 109(3), pages 1032-1079, March.
    7. Carlos Dobkin & Amy Finkelstein & Raymond Kluender & Matthew J. Notowidigdo, 2018. "The Economic Consequences of Hospital Admissions," American Economic Review, American Economic Association, vol. 108(2), pages 308-352, February.
    8. Amemiya, Takeshi, 1978. "A Note on a Random Coefficients Model," International Economic Review, Department of Economics, University of Pennsylvania and Osaka University Institute of Social and Economic Research Association, vol. 19(3), pages 793-796, October.
    9. Athey, Susan & Imbens, Guido W., 2022. "Design-based analysis in Difference-In-Differences settings with staggered adoption," Journal of Econometrics, Elsevier, vol. 226(1), pages 62-79.
    10. Sun, Liyang & Abraham, Sarah, 2021. "Estimating dynamic treatment effects in event studies with heterogeneous treatment effects," Journal of Econometrics, Elsevier, vol. 225(2), pages 175-199.
    11. Brantly Callaway & Andrew Goodman-Bacon & Pedro H. C. Sant'Anna, 2021. "Difference-in-Differences with a Continuous Treatment," Papers 2107.02637, arXiv.org, revised Dec 2025.
    12. Callaway, Brantly & Sant’Anna, Pedro H.C., 2021. "Difference-in-Differences with multiple time periods," Journal of Econometrics, Elsevier, vol. 225(2), pages 200-230.
    13. Freyberger, Joachim & Rai, Yoshiyasu, 2018. "Uniform confidence bands: Characterization and optimality," Journal of Econometrics, Elsevier, vol. 204(1), pages 119-130.
    14. Richard V. Burkhauser & Drew McNichols & Joseph J. Sabia, 2023. "Minimum Wages and Poverty: New Evidence from Dynamic Difference-in-Differences Estimates," NBER Working Papers 31182, National Bureau of Economic Research, Inc.
    15. Paulo Guimarães & Pedro Portugal, 2010. "A simple feasible procedure to fit models with high-dimensional fixed effects," Stata Journal, StataCorp LLC, vol. 10(4), pages 628-649, December.
    16. Alessandra Fenizia & Raffaele Saggio, 2024. "Organized Crime and Economic Growth: Evidence from Municipalities Infiltrated by the Mafia," American Economic Review, American Economic Association, vol. 114(7), pages 2171-2200, July.
    17. Sumedha Gupta & Dario Salcedo & Kosali I. Simon, 2024. "School Closures and Parental Mental Health," NBER Working Papers 32516, National Bureau of Economic Research, Inc.
    Full references (including those not matched with items on IDEAS)

    Citations

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


    Cited by:

    1. Sulin Sardoschau & Annalí Casanueva Artís & Analì Casanueva Artìs, 2025. "The Cost of Tolerating Intolerance: Right-Wing Protest and Hate Crimes," CESifo Working Paper Series 11745, CESifo.
    2. Sulin Sardoschau & Annali Casanueva-Artis, 2025. "The Cost of Tolerating Intolerance: Right-wing Protest and Hate Crimes," RFBerlin Discussion Paper Series 2508, ROCKWOOL Foundation Berlin (RFBerlin).

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Constantino Carreto & Simon Freyaldenhoven & Christian Hansen & Jorge Perez Perez & Jesse Shapiro, 2024. "xtevent: Estimation and Visualization in the Linear Panel Event-Study Design," Working Papers 24-15, Federal Reserve Bank of Philadelphia.
    2. Fayssal Ayad & Ahlam Delmadji, 2025. "Fifty shades of sustainable development: a global study," Environment, Development and Sustainability: A Multidisciplinary Approach to the Theory and Practice of Sustainable Development, Springer, vol. 27(7), pages 16739-16771, July.
    3. Roth, Jonathan & Sant’Anna, Pedro H.C. & Bilinski, Alyssa & Poe, John, 2023. "What’s trending in difference-in-differences? A synthesis of the recent econometrics literature," Journal of Econometrics, Elsevier, vol. 235(2), pages 2218-2244.
    4. Arne Henningsen & Guy Low & David Wuepper & Tobias Dalhaus & Hugo Storm & Dagim Belay & Stefan Hirsch, 2024. "Estimating Causal Effects with Observational Data: Guidelines for Agricultural and Applied Economists," IFRO Working Paper 2024/03, University of Copenhagen, Department of Food and Resource Economics.
    5. Clément de Chaisemartin & Xavier D’Haultfœuille, 2023. "Two-way fixed effects and differences-in-differences with heterogeneous treatment effects: a survey," The Econometrics Journal, Royal Economic Society, vol. 26(3), pages 1-30.
    6. Yadav, Anil & McHale, John & O'Neill, Stephen, 2023. "How does co-authoring with a star affect scientists' productivity? Evidence from small open economies," Research Policy, Elsevier, vol. 52(1).
    7. Chu, Ziyan & Zhou, Yichen Christy, 2023. "The effect of adopting the Next Generation Air Transportation System (NextGen) on air travel performance," Regional Science and Urban Economics, Elsevier, vol. 102(C).
    8. Damian Clarke & Kathya Tapia-Schythe, 2021. "Implementing the panel event study," Stata Journal, StataCorp LLC, vol. 21(4), pages 853-884, December.
    9. Simon Freyaldenhoven & Christian Hansen & Jorge Pérez Pérez & Jesse M. Shapiro, 2021. "Visualization, Identification, and Estimation in the Linear Panel Event-Study Design," NBER Working Papers 29170, National Bureau of Economic Research, Inc.
    10. Dmitry Arkhangelsky & Guido Imbens, 2023. "Causal Models for Longitudinal and Panel Data: A Survey," Papers 2311.15458, arXiv.org, revised Jun 2024.
    11. Carter, Colin A. & Steinbach, Sandro & Zhuang, Xiting, 2022. "Global Shipping Container Disruptions and U.S. Agricultural Exports," Working Papers 320397, International Agricultural Trade Research Consortium.
    12. Santiago Garriga & Dario Tortarolo, 2024. "Wage effects of means-tested transfers: Incidence implications of using firms as intermediaries," IFS Working Papers W24/49, Institute for Fiscal Studies.
    13. repec:osf:socarx:v75aw_v1 is not listed on IDEAS
    14. Leek, Lauren & Bischl, Simeon, 2025. "How central bank independence shapes monetary policy communication: A Large Language Model application," European Journal of Political Economy, Elsevier, vol. 87(C).
    15. Kurt Schmidheiny & Sebastian Siegloch, 2023. "On event studies and distributed‐lags in two‐way fixed effects models: Identification, equivalence, and generalization," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 38(5), pages 695-713, August.
    16. Li, Yutao & Zhang, Jinning & Lyu, Yanwei, 2023. "Does telecommunications infrastructure promote entrepreneurship in developing countries? Evidence from a quasi-natural experiment in China," Structural Change and Economic Dynamics, Elsevier, vol. 66(C), pages 106-119.
    17. Sumit Agarwal & Slava Mikhed & Barry Scholnick & Man Zhang, 2022. "Reducing Strategic Default in a Financial Crisis," Working Papers 21-36, Federal Reserve Bank of Philadelphia.
    18. Sarah Gust, 2024. "(Not) Going to School in Times of Climate Change: Natural Disasters and Student Achievement," ifo Working Paper Series 413, ifo Institute - Leibniz Institute for Economic Research at the University of Munich.
    19. Carter, Colin A. & Steinbach, Sandro & Zhuang, Xiting, 2022. "Global Container Trade Disruptions and U.S. Agricultural Exports," 2022 Annual Meeting, July 31-August 2, Anaheim, California 322364, Agricultural and Applied Economics Association.
    20. Hoyos, Mateo, 2024. "Tariffs and Growth: Heterogeneity by Economic Structure," SocArXiv v75aw, Center for Open Science.
    21. Bukin, Eduard & Robinson, Sarah & Petrick, Martin, 2025. "The effects of land privatization on pasture productivity in south-eastern Kazakhstan," EconStor Open Access Articles and Book Chapters, ZBW - Leibniz Information Centre for Economics, vol. 158, pages 1-18.

    More about this item

    Keywords

    ;
    ;
    ;
    ;
    ;

    JEL classification:

    • C23 - Mathematical and Quantitative Methods - - Single Equation Models; Single Variables - - - Models with Panel Data; Spatio-temporal Models
    • C87 - Mathematical and Quantitative Methods - - Data Collection and Data Estimation Methodology; Computer Programs - - - Econometric Software
    • C53 - Mathematical and Quantitative Methods - - Econometric Modeling - - - Forecasting and Prediction Models; Simulation Methods

    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:bdm:wpaper:2024-09. 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.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with 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: Subgerencia de desarrollo de sistemas (email available below). General contact details of provider: https://edirc.repec.org/data/bangvmx.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.