Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: VARIANCE COMPONENTS IN HT


From   "Antonio Rodrigues Andres" <[email protected]>
To   <[email protected]>
Subject   st: VARIANCE COMPONENTS IN HT
Date   Fri, 26 Dec 2003 21:20:08 +0100

Dear Stata users,

I am trying to use the Hausman and Taylor estimator. I first run a
within regression

xtreg  yvar xvars, fe i(id)
predict residu, residuals

I save the within residuals. The next step is to compute the variance
components. In particular, one component is based on within residuals.

I type
ge srresidu=residu*residu
egen sumsqr=sum(srresidu)
gen sigmau=sumsqr/4164-595-7

This works and gives 0.0023. The next step is to average the within
residuals and to estimate by 2SLS regressing these transformed residuals
on the set of time invariant variables using as instruments X1 and Z1
(time varying and invariant exogenous variables)

I type

egen mresidu=mean(residu), by(id)
ivreg mresidu fem blk (ed= instruments)

Here, I dont get the results. According to HT an unbiased and consistent
estimator should be based on

(Yi-Xi*Bwithin-Zi*gamma)'(Yi-Xi*Bwithin-Zi*gamma) (1**)

I generate a new variable as follows

Y=lwage
gen fe= mlwage- mwks*_b[wks]
gen sqrfe=fe*fe
egen sumfe= sum(sqrfe)
gen sigma1=sumfe/595

However, I think that this is not correct as I could translate in Stata
the expression (1**)

Someone is familiar with HT estimator?

Antonio
*
*   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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index