Estimates a bootstrapped Hausman test for fixed effects individual slope models.
bsfeistest(
model = NA,
type = c("all", "bs1", "bs2", "bs3"),
terms = NULL,
rep = 500,
seed = NULL,
prog = TRUE,
...
)
an object of class "feis
".
one of "all
" (the Default), "bs1
" for test of FEIS against FE only,
"bs2
" for test of FE against RE only, and "bs3
" for test of FEIS against RE only
(see also Details).
An optional character vector specifying which coefficients should be jointly tested.
By default, all covariates are included in the Wchi-squared test. For "type=art2
", the
slope variable is always included in "terms
".
the number of repetitions to be used in bootstrapping (default is 500).
the seed used for random sampling in bootstrapping. Needs to be a valid integer. If not specified, the current seed is used.
... logical. If TRUE
(the Default) shows the progress in the output window.
further arguments.
An object of class "feistest
", containing the following elements:
an object of class "wald.test
"
testing the fixed effects individual slopes model against the conventional fixed effects
model (type="bs1"
).
an object of class "wald.test
"
testing the fixed effects model against the random effects model (type="bs2"
).
an object of class "wald.test
"
testing the fixed effects individual slopes model against the random effects model
(type="bs3"
).
the empirical (bootstrapped) variance-covariance matrix of the
coefficients obtained from FEIS and FE (type="bs1"
).
the empirical (bootstrapped) variance-covariance matrix of the
coefficients obtained from FE and RE (type="bs2"
).
the empirical (bootstrapped) variance-covariance matrix of the
coefficients obtained from FEIS and RE (type="bs3"
).
a matrix containing the estimated FEIS coefficients of each bootstrap run.
a matrix containing the estimated FE coefficients of each bootstrap run.
a matrix containing the estimated RE coefficients of each bootstrap run.
the matched call.
an object of class "Formula
" describing the model.
the type of performed test(s).
a list containing the IDs sampled in each run.
the seed used for bootstrapping.
character vector of covariates are included in the Wchi-squared test.
The function computes a bootstrapped version of the Hausman test Hausman.1978.0feisr. Pairs cluster bootstrapping Cameron.2008,Ruttenauer.2020feisr is used to obtain the empirical variance-covariance matrix of the estimators, either for FEIS and conventional FE, convention FE and RE, or FEIS and RE.
type="bs1"
estimates a bootstrapped Hausman test comparing fixed effects individual slope
models and conventional fixed effects models. In this case, bsfeistest
tests for
inconsistency of the convetional FE model due to heterogeneous slopes.
type="bs2"
estimates a bootstrapped version of the well-known Hausman test comparing conventional
fixed effects models against random effects models.
type="bs3"
estimates a bootstrapped Hausman directly comparing FEIS against RE, thereby testing
for inconsistency of the RE model due to either heterogeneous slopes or time-constant omitted heterogeneity.
Bootstrapping is perfomed by resampling with replacement while keeping the number of groups identical to
the number of groups in the original dataset. A wald test from aod package is used to perform a Wald
chi-squared test on the differences between coefficients.
# NOT RUN {
data("mwp", package = "feisr")
# }
# NOT RUN {
feis.mod <- feis(lnw ~ marry + enrol | year,
data = mwp, id = "id", robust = TRUE)
bsht <- bsfeistest(feis.mod, type = "bs1", rep = 100, seed = 1234)
summary(bsht)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab