interFE | R Documentation |
Estimating interactive fixed effect models.
interFE(formula = NULL, data, Y, X = NULL, W = NULL,
index, r = 0, force = "two-way",
se = FALSE, nboots = 500, seed = NULL,
tol = 1e-3, max_iteration = 500,
binary = FALSE, QR = FALSE, normalize = FALSE)
formula |
an object of class "formula": a symbolic description of the model to be fitted. |
data |
a data frame. |
Y |
outcome variable. |
X |
time-varying covariates. |
W |
weights. |
index |
a two-element string vector specifying the unit (group) and time indicators. |
r |
an integer specifying the number of factors. |
force |
a string indicating whether unit/time/both fixed effects will be imposed: "none", "unit", "time", or "two-way". |
se |
logical; if |
nboots |
number of bootstrap runs (ignored if |
seed |
random seed. |
tol |
tolerance for EM algorithm. |
max_iteration |
max number of EM iterations. |
binary |
logical flag for a probit link (not fully supported here). |
QR |
logical flag for QR-based factor analysis in probit model (not fully supported). |
normalize |
logical; if |
interFE
estimates interactive fixed effect models as in Bai (2009).
beta |
estimated coefficients. |
mu |
estimated grand mean. |
factor |
estimated time-varying factors. |
lambda |
estimated factor loadings. |
VNT |
diagonal matrix of r eigenvalues. |
niter |
number of iterations before convergence. |
alpha |
estimated unit fixed effects (if imposed). |
xi |
estimated time fixed effects (if imposed). |
residuals |
model residuals. |
sigma2 |
residual mean squared error. |
IC |
information criterion. |
ValidX |
logical for whether valid covariates exist. |
dat.Y |
matrix of outcome data. |
dat.X |
array of independent variables. |
Y |
name of the outcome variable. |
X |
name of time-varying control variables. |
index |
name of unit/time indicators. |
est.table |
table of final estimates. |
est.boot |
matrix of bootstrap results. |
Licheng Liu; Ye Wang; Yiqing Xu
Bai, J. (2009). Panel data models with interactive fixed effects. Econometrica, 77(4), 1229-1279.
print.interFE
, fect
library(fect)
data(fect)
d <- simdata[-(1:150),] # remove the treated units
out <- interFE(Y ~ X1 + X2, data = d, index=c("id","time"),
r = 2, force = "two-way", nboots = 50)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.