Estimates fixed effects individual slope estimators by applying linear lm
models
to "detrended" data.
feis(
formula,
data,
id,
weights = NULL,
robust = FALSE,
intercept = FALSE,
dropgroups = FALSE,
tol = .Machine$double.eps,
...
)# S3 method for feis
formula(x, lhs = NULL, rhs = NULL, ...)
# S3 method for feis
terms(x, lhs = NULL, rhs = NULL, ...)
# S3 method for feis
residuals(object, ...)
# S3 method for feis
df.residual(object, ...)
# S3 method for feis
coef(object, ...)
# S3 method for feis
sigma(object, ...)
# S3 method for feis
deviance(object, ...)
# S3 method for feis
nobs(object, ...)
# S3 method for feis
fitted(object, ...)
# S3 method for feis
hatvalues(model, ...)
a symbolic description for the model to be fitted (see Details).
a data.frame
containing the specified variables.
the name of a unique group / person identifier (as string).
an optional vector of weights to be used in the fitting process. See lm
.
logical. If TRUE
estimates cluster robust standard errors (default is FALSE
).
logical. If TRUE
estimates the model with an intercept (default is FALSE
).
logical. If TRUE
groups without any within variance on a slope variable are dropped
, if FALSE
those variables are omitted for the respective groups only (default is FALSE
).
the tolerance for detecting linear dependencies in the residual maker transformation
(see solve
). The argument is forwarded to bsfeistest
.
further arguments.
indexes of the left- and right-hand side for the methods formula and terms.
an object of class "feis
".
An object of class "feis
", containing the following elements:
the vector of coefficients.
the scaled (if specified, robust) variance-covariance matrix of the coefficients.
See vcov.feis
for unscaled vcov
the vector of residuals (computed from the "detrended" data).
degrees of freedom of the residuals.
an object of class "Formula
" describing the model.
the original model frame as a data.frame
containing the original
variables used for estimation.
a constructed model frame as a data.frame
containing the predicted
values from the first stage regression using the slope variable(s) as predictor(s).
a constructed model frame as a data.frame
containing the "detrended"
variables used for the final model estimation.
Note that the weights are already used for detrending if specified.
the vector of the "detrended" response variable.
the vector of fitted values (computed from the "detrended" data).
a vector containing the unique person identifier.
a vector containing weights used in fitting, or integer 1 if not speficied in call.
the matched call.
assign attributes of the formula.
(where relevant) a vector of the omitted observations. The only handling method
of NA
s is "omit
".
(only where relevant) the contrasts used.
a list containing the used methods. Only "feis
" and "individual
" effects available.
a character vector containing the names of the slope variables.
R squared of the "detrended" model.
adjusted R squared of the "detrended" model.
a character containing the method used to compute the variance-covariance matrix.
the tolerance parameter (for use in bsfeistest).
feis
is a special function to estimate linear fixed effects models with individual-specific slopes.
In contrast to conventional fixed effects models, data are not person "demeaned", but "detrended" by
the predicted individual slope of each person
Bruderl.2015.387,Ruttenauer.2020,Wooldridge.2010.384feisr.
Estimation requires at least q+1
observations per unit, where q
is the number of slope
parameters (including a constant).
feis
automatically selects only those groups from the current data set which have at least q+1
observations.
The function returns a warning if units with <q+1
observations are dropped.
The function requires a two-part formula, in which the second part indicates the slope parameter(s).
If, for example, the model is y ~ x1 + x2
, with the slope variables x3
and x4
,
the model can be estimated with:
formula = y ~ x1 + x2 | x3 + x4
To estimate a conventional fixed effects model without individual slopes, please use
y ~ x1 + x2 | 1
to indicate that the slopes should only contain an individual-specific intercept.
If specified, feis
estimates panel-robust standard errors. Panel-robust standard errors are
robust to arbitrary forms of serial correlation within groups formed by id
as well as
heteroscedasticity across groups @see @Wooldridge.2010.384, pp. 379-381feisr.
The model output can be exported using the texreg
package.
summary.feis
, plm
, pvcm
,
pmg
, feistest
# NOT RUN {
data("mwp", package = "feisr")
feis.mod <- feis(lnw ~ marry + enrol + as.factor(yeargr) | exp + I(exp^2),
data = mwp, id = "id", robust = TRUE)
summary(feis.mod)
# }
Run the code above in your browser using DataLab