*! version 0.3 12apr2017

Title

reghdfe -- Linear models with interactive fixed effects

Syntax

regife
depvar [indepvars]
[if] [in] [weight]
,
ife(idvar timevar, ndmis)
[options]

Description

regife fits a model with interactive fixed effects following Bai (2009). If you want to fit a model with interacted fixed effects, use reghdfe. Optionally, it saves the estimated interactive fixed effects. Errors are computed following the regressions indicated in Section 6, but Monte Carlo evidence suggest bootstraps performs better in finite sample. The program requires reghdfe and hdfe to be installed (both are available on SSC).

Options

ife(idvar timevar, ndims) specifies the id variable, time variable, and the dimension of the factor model. To save the estimated interactive fixed effects, write
ife(ife_idvar = idvar ife_timevar = timevar, ndims).

absorb(absvar[...]) identifiers of the fixed effects that will be absorbed. To save the estimated fixed effects, write absorb(fe_absvar = absvar).

vce(vcetype[, opt]) vcetype}
is unadjusted/ols (default), robust, bootrap or cluster clustervars. Monte carlo evidence suggests that bootstrap performs better in finite sample

tolerance(#) specifies the tolerance criterion for convergence; default is tolerance(1e-9)

maxiterations(#) specifies the maximum number of iterations; default is maxiterations(5000). 0 corresponds to an illimited number of iterations

residuals(newvar) save residuals

bstart(matrix) start the iteration algorithm at a given value for b

fweights, aweights and pweights are allowed but should be constant within idvar; see weight.

Examples

Setup

. webuse nlswork

. keep if id <= 100

Factor model in id, year of dimension 1

. regife ln_w tenure, ife(id year, 1)

Model including id fixed effect, and a factor model in id, year of dimension 2

. regife ln_w tenure, a(id) ife(id year, 1)

Model including id fixed effect, year fixed effect, and a factor model in id, year of dimension 1

. regife ln_w tenure, a(id year) ife(id year, 1)

Save interactive fixed effects

. regife ln_w tenure, ife(ife_id = id ife_year = year, 1)

Save fixed effects and interactive fixed effects

. regife ln_w tenure, a(fe_id = id fe_year = year) ife(ife_id = id ife_year = year, 1)

Generate residuals

. regife ln_w tenure, ife(id year, 1) residuals(newvar)

Bootstrap standard errros

. regife ln_w tenure, ife(id year, 1) vce(bootstrap)

Block bootstrap with respect to id

. regife ln_w tenure, ife(id year, 1) vce(bootstrap, cluster(id))

Stored results

regife stores the following in e():

Scalars

e(N) number of observations

e(df_r) residual degrees of freedom

e(df_m) model degrees of freedom

e(F) residual sum of squares

e(mss) total sum of squares

e(rss) residual sum of squares

e(iterations) number of iterations

e(error) convergence error

Macros

e(cmd) regife

e(depvar) name of dependent variable

e(indepvars) names of independent variables

e(id) id variable

e(time) time variable

e(dimension) dimension

e(congerged) did the algorithm converge?

References

regife implements the estimate proposed by:

Jushan Bai. "Panel Data Models with Interactive Fixed Effects".
Econometrica, 77.4 (2009): 1229-1279.

Author

Matthieu Gomez

Department of Economics, Princeton University

Please report issues on Github
https://github.com/matthieugomez/stata-regife