[R] Hausman Test
Achim.Zeileis at uibk.ac.at
Sun Jan 16 16:37:55 CET 2011
On Sun, 16 Jan 2011, Arne Henningsen wrote:
> Hi Holger!
> On 16 January 2011 15:53, Holger Steinmetz <Holger.steinmetz at web.de> wrote:
>> One follow up question. The Hausman-test always gives me a p-value of 1 - no
>> matter how small the statistic is.
>> I now generated orthogonal regressors (X1-X3) and the test gives me
>> Hausman specification test for consistency of the 3SLS estimation
>> data: data
>> Hausman = -0.0138, df = 2, p-value = 1
>> What is confusing to me is the "3SLS". I am just beginning to learn about
>> instrumental variables (I am a psychologist ;) Perhaps that's a problem?
>> As a background, here's the complete simulation:
>> W = rnorm(1000)
>> X2 = rnorm(1000)
>> X3 = rnorm(1000)
>> X1 = .5*W + rnorm(1000)
>> Y = .4*X1 + .5*X2 + .6*X3 + rnorm(1000)
>> data = as.data.frame(cbind(X1,X2,X3,Y,W))
>> fit2sls <- systemfit(Y~X1,data=data,method="2SLS",inst=~W)
>> fitOLS <- systemfit(Y~X1,data=data,method="OLS")
>> print(hausman.systemfit(fitOLS, fit2sls))
> Please do read the documentation of hausman.systemfit(). I regret that
> comparing 2SLS with OLS results has not been implemented yet:
> ====== part of documentation of hausman.systemfit() =================
> hausman.systemfit( results2sls, results3sls )
> results2sls : result of a _2SLS_ (limited information) estimation
> returned by ?systemfit?.
> results3sls : result of a _3SLS_ (full information) estimation
> returned by ?systemfit?.
> The null hypotheses of the test is that all exogenous variables
> are uncorrelated with all disturbance terms. Under this
> hypothesis both the 2SLS and the 3SLS estimator are consistent but
> only the 3SLS estimator is (asymptotically) efficient. Under the
> alternative hypothesis the 2SLS estimator is consistent but the
> 3SLS estimator is inconsistent.
> The Hausman test statistic is
> m = ( b_2 - b_3 )' ( V_2 - V_3 ) ( b_2 - b_3 )
> where $b_2$ and $V_2$ are the estimated coefficients and their
> variance covariance matrix of a _2SLS_ estimation and $b_3$ and
> $V_3$ are the estimated coefficients and their variance covariance
> matrix of a _3SLS_ estimation.
> Please don't hesitate to write a new version of hausman.systemfit()
> that can also compare 2SLS with OLS results.
Arne: Unless I'm missing something, hausman.systemfit() essentially does
the right thing and computes the right statistic and p-value (see my other
mail to Holger). Maybe some preliminary check on the input objects could
be used for determining the right order of models.
> Best regards from Copenhagen,
> Arne Henningsen
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help