hausman: Conducts auxiliary Hausman tests

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/hausman.R

Description

Tests correlations between level 1 and level 2 errors in the pooled random effects estimator and REWE. If the pooled test is significant, the pooled estimator is biased and the within estimator should be considered. If the within test is significant, then the within estimator is biased and REWIE, BWI, or two-way fixed effects should be consider.

Usage

1
hausman(formula,timevar,csvar,df)

Arguments

formula

is a character string or formula object denoting the models to be tested, i.e., "y ~ x1+x2". NOTE:do not provide a lmer formula object (ie."y~x+(1|x").

timevar

is a character string providing the name of the time indicator variable.

csvar

is a character string providing the name of the cross-section indicator variable.

df

is the dataframe containing the data. NOTE: do not provide preprocessed variables to hausman(). All variable transformations used to conduct the tests are done natively within the function.

Details

Conducts auxiliary Hausman test of homogeneity in panel data. If the pooled test is failed, it means that the between variation adn within variation are correlated and so the pooled estimator is biased. The within test tests for correlation between the idiosyncratic and homogenous-within variation. If the test is filed, time heterogeneity exists and the one-way within estimator is biased. If both tests are failed, BWI, REWIE, and two-way fixed effects are unbiased estimators. If only the pooled test is failed, then the one-way within estimator (one-way fixed effects and between within) are unbiased. If neither test is failed, the pooled model is appropriate.

Value

Returns the results from the two Hausman tests (called from the plm package using phtest) in a list.

pooled_vs_FE

is the result from the pooled Hausman test

REWE_vs_2FE

is the result from the within Hausman test

Author(s)

Scott Duxbury, Assistant Professor of Sociology at University of North Carolina, Chapel Hill

See Also

phtest

Examples

1
2
3
4
5
6
7
8
9
library(plm)
library(lme4)


##not run
data("Crime")


hausman("lcrmrte~ldensity+polpc",csvar="county", timevar="year",Crime)

rewie documentation built on July 1, 2020, 6:53 p.m.

Related to hausman in rewie...