An algorithm to estimate the two-way fixed effects model

Paulo Somaini, Frank A. Wolak

Research output: Contribution to journalArticleResearchpeer-review

15 Citations (Scopus)

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.

Original languageEnglish
Pages (from-to)143-152
Number of pages10
JournalJournal of Econometric Methods
Volume5
Issue number1
DOIs
Publication statusPublished - 2016
Externally publishedYes

Keywords

  • Frisch-Waugh-Lovell theorem
  • GMM
  • OLS
  • panel data
  • two-way fixed effects

Cite this