# Re: st: the Hausman test

 From "Mark Schaffer" <[email protected]> To [email protected] Subject Re: st: the Hausman test Date Thu, 07 Oct 2004 11:54:44 +0100

```Alexander,

From:           	"Alexander Severinsen" <[email protected]>
To:             	<[email protected]>
Subject:        	st: RE: RE: Sqaure root + the Hausman test
Date sent:      	Thu, 7 Oct 2004 12:41:49 +0200

> Hi Statalisters,
> That square root diameter was puzzling, but after some "googling" it
> seems that the square root of a diameter can be used to compare
> binoculars, e.g. magnification * square root of diameter = "Astro
> Index". :)
>
> I am also curious about the Hausman test. I am doing an econometrics
> paper this semester. I use Stata, and everyone else, including the
> lecturer, use SAS. We have been comparing an xtreg fixed effect and a
> random effects model. I come out with a Hausman test statistic = 31.75,
> and SAS gives 28.35. Is it possible that such a difference can be due to
> rounding error, or should this be further investigated? I would
> appreciate any comments on this.

This is probably due to the choice of which estimate of the error
variance to use.  There are two, one from the fixed effects
estimation and one from the random effects estimation, and two places
they can be used when constructing the test (one in the re vcv and
one in the fe vcv).  Under the null, the Hausman test is valid if you
use one, the other, or both.  Wooldridge's 2002 book has a brief
discussion of this point.  Stata uses both estimates for its Hausman
statistic; my guess is that SAS uses one or the other.

FYI, the -hausman- command has two options, sigmamore and sigmaless,
that let you specify that you want to use only one of the error
variance estimates when constructing the Hausman statistic, but the
last time I checked (a month or so ago), -xtreg- wasn't (yet)
compatible with this option.

If you really want to pursue this further, I have a hacked version of
xtreg that will let you calculate these alternate versions of the
Hausman statistic.  Contact me off-list if you want to use it.

Cheers,
Mark

> Best wishes,
> Alexander
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Nick Cox
> Sent: Thursday, October 07, 2004 12:03 PM
> To: [email protected]
> Subject: st: RE: Sqaure root
>
> Other people provided the syntax answer.
>
> Perhaps you just made this example up, but
>
> * in any case I would always recommend
> using appropriate variable names. "square"
> is not a good name for a square root variable.
>
> * I don't know what meaning is to be attached
> to the square root of a diameter.
>
> Nick
> [email protected]
>
> [email protected]
>
> > I am a beginning stat major, and I am trying to figure out
> > how to command the
> > stata program to take the square root of a data set, after I
> > have already infiled some data.
> >
> > I typed:
> >
> > gen square = sqrt{diameter}
> >
> > but it doesnt work
> >
> >
> > does anyone know the command?
>
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/

Prof. Mark E. Schaffer
Director
Centre for Economic Reform and Transformation
Department of Economics
School of Management & Languages
Heriot-Watt University, Edinburgh EH14 4AS  UK
44-131-451-3494 direct
44-131-451-3008 fax