A Simple Method to Estimate Large Fixed Effects Models Applied to Wage Determinants

Models with high-dimensional sets of fixed effects are frequently used to examine, among others, linked employer-employee data, student outcomes and migration. Estimating these models is computationally difficult because of the high-dimensional design matrix. I present a simple algorithm to compute the OLS estimates of large two-way fixed effects (TWFE) and match effect models including estimates of the fixed effects. The algorithm simplifies specification tests and variance estimation even with multi-way clustered errors. An application using German linked employer-employee data illustrates key advantages of the algorithm: Omitting match effects substantially affects estimates including the gender wage gap. Analyzing the estimated fixed effects suggest that firm fixed effects are the main channel through which job transitions drive wage dynamics, which underlines the importance of firm heterogeneity for labor market dynamics. JEL Classification: J31, J63, C23, C63


Introduction
Following the seminal article on the two way fixed effects model (TWFE) by Abowd, Kramarz and Margolis (1999), models with large sets of fixed effects are frequently used to examine a wide range of topics in labor economics (see Abowd, Kramarz and Woodcock 2008 for an overview), education (e.g. Jacob and Lefgren 2008, Kramarz, Machin and Ouazad 2008, Jackson 2013, health (e.g. Bennett, Hung and Lauderdale 2015) and migration (Grogger and Hanson 2011). The match effects model extends the TWFE by including the interaction of the two fixed effects, e.g. a match or job fixed effect. Match effects are of interest whenever the way in which agents are paired with each other matters, which is likely in many interactions of heterogeneous populations. For example, theories of matching between employers and firms (e.g. Jovanovic 1979, Mortensen 1978 usually allow for complementarities between workers and firms, which could be captured by adding a match effect to the firm and individual effects of the TWFE. However, the computational complexity of both models makes specification and estimation difficult. Even in the simpler TWFE the number of fixed effects often exceeds one million, so that regression coefficients cannot be computed from the standard formula, because it is impossible to invert the cross-product of the design matrix. This paper introduces a fast and simple method to estimate the TWFE and the match effects model making use of the fact that after purging all covariates, formulas for the inverse of partitioned matrices yield a computationally simple solution for one set of fixed effects. This simplification makes the remaining parameters easy to compute. The algorithm I propose in this paper yields the exact OLS solutions including estimates of the fixed effects. It computes the variance matrix of the estimated slope coefficients (but SEs of the fixed effects have to be bootstrapped if needed) even if errors are correlated across observations.
A key advantage of the algorithm is that its computational complexity grows in the number of firms (i.e. the dimension of the smaller set of fixed effects) rather than in the number of individuals and firms. Thereby, the algorithm I propose solves or greatly simplifies the computational problem. I analyze wage determinants using linked employer-employee data from Germany to illustrate key advantages of the algorithm. First, the algorithm facilitates specification tests in two ways. It reduces the computational burden of estimating both the TWFE and the match effects, which simplifies tests for the presence of match effects. The omission of match effects can bias estimates if the pairing of agents matter, which is common in applications (e.g. Garen 1989, Jackson 2013, Woodcock 2008. The variance matrix of the estimated slopes computed by the algorithm is crucial for significance and model specification tests, but often requires bootstraping or partial regression. Both strategies require solving the estimation problem repeatedly, which amplifies the computational problem. The application to German data shows that excluding match effects affects estimates of key parameters, as among others the unexplained part of the gender wage gap doubles. Estimating the variance matrix of the slopes makes it possible to test for changes in these slope parameters. Using a Hausman-type test shows that match effects matter for the slope parameters, even though they only explain a relatively small share of the variation in wages (Card, Heining and Kline 2013).
In addition, the method introduced here simplifies the computation of firm-, individual-and (if relevant) match components. Estimates of the fixed effects are often of substantive interest themselves. Several parameters of interest can be calculated from the estimates of the individual and firm fixed effects (e.g. Abowd, Kramarz, Roux 2006) and teacher fixed effects are commonly used as measures of value added (e.g. Rockoff 2004). Estimates of the match effects are of interest in search models (Woodcock 2015), matching of teachers and schools (Jackson 2013) as well as international migration (Grogger and Hanson 2011). Examining what predicts the firm and match fixed effects after job transitions in the German data underlines that firms are not only of importance for wage dispersion (Card, Heining and Kline 2013), but also for wage dynamics. The next section describes the two models, estimation problems and common methods. Part 3 introduces the algorithm. Part 4 illustrates key advantages of the algorithm by analyzing wage determinants.

The Two-Way Fixed Effects and the Match Effects Model
A common specification in panel data models is the two-way fixed effects model which includes a set of fixed effects for primary units indexed by = 1, … , and secondary units indexed by = 1, … , . I define the secondary unit as the smaller unit in the sense that < without loss of generality. For simplicity, I discuss these models in terms of a regression of (log) wages on covariates that includes fixed effects for individuals, firms, and possibly individual-firm matches. Let indicate the number of observations on individual . Similarly, let stand for the number of observations on firm , so that the total number of observations is * = ∑ =1 = ∑ =1 . The model allows both and to vary between units, so the panel does not have to be balanced. The TWFE model can be expressed as * ×1 Where is a vector of outcomes of individual at firm at time , . is a matrix of observable timevarying covariates, is the matrix of indicators for individuals, Ψ is the matrix of indicators for firms and is the vector of unobservables . The parameters of the model are , the vector of slopes, , the vector of individual fixed effects and Ψ, the vector of firm fixed effects . The match effects model (see e.g. Woodcock 2008Woodcock , 2015 extends the TWFE by adding the interaction between the two fixed effects: * ×1 is the matrix of indicators for matches between the two units and is the vector of match fixed effects , where = 1, … , is for convenience only as it is determined by and . To ease notation, define = ′ Ψ So that is an × diagonal matrix with the number of observations on individual as the i th diagonal element and is a × diagonal matrix with the number of observations on firm as the j th diagonal element. Element ( , ) of the × matrix indicates how many periods individual worked for firm . Abowd, Creecy, and Kramarz (2002)  properties and other normalizations are easily to implement. It makes the match effects exactly orthogonal to and Ψ by construction, but they are not necessarily orthogonal to . Thus, omitting match effects in a model without time-varying regressors yields numerically identical estimates of and Ψ, but if the model includes omitting them is likely to affect ̂ as well as � and Ψ � .
Estimating the models above by inverting the cross-product of the data matrix is computationally infeasible, because it requires the inverse of a ( + + ) × ( + + ) matrix for the TWFE (( + + + ) × ( + + + ) for the match effects model). In typical datasets, this number easily 1 Many questions concern comparisons within firm or individual, so the estimated match effects are informative. The data and hence the estimated match effects contain no information on other questions, such as correlations between match quality and time-invariant attributes or comparing match quality across firms or individuals. exceeds one million. Calculations with matrices of this size require infeasible amounts of memory and time. 2 For an overview of computational approaches and alternative estimators (such as random or mixed effects), see Abowd, Kramarz and Woodcock (2008) and Andrews, Schank and Upward (2006). Woodcock (2015) shows that the match effect model can be reduced to solving a problem of size + by first calculating match means and then decomposing them into the three sets of fixed effects. So both models can be estimated by solving a problem of similar size, but this problem is too large to compute estimates from the standard OLS formulas, because it is infeasible to invert the cross-product of the data matrix.
One approach to reduce computational complexity is to iteratively solve the normal equations, without inverting the cross-product matrix. For example, the conjugate gradient algorithm (CGA, see Abowd,

A Computationally Simple Estimation Strategy
The algorithm I present below uses a transformation to obtain the slopes, reduces the dimensionality of the matrix and then solves a system of linear equations rather than inverting a matrix. The algorithm proceeds in three steps: First, compute the slope parameters ̂. Second, compute the smaller set of fixed 2 E.g., a matrix with one million rows and columns stored in double precisions requires 8 TB of working memory. Matrix inversion requires computation of cubic order. Computation would still be infeasible if the current lower bound in Le Gall (2014) were practicable. Many algorithms only need to compute matrix factorizations (such as the Cholesky-factorization), which slightly alleviates the computational problem, but mainly improves numerical stability. For simplicity, I will refer to the need to "invert" the matrix throughout the paper.
effects. Third, compute the remaining fixed effects. I first discuss the estimation of the match effects model, then show how to apply it to the TWFE model. I then discuss variance estimation and briefly compare the algorithm to other strategies.
The first step for the match effects model is to compute ̂, the slopes defined by eq. 2 which can be done by an OLS regression of deviations of and from their match means. This procedure is equivalent to running a partial regression. Therefore, the estimates, residuals and standard errors (corrected for the degrees of freedom) are numerically identical to those that would be obtained from OLS estimation of the full model (Yule 1907). To see how calculating ̂ simplifies computing the smaller set of fixed effects in the second step, note that ̂ is the OLS estimate, so the OLS estimates of the fixed effects can be obtained by a regression of � = −̂ on the individual and firm fixed effects. 3 The normalization that match effects sum to zero within each firm and individual allows one to omit the match effects in this regression because the model does not contain . 4 Note that this simplification requires the first step of purging the effect of , because the match effects need not be exactly orthogonal to the firm and individual effects after conditioning on the covariates. Estimates from a regression of � on the individual and firm fixed effects are then given by the standard formula: where � � and � � are vectors of individual and firm means of � and , and are defined by eq. 3.
The second step is to calculate the firm fixed effects (or, more generally, the smaller set of fixed effects).
To do so, one only needs the lower blocks of the inverse of the partitioned matrix. These blocks can be obtained by applying the formula for the inverse of a partitioned matrix (see Theil 1971 section 1.2): 3 For proof, see e.g. Greene (2008 p. 27) or appendix A. 4 Proof: In a regression without time-varying covariates , the omitting the match effects results in the usual omitted variable bias: . This bias is 0 by construction, because ′ = 0 and Ψ ′ = 0 hold exactly within sample by normalizing match effects to sum to zero within individual and firm.
and are diagonal matrices and has at most S non-zero elements, so they are sparse. All three matrices contain only integers. Consequently, these expressions are simple to evaluate. The only remaining computational difficulty is inverting the matrix in the first brackets. It is of size × (and remains symmetric positive definite), so it is already much smaller than the ( + + + ) × ( + + + ) matrix in the standard OLS formula. Inverting it directly yields estimates of the firm fixed effects and their standard errors. One can also use iterative algorithms such as the CGA to solve the much smaller × system of equations implied by equation 5.
The third step of calculating the remaining fixed effects is simple, because residuals sum to zero for each individual, firm and match. Therefore, the individual fixed effects can be recovered from the estimated firm fixed effects and the individual means. The individual mean contains the average firm effect of the firms for which individual i worked, weighted by match length. The vector of these averages is equal to −1 Ψ � , so that the OLS estimate of the individual fixed effects is: Finally, the match effects can be computed from the match means: Where � and � � are × 1 vectors containing the match means of and −̂ and � is the × matrix containing the match means of . Both calculations are computationally trivial.
The same algorithm can be applied to the TWFE model with one modification: In the TWFE model, the OLS predictions are different from the match means even if there really are no match effects, 5 which makes the first step more complicated: One needs to run a partial regression by regressing and each column of on the individual and firm fixed effects and use the residuals to obtain ̂, the coefficient on in the TWFE model. Implementation is simplified by the fact that these regressions have the same covariates (the two sets of fixed effects only) as the regression solved by equation 4. Consequently, one can use the same simplification as above by solving equation 5 and 6 repeatedly for each column of in place of . This modified first step is a simple way to implement the transformation proposed by Wansbeek and Kapteyn (1989) and Davis (2002). Rather than inverting the whole ( + ) × ( + ) matrix, it only requires computation of the inverse of ( − ′ −1 ). This matrix is later used to compute the firm fixed effects, so it only needs to be computed once and can be reused in the auxiliary regressions for and all elements of as well as to obtain the estimates of the firm fixed effects from � after ̂ has been calculated. This advantage does not apply when using the CGA to solve equation 5, which has to be repeated for each covariate. In most cases, however, solving equation 5 with the CGA is a matter of seconds.
After this step, estimation proceeds exactly as in the match effects model: One obtains estimates of ̂ from a partial regression, subtracts the fitted values from to obtain � and obtain the firm fixed effects either using the CGA or the inverse of ( − ′ −1 ) from the partial regressions to solve equation 5. The individual effects are then given by equation 6.

Estimating variance matrices
5 To see this, note that the projection matrix of the match effect model computes the match means, which is not the case for the projection matrix of the TWFE model, The common strategy to simplify computation by iteratively solving the normal equations complicates inference, because it avoids inverting the cross-product of the data matrix, which is a key component of asymptotic formulas for the variance matrix. 6 Using the bootstrap amplifies the computational problem and is additionally complicated by the necessity to maintain a connected sample (see Woodcock 2015 Appendix B for subsampling connected groups), especially when errors are correlated within firm or individual (Cameron, Gelbach and Miller 2011). The algorithm here yields the block of the inverse matrix corresponding to ̂, so the asymptotic variance matrix is simple to compute regardless of whether is correlated across observations or not. SEs are frequently calculated under the assumption of uncorrelated errors, even though it is frequently violated in panel data and can seriously distort rejection rates (Kezdi 2004). In most applications, errors are likely correlated within both units for which fixed effects are included. Two-way clustered standard errors of the slopes are simple to obtain based on the covariance matrix from the partial regression to obtain ̂ above. See Appendix B for an example.
Thereby, the algorithm facilitates specification tests that appear of key relevance in common applications, because misspecification in these models is just as problematic as in standard regressions. The TWFE is a constrained match effects model that restricts all match effects to equal zero, which causes bias if the restrictions do not hold (Woodcock 2008). The restrictions can be examined by testing whether the slope coefficients change (which requires estimating their variance matrix) or by comparing the restricted TWFE to the unrestricted match effects model (which requires estimating both models). A likely reason why such tests are rarely conducted is that it is often impossible or prohibitively costly to compute these tests.
The method here estimates the variance matrix of the slopes and simplifies estimating the unrestricted model, thereby making both tests feasible.

Key Advantages and Comparison to Other Methods
6 See Cattaneo, Jansson and Newey (2018a) for a discussion of whether standard asymptotics apply. However, the alternative asymptotic formulas also require the (upper block) of ([ Ψ ]′[ Ψ ]) −1 (see e.g. Cattaneo, Jansson and Newey, 2016a,b), so the problems discussed below apply in the same way.
In summary, the algorithm I propose facilitates estimating the fixed effects and specification tests. In addition, it reduces the computational burden by requiring less memory and computation time. The memory and time requirements and how they compare to other algorithms are case specific and depend heavily on the implementation. 7 In theory, the factor dominating computational complexity is the size of the problem to be solved. For iterative solutions, both memory required and computation time grow (at least) by the square of the size of the problem. For direct solutions via Matrix inversion, computation time is of cubic order. Thus, the key simplification of the algorithm I propose stems from reducing the problem to size . To illustrate the computational advantages of the approach above for a specific case (despite the caveats on comparability), Table 1   Note: Column 1 reports computation time from estimating the match effects model using the algorithm described here, the remaining columns estimate the TWFE. Column 2 uses the method in this paper. Column 3 uses the within transformation described in Cornelissen (2008), column 4 uses the CGA (Abowd, Creecy and Kramarz, 2002) implemented by Ouazad (2007). Columns 5 and 6 use the alternating projections methods by Guimarães and Portugal (2010) and Correia (2014). All times are the average of 5 iterations in minutes. See appendix C for details on the simulation setup. There are 5 covariates and 10 observations per individual. Individuals move to a randomly chosen firm either once (with probability 0.16) or twice (with probability 0.04). All simulations were run single-threaded on a computer with 74 GB of main memory. * indicates that the program optionally calculates the statistic of interest, but it was not done in the simulation and may slightly increase computation time.
The within transformation proposed by Andrews, Schank and Upward (2006) implemented by Cornelissen (2008) solves a problem of size + . I additionally exploit the simple structure of the matrix and solve the smaller problem by the CGA rather than directly. Column 3 of Table 1 shows that these additions speeds up computation dramatically, particularly as the size of the problem grows. The within transformation algorithm does not work for large problems, because the within transformation is more memory intensive than iterative solutions. The CGA approach by Abowd, Creecy and Kramarz (2002) implemented in Ouazad (2007) solves a problem of size + + . Even in the most unfavorable case, my approach cuts the size of the problem in half. The results in column 4 show that this cuts computation time by a factor of two to three. The CGA scales well, so both approaches can solve large problems.
Columns 5 and 6 report times from two implementations of the alternating projections approach by Guimarães and Portugal (2010) and Correia (2014). Arcidiacono et al. (2012) and Gaure (2013) also propose solutions based on alternating projections, all of which iteratively solve a problem of size + + . The implementation by Guimarães and Portugal (2010) becomes very slow as the size of the problem grows. The program by Correia (2014) scales better in terms of computation time. An advantage of these solutions is their ease of implementation and that they are easier to extend to more than two sets of fixed effects and non-linear models.

Application to Wage Determinants and Matching in Germany
I use the algorithm introduced above to examine wage determinants using linked employer-employee data from Germany (LIAB mover model 9308). The data cover 1993 to 2008 and are designed to estimate models with individual and firm fixed effects. They only include firms that employed at least one worker who also worked for another firm in the panel, i.e. only firms for which the firm effect is identified. They contain all workers who moved between firms in the panel. My final sample contains 9,891,519 observations from 3,068,373 individuals working at 24,323 firms. 9 Appendix D provides further information on the data, potential issues such as topcoding as well as the sample I use. Appendix E reports summary statistics. I focus on key results that illustrate advantages of the algorithm I propose, mainly documenting that the inclusion of match effects affects estimates of key parameters and underlining the value of estimating and analyzing the fixed effects. Full results of all models are in appendix F.
I first use the algorithm described above to estimate a rich wage regression. I regress the log of person 's daily wage at firm in time period (w ijt ) on characteristics of person ( ), and firm ( ) as well as year, firm, individual and match fixed effects: To analyze the effect of omitting the match effects, I also estimate the TWFE model, which omits from equation 8. I allow for two-way clustering, i.e. errors can be arbitrarily correlated within firms and individuals. I then use estimated fixed effects in the following regressions: where and are time invariant characteristics of firms and individuals. Such models can be used to examine which time-invariant characteristics of firms ( ) and individuals ( ) predict that a firm pays or an individual receives high wages.  (2013), the variance of the match effects is small relative to the variance of the individual and firm fixed effects. Yet, the difference in the explained sum of squares in Table A5 shows that match effects explain more than 25 percent of the unexplained wage dispersion in Germany.
In addition, including match effects appears to be important for the estimates of the slope coefficients. A Hausman-type test for equality of the slope coefficients between the two models clearly rejects the TWFE (p-value of .00). 10 Conducting this test requires the variance matrices of the slope coefficients, thereby emphasizing an advantage of the algorithm proposed here that automatically estimates this variance matrix.   Table A5 in Appendix F reports all coefficients of the regression in Panel A. Table  A6 contains coefficients from regressing firm fixed effects on firm characteristics (not reported in this table). Table A7 reports all coefficients from the regressions of individual fixed effects on time invariant characteristics in panel B. Standard errors are clustered at the firm and individual level. *: Significant at 5%; **: Significant at 1%; ***: Significant at 0.1%.
An important question is whether the omission of match effects leads to wrong conclusions. Comparing the results from the TWFE and the match effects model in Table 2 reveals substantive differences: The returns to experience and tenure are flatter in the TWFE. 11 Part of the large difference between part-and full-time jobs in the TWFE is also due to the omission of match effects. The consequences of omitting the match effects follow from standard omitted variable bias formulas, which simplify because the normalizations of the match effects make some terms mechanically equal zero. As Woodcock (2008, p.779 especially equation 16) points out, the effect of omitting the match effects on the estimated slope coefficients arises from the conditional covariance between and , given and Ψ . That is, the bias arises from match dummies being more predictive of the included covariates than firm and individual dummies only. For example, part-time jobs tend to be worse matches than full-time jobs, even when only comparing jobs within individual and firm (i.e. conditional on and Ψ ). Thus, failing to control for match quality overstates the wage difference between part-and full-time jobs.
The lower part of Table 2 shows that omitting match effects not only affects the estimated slopes, but also the fixed effects and hence parameters calculated from them. Most importantly, the estimated gender wage gap in the TWFE is almost twice as large as the 5% gap in the match effects model. The differs by gender, where [ Ψ ] is the matrix that projects out and Ψ . Match and individual dummies are orthogonal ( ′ = 0), but not conditional on and firm dummies, i.e.
can be non-zero. This term weights the match effects by a term that depends on gender differences in the covariates. These weights may differ between jobs due to time-varying characteristics, which explains why the bias can be non-zero even though match effects sum to zero for each person and hence for both males and females. Covariates in equation 10 makes this problem more complex. line with this logic, the overall bias in the gender wage gap is negative. Even though it is an indirect effect, the bias is substantial, which emphasizes that even if one is only interested in the fixed effects, one should not be casual about the choice of regressors and the fixed effect structure.
In addition to the slope coefficients, estimates of the fixed effects are of interest for a wide range of topics including wage differentials (e.g. Woodcock 2015), wage dynamics (e.g. Abowd, Kramarz and Roux 2006), inequality (e.g. Card, Heining and Kline 2013), teacher value added (e.g. Rockoff 2004) and teacher mobility (Jackson 2013). In order to illustrate that the fixed effects produced by the method introduced in this paper can be used to shed light on the importance of various mechanisms, I analyze how pre-match characteristics affect the permanent wage components of the subsequent job, i.e. the firm and match fixed effect. Estimating the fixed effects and relating them to pre-match characteristics, such as whether the match was preceded by an unemployment spell, allows me to assess whether these effects are partly due to the conditions when matches are formed. Permanent wage effects of the conditions under which matches are formed have been documented for, among others, employment after mass layoffs (e.g.
Jacobson, LaLonde and Sullivan 1993), economic conditions during job search (e.g. Oreopolous, von Wachter and Heisz 2012, Schmieder, von Wachter and Heining 2018) and age of the employee (e.g. Topel and Ward 1992). Most previous papers restricted attention to jobs after a particular event, such as mass layoffs, that affect only a small fraction of individuals in order to isolate the effect of a specific factor (e.g. involuntary unemployment in case of mass layoffs) on subsequent wages.
Being able to estimate both firm and match fixed effects for a large sample of movers, I look at these permanent wage effects from a different angle. Rather than restricting the sample to specific job transitions (e.g., transitions following a mass layoff), I use all individuals with two or more jobs and exploit the rich information in the IAB data to measure the circumstances before employment. To do so, I regress match effects and the corresponding firm effects on pre-match characteristics: where Ψ � is the estimated firm fixed effect of the firm that match s corresponds to and is a vector of variables measured at the time match is formed.
The sum of the two effects is the expected difference between the wage of the job an individual accepted and the wage at a randomly assigned job by virtue of both match and firm effects being normalized to sum to zero. Thus, the results provide evidence on the circumstances that lead to matches with permanently high or low wages. The results are in table 3: 13 The first column provides evidence on the conditions under which job transitions lead to good matches between worker and firm, i.e. wages that are unusually high for both the worker and the firm. The second column examines which characteristics lead to a worker being matched with a high-wage firm, i.e. a firm that pays high wages to all employees.
Involuntary job transitions have long lasting negative effects, but job transitions are also an important source of wage growth (Topel and Ward 1992). The results in table 3 clarify that permanent wage changes at job transitions are primarily due to moving to higher paying firms: The small coefficients and the low 2 in column 1 of Table 3 show that the relation between match quality and observable pre-match characteristics is weak compared to firm effects. Consequently, firm heterogeneity not only plays an important role in wage dispersion (Gruetter and Lalive 2009), rising inequality (Card, Heining and Kline 2013), the effects of unemployment insurance (Nekoei andWeber 2017, Schmieder, von Wachter andHeining 2018), but is also a key part of wage dynamics over the life-cycle. The coefficients on the dummies for the type of transition (job-to-job, non-employment-to-job, training-to-job and initial job) 14 in table 3 suggest that this importance of firm heterogeneity not only applies to job-to-job transitions as Haltiwanger, Hyatt and McEntarfer (2018) document. The omitted category is job-to-job transitions, so as most search models would predict, initial employment is a slightly worse match. All other wage effects of the type and duration of the previous labor market state operate through the firm fixed effect: initial employment and employment after an episode without employment is at lower paying firms than job-tojob transitions (by 8 and 6 percentage points). These results suggest that the "job ladder" also plays a key role for other transition types and that workers may travel it in both directions.  Note: 665,080 observations. The omitted employment status before the current match is "employment at a different firm". Only selected coefficients are reported, Table A8 in Appendix F reports all coefficients. *: Significant at 5%; **: Significant at 1%; ***: Significant at 0.1%.

Conclusion
Models with two or more large sets of fixed effects are heavily used in a wide range of fields such as labor economics, education, health and migration. Their advantages are widely recognized, but their use is limited by computational difficulties. I propose a simple method to compute the OLS estimates of the TWFE and the match effects model in large data sets that substantially reduces computational complexity.
It not only offers advantages in terms of speed and computational resources needed, but also simplifies estimation of the fixed effects and the variance matrix of the slopes that can allow for multi-way clustering.
Using the algorithm to analyze wage determinants in Germany underlines key advantages: Important parameter estimates, such as the gender wage gap, change substantially when including match effects.
The algorithm I propose facilitates detecting and formally testing for such changes. The application underlines the usefulness of computing the fixed effects, because analyzing them can provide insights on economic questions regardless of their status as structural parameters. In particular, firm fixed effects play a key role in determining the gains and losses from job transitions, emphasizing the importance of firms in wage dynamics.