The Hausman test: how to implement with Stata

The Durbin–Wu–Hausman test (also called Hausman specification test) is a statistical hypothesis test in econometrics named after James DurbinDe-Min Wu, and Jerry A. Hausman. The test evaluates the consistency of an estimator when compared to an alternative, less efficient estimator which is already known to be consistent. It helps one evaluate if a statistical model corresponds to the data.

It is also applied in the context of linear regression to decide whether to choose a fixed effect model or a random effect model.

How is Hausman’s test applied to check for the consistency of an estimator?

Step 1: Suppose we have a consistent estimator β0 for an unknown parameter value β. Further, assume that we manage to obtain a more efficient estimator β1.

Step 2: The null hypothesis of the Hausman’s test is that β1 is also a consistent estimator for β whereas the alternative hypothesis is that β1 is not a consistent estimator for β.

Step 3: We calculate the value of Hausman’s test statistic using the formula,

Hausman’s test statistic asymptotically follows the Chi –squared distribution.

Step 4: Using the value of the test statistic we obtain the p-value. If the p-value is less than the level of significance we reject the null hypothesis, otherwise we accept the null hypothesis.

Step 5: Alternatively, we compare the value of the test statistic with the critical table value. If the value of the test statistic exceeds the critical table value we reject the null hypothesis otherwise we accept the null hypothesis.

Applying Hausman’s test to decide for Fixed Effects Model vs Random Effects Model:

We have two estimators’ β0 and β1 under the fixed and the random-effects models respectively.

The null hypothesis for Hausman’s test, in this case, is that we use the random-effects model because it is more efficient. On the other hand, the alternative hypothesis tells us that we should use the fixed effects model since the random effect model is not consistent.

– The hypotheses:

  • H0: Random-effects (RE) is preferred
  • H1: Fixed-effects (FE) is preferred

By applying the procedure for Hausman’s test given above we can decide which model (Fixed Effects vs Random Effects) is better. We can also apply Hausman’s test to check for the endogeneity of variables in a regression model.

– If result:

  • H0: Select RE (p > 0.05)
  • H1: Select FE (p < 0.05)
– Process of checking the Hausman test on our Panel Data

First step: Handling panel data by using the command xtset Id Year, yearly where “Id” represents the entities that is Vietnam provinces; and “Year” represents the time variable (t)

Second step:

1. Performing fixed-effects regression by using command xtreg with option fe, and save the estimates

Typing: xtreg ANS FDIENT FDICAP FDIAST FDIEMP FDICOM FDIWAG FDITUR FDIGDP FDIROTC FDIROFA FDIROS Size GDPgrowth, fe

… and, save the estimates with fixed-effects regression by using the command “estimates store fixed

2. Performing random-effects regression by using command xtreg with option re, and save the estimates

Typing: xtreg ANS FDIENT FDICAP FDIAST FDIEMP FDICOM FDIWAG FDITUR FDIGDP FDIROTC FDIROFA FDIROS Size GDPgrowth, re

… and, save the estimates with random-effects regression by using the command “estimates store random

Third step: Comparing modes by using the Hausman test or Durbin-Wu-Hausman (DWH) test by hausman fixed random (frequently with sigmamore option)

Leave a Reply

Your email address will not be published. Required fields are marked *