IDEAS home Printed from https://ideas.repec.org/a/bpj/jecome/v5y2016i1p143-152n4.html
   My bibliography  Save this article

An Algorithm to Estimate the Two-Way Fixed Effects Model

Author

Listed:
  • Somaini Paulo

    (Department of Economics, MIT, Cambridge, MA, USA)

  • Wolak Frank A.

    (Department of Economics, Stanford University, Stanford, CA, USA)

Abstract

We present an algorithm to estimate the two-way fixed effect linear model. The algorithm relies on the Frisch-Waugh-Lovell theorem and applies to ordinary least squares (OLS), two-stage least squares (TSLS) and generalized method of moments (GMM) estimators. The coefficients of interest are computed using the residuals from the projection of all variables on the two sets of fixed effects. Our algorithm has three desirable features. First, it manages memory and computational resources efficiently which speeds up the computation of the estimates. Second, it allows the researcher to estimate multiple specifications using the same set of fixed effects at a very low computational cost. Third, the asymptotic variance of the parameters of interest can be consistently estimated using standard routines on the residualized data.

Suggested Citation

  • Somaini Paulo & Wolak Frank A., 2016. "An Algorithm to Estimate the Two-Way Fixed Effects Model," Journal of Econometric Methods, De Gruyter, vol. 5(1), pages 143-152, January.
  • Handle: RePEc:bpj:jecome:v:5:y:2016:i:1:p:143-152:n:4
    DOI: 10.1515/jem-2014-0008
    as

    Download full text from publisher

    File URL: https://doi.org/10.1515/jem-2014-0008
    Download Restriction: For access to full text, subscription to the journal or payment for the individual article is required.

    File URL: https://libkey.io/10.1515/jem-2014-0008?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    As the access to this document is restricted, you may want to search for a different version of it.

    References listed on IDEAS

    as
    1. Paulo Guimarães & Pedro Portugal, 2010. "A simple feasible procedure to fit models with high-dimensional fixed effects," Stata Journal, StataCorp LP, vol. 10(4), pages 628-649, December.
    2. John M. Abowd & Francis Kramarz & David N. Margolis, 1999. "High Wage Workers and High Wage Firms," Econometrica, Econometric Society, vol. 67(2), pages 251-334, March.
    3. Amine Ouazad, 2008. "A2REG: Stata module to estimate models with two fixed effects," Statistical Software Components S456942, Boston College Department of Economics.
    4. Anabela Carneiro & Paulo Guimarães & Pedro Portugal, 2012. "Real Wages and the Business Cycle: Accounting for Worker, Firm, and Job Title Heterogeneity," American Economic Journal: Macroeconomics, American Economic Association, vol. 4(2), pages 133-152, April.
    5. Jeffrey M Wooldridge, 2010. "Econometric Analysis of Cross Section and Panel Data," MIT Press Books, The MIT Press, edition 2, volume 1, number 0262232588, December.
    6. Sergio Correia, 2014. "REGHDFE: Stata module to perform linear or instrumental-variable regression absorbing any number of high-dimensional fixed effects," Statistical Software Components S457874, Boston College Department of Economics, revised 21 Aug 2023.
    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. Eugenio J. Miravete & Katja Seim & Jeff Thurk, 2020. "One Markup to Rule Them All: Taxation by Liquor Pricing Regulation," American Economic Journal: Microeconomics, American Economic Association, vol. 12(1), pages 1-41, February.
    2. Eugenio J. Miravete & Katja Seim & Jeff Thurk, 2018. "Market Power and the Laffer Curve," Econometrica, Econometric Society, vol. 86(5), pages 1651-1687, September.
    3. Frank R. LICHTENBERG, 2018. "The Impact of New Drug Launch on Life-Years Lost in 2015 from 19 Types of Cancer in 36 Countries," JODE - Journal of Demographic Economics, Cambridge University Press, vol. 84(3), pages 309-354, September.
    4. Mark Kattenberg & Bas Scheer & Jurre Thiel, 2023. "Causal forests with fixed effects for treatment effect heterogeneity in difference-in-differences," CPB Discussion Paper 452, CPB Netherlands Bureau for Economic Policy Analysis.
    5. Liping Wu & Kai Hu & Oleksii Lyulyov & Tetyana Pimonenko & Ishfaq Hamid, 2022. "The Impact of Government Subsidies on Technological Innovation in Agribusiness: The Case for China," Sustainability, MDPI, vol. 14(21), pages 1-15, October.
    6. Kleiner, Samuel A., 2019. "Hospital treatment and patient outcomes: Evidence from capacity constraints," Journal of Public Economics, Elsevier, vol. 175(C), pages 94-118.
    7. Jiyong Eom & Frank A. Wolak, 2020. "Breaking Routine for Energy Savings: An Appliance-level Analysis of Small Business Behavior under Dynamic Prices," NBER Working Papers 27263, National Bureau of Economic Research, Inc.
    8. Shi-jie Jiang & Lilin Wang & Feiyun Xiang, 2023. "The Effect of Agriculture Insurance on Agricultural Carbon Emissions in China: The Mediation Role of Low-Carbon Technology Innovation," Sustainability, MDPI, vol. 15(5), pages 1-20, March.
    9. Song, Haiyan & Xie, Karen & Park, Jinah & Chen, Wei, 2020. "Impact of accommodation sharing on tourist attractions," Annals of Tourism Research, Elsevier, vol. 80(C).

    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. Mion, Giordano & Opromolla, Luca David, 2014. "Managers' mobility, trade performance, and wages," Journal of International Economics, Elsevier, vol. 94(1), pages 85-101.
    2. Head, Keith & Mayer, Thierry, 2014. "Gravity Equations: Workhorse,Toolkit, and Cookbook," Handbook of International Economics, in: Gopinath, G. & Helpman, . & Rogoff, K. (ed.), Handbook of International Economics, edition 1, volume 4, chapter 0, pages 131-195, Elsevier.
    3. Köllö, János & Boza, István & Balázsi, László, 2021. "Wage gains from foreign ownership: evidence from linked employer-employee data," Journal for Labour Market Research, Institut für Arbeitsmarkt- und Berufsforschung (IAB), Nürnberg [Institute for Employment Research, Nuremberg, Germany], vol. 55, pages 1-3.
    4. Bombardini, Matilde & Orefice, Gianluca & Tito, Maria D., 2019. "Does exporting improve matching? Evidence from French employer-employee data," Journal of International Economics, Elsevier, vol. 117(C), pages 229-241.
    5. Gaure, Simen, 2014. "Practical Correlation Bias Correction in Two-way Fixed Effects Linear Regression," Memorandum 21/2014, Oslo University, Department of Economics.
    6. Cardoso, Ana Rute & Guimaraes, Paulo & Portugal, Pedro & Reis, Hugo, 2018. "The Returns to Schooling Unveiled," IZA Discussion Papers 11419, Institute of Labor Economics (IZA).
    7. Gaétan De Rassenfosse & Paul H. Jensen & T'Mir Julius & Alfons Palangkaraya & Elizabeth Webster, 2023. "Is the Patent System an Even Playing Field? The Effect of Patent Attorney Firms," Journal of Industrial Economics, Wiley Blackwell, vol. 71(1), pages 124-142, March.
    8. Wolff, François-Charles & Asche, Frank, 2022. "Pricing heterogeneity and transaction mode: Evidence from the French fish market," Journal of Economic Behavior & Organization, Elsevier, vol. 203(C), pages 67-79.
    9. Carneiro, Anabela & Portugal, Pedro & Raposo, Pedro & Rodrigues, Paulo M.M., 2023. "The persistence of wages," Journal of Econometrics, Elsevier, vol. 233(2), pages 596-611.
    10. Laurent Bergé, 2018. "Efficient estimation of maximum likelihood models with multiple fixed-effects: the R package FENmlm," DEM Discussion Paper Series 18-13, Department of Economics at the University of Luxembourg.
    11. Mario Larch & Joschka Wanner & Yoto V. Yotov & Thomas Zylkin, 2017. "The Currency Union Effect: A PPML Re-assessment with High-Dimensional Fixed Effects," CESifo Working Paper Series 6464, CESifo.
    12. repec:hal:wpspec:info:hdl:2441/dambferfb7dfprc9m01g1j1k2 is not listed on IDEAS
    13. Pedro Portugal & John T. Addison, 2015. "Sources of the Union Wage Gap: Results from High-Dimensional Fixed Effects Regression Models," Working Papers w201512, Banco de Portugal, Economics and Research Department.
    14. repec:hal:spmain:info:hdl:2441/dambferfb7dfprc9m01g1j1k2 is not listed on IDEAS
    15. Mion, Giordano & Opromolla, Luca David & Sforza, Alessandro, 2016. "The Diffusion of Knowledge via Managers' Mobility," CEPR Discussion Papers 11706, C.E.P.R. Discussion Papers.
    16. Addison, John T. & Portugal, Pedro & de Almeida Vilares, Hugo, 2023. "Union membership density and wages: The role of worker, firm, and job-title heterogeneity," Journal of Econometrics, Elsevier, vol. 233(2), pages 612-632.
    17. Pedro Portugal & Hugo Reis & Paulo Guimarães & Ana Rute Cardoso, 2023. "What lies behind returns to schooling: the role of labor market sorting and worker heterogeneity," Working Papers w202322, Banco de Portugal, Economics and Research Department.
    18. Gabriel Lyrio de Oliveira & Andre Luis Squarize Chagas & Denise Leyi Li, 2022. "Public Sector Procurements and Reference Prices Estimation with Small Samples in Brazil," Working Papers, Department of Economics 2022_02, University of São Paulo (FEA-USP).
    19. Pedro Portugal, 2020. "The sources of wage variability in Portugal: a binge reading survey," Economic Bulletin and Financial Stability Report Articles and Banco de Portugal Economic Studies, Banco de Portugal, Economics and Research Department.
    20. Barrela, Rodrigo & Costa, Eduardo & Portugal, Pedro, 2024. "On the Asymmetrical Sensitivity of the Distribution of Real Wages to Business Cycle Fluctuations," IZA Discussion Papers 16911, Institute of Labor Economics (IZA).
    21. Mario Macis & Fabiano Schivardi, 2016. "Exports and Wages: Rent Sharing, Workforce Composition, or Returns to Skills?," Journal of Labor Economics, University of Chicago Press, vol. 34(4), pages 945-978.
    22. da Silveira, Jaylson Jair & Lima, Gilberto Tadeu, 2021. "Wage inequality as a source of endogenous macroeconomic fluctuations," Structural Change and Economic Dynamics, Elsevier, vol. 56(C), pages 35-52.

    More about this item

    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:bpj:jecome:v:5:y:2016:i:1:p:143-152:n:4. 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: Peter Golla (email available below). General contact details of provider: https://www.degruyter.com .

    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.