feis {feisr} | R Documentation |
Fixed Effects Individual Slope Estimator
Description
Estimates fixed effects individual slope estimators by applying linear lm
models
to "detrended" data.
Usage
feis(
formula,
data,
id,
weights = NULL,
robust = FALSE,
intercept = FALSE,
dropgroups = FALSE,
tol = .Machine$double.eps,
...
)
## S3 method for class 'feis'
formula(x, lhs = NULL, rhs = NULL, ...)
## S3 method for class 'feis'
terms(x, lhs = NULL, rhs = NULL, ...)
## S3 method for class 'feis'
residuals(object, ...)
## S3 method for class 'feis'
df.residual(object, ...)
## S3 method for class 'feis'
coef(object, ...)
## S3 method for class 'feis'
sigma(object, ...)
## S3 method for class 'feis'
deviance(object, ...)
## S3 method for class 'feis'
nobs(object, ...)
## S3 method for class 'feis'
fitted(object, ...)
## S3 method for class 'feis'
hatvalues(model, ...)
Arguments
formula |
a symbolic description for the model to be fitted (see Details). |
data |
a |
id |
the name of a unique group / person identifier (as string). |
weights |
an optional vector of weights to be used in the fitting process. See |
robust |
logical. If |
intercept |
logical. If |
dropgroups |
logical. If |
tol |
the tolerance for detecting linear dependencies in the residual maker transformation
(see |
... |
further arguments. |
lhs , rhs |
indexes of the left- and right-hand side for the methods formula and terms. |
object , x , model |
an object of class " |
Details
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
(Bruederl and Ludwig 2015; Ruettenauer and Ludwig 2020; Wooldridge 2010).
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, pp. 379-381).
The model output can be exported using the texreg
package.
Value
An object of class "feis
", containing the following elements:
coefficients |
the vector of coefficients. |
vcov |
the scaled (if specified, robust) variance-covariance matrix of the coefficients.
See |
.
residuals |
the vector of residuals (computed from the "detrended" data). |
df.residual |
degrees of freedom of the residuals. |
formula |
an object of class " |
model |
the original model frame as a |
modelhat |
a constructed model frame as a |
modeltrans |
a constructed model frame as a |
response |
the vector of the "detrended" response variable. |
fitted.values |
the vector of fitted values (computed from the "detrended" data). |
id |
a vector containing the unique person identifier. |
weights |
a vector containing weights used in fitting, or integer 1 if not speficied in call. |
call |
the matched call. |
assign |
assign attributes of the formula. |
na.omit |
(where relevant) a vector of the omitted observations. The only handling method
of |
contrasts |
(only where relevant) the contrasts used. |
arg |
a list containing the used methods. Only " |
slopevars |
a character vector containing the names of the slope variables. |
r2 |
R squared of the "detrended" model. |
adj.r2 |
adjusted R squared of the "detrended" model. |
vcov_arg |
a character containing the method used to compute the variance-covariance matrix. |
tol |
the tolerance parameter (for use in bsfeistest). |
References
Bruederl J, Ludwig V (2015).
“Fixed-Effects Panel Regression.”
In Best H, Wolf C (eds.), The Sage Handbook of Regression Analysis and Causal Inference, 327–357.
Sage, Los Angeles.
ISBN 1446252442.
Ruettenauer T, Ludwig V (2020).
“Fixed Effects Individual Slopes: Accounting and Testing for Heterogeneous Effects in Panel Data or Other Multilevel Models.”
Sociological Methods and Research, OnlineFirst.
ISSN 0049-1241, doi: 10.1177/0049124120926211.
Wooldridge JM (2010).
Econometric Analysis of Cross Section and Panel Data.
MIT Press, Cambridge, Mass.
ISBN 0262294354.
See Also
summary.feis
, plm
, pvcm
,
pmg
, feistest
Examples
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)