feis | R Documentation |
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 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, ...)
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 " |
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
\insertCiteBruderl.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 \insertCite@see @Wooldridge.2010.384, pp. 379-381feisr.
The model output can be exported using the texreg
package.
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). |
summary.feis
, plm
, pvcm
,
pmg
, feistest
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.