[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

From |
"Rodrigo A. Alfaro" <raalfaroa@gmail.com> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: Re: Question on xthtaylor |

Date |
Wed, 25 Jul 2007 16:06:53 -0400 |

///

Hi Roy,

You can produce HT estimator "by hand". Following the steps in the manual.

HT estimator is a FGLS estimation of the RE model, then a directly robust

estandard error cannot be computed as in -xtreg, re- (see Example below)

However, the R2 can be computed for the last IV-regression. The properties

of that R2 are the same as in any IV estimation. In other words, use it for

reference only. Nick's suggestion (Pseudo-R2) is an interesting short cut, but I am not sure if it is applicable. Probably depends on how strong are

the instruments.

Finally, "by hand" you could use any test of over-identification that is applicable to IV estimators.

Rodrigo.

/***************** Example ****************************/

/// Setting

qui {

webuse psidextract, clear

local tv "lwage wks south smsa ms exp exp2 occ ind union"

local ti "fem blk ed"

keep `tv' `ti' id t

sort id t

tsset id t

foreach i of varlist `tv' {

by id: egen double `i'_m=mean(`i')

gen double `i'_dm = `i'-`i'_m

}

/// First step

reg lwage_dm wks_dm south_dm smsa_dm ms_dm exp_dm exp2_dm ///

occ_dm ind_dm union_dm, noc

sca sig_e2=e(rss)/3570

mat beta=e(b)

mat colnames beta = wks_m south_m smsa_m ms_m exp_m exp2_m ///

occ_m ind_m union_m

mat score double xbm_w = beta

gen double di = lwage_m - xbm_w

mat colnames beta = wks south smsa ms exp exp2 occ ind union

mat score double xb_w = beta

/// Second step

reg di fem blk ed (wks south smsa ms fem blk)

predict double zg, xb

reg di fem blk ed (wks_m south_m smsa_m ms_m fem blk) if t==7

predict double zg2, xb

/// Error and theta

g double fit1=lwage - xb_w - zg2

by id: gen double fit2=sum(fit1)

by id: replace fit2=(fit2[_N]/7)^2

sum fit2, meanonly

sca s2=r(sum)/595

sca sig_u2=(s2-sig_e2)/7

gen double theta=1-sqrt(sig_e2/(sig_e2+7*sig_u2))

/// GLS

foreach i of varlist `tv' {

gen double `i'_g=`i'-theta*`i'_m

}

foreach i of varlist `ti' {

gen double `i'_g=(1-theta)*`i'

}

/// More Instruments (for AM)

foreach i of varlist wks south smsa ms exp exp2 occ ind union {

forvalues k=1/7 {

gen double aux=0

replace aux=`i' if t==`k'

by id: egen double `i'_t`k'=sum(aux)

drop aux

}

}

}

/// Third step

reg lwage_g wks_g south_g smsa_g ms_g exp_g exp2_g ///

occ_g ind_g union_g fem_g blk_g ed_g ///

(*_dm south_m smsa_m occ_m ind_m fem blk)

xthtaylor lwage wks south smsa ms exp exp2 occ ind ///

union fem blk ed, endog(wks ms exp exp2 union ed)

reg lwage_g wks_g south_g smsa_g ms_g exp_g exp2_g ///

occ_g ind_g union_g fem_g blk_g ed_g ///

(*_dm south_t* smsa_t* occ_t* ind_t* fem blk) xthtaylor lwage wks south smsa ms exp exp2 occ ind ///

union fem blk ed, endog(wks ms exp exp2 union ed) am

/***************** End Example *************************/

----- Original Message ----- From: "Roy,Suryadipta" <suryadipta.roy@lawrence.edu>

To: <statalist@hsphsun2.harvard.edu>

Sent: Wednesday, July 25, 2007 1:44 PM

Subject: st: Question on xthtaylor

Hi,

There have been a few threads on the first one, but I am still asking the question to find out if there is an easier solution:

1. Is there a command to obtain robust/ cluster(robust) standard errors while using xthtaylor (as in xtreg, fe or xtreg, re)?

2. Is there a command to obtain R-square while using xthtaylor?

3. Moreover, after I run xthtaylor, I am trying to do the overidentifiaction test with -xtoverid- but I am getting an error message : "invalid name". I only have time-varying variables as endogenous variables.

Any comment on these issues would be really helpful.

Thanks as usual!

Suryadipta.

*

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

**References**:**st: Question on xthtaylor***From:*"Roy,Suryadipta" <suryadipta.roy@lawrence.edu>

- Prev by Date:
**st: RE: Week() Function** - Next by Date:
**Re: st: Week() Function** - Previous by thread:
**st: RE: Question on xthtaylor** - Next by thread:
**st: RE: Question on xthtaylor** - Index(es):

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