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

Re: st: hausman and xthausman after panel fe, re - DROPPED MEAN/DIFF


From   [email protected] (Vince Wiggins, StataCorp)
To   [email protected]
Subject   Re: st: hausman and xthausman after panel fe, re - DROPPED MEAN/DIFF
Date   Fri, 26 Aug 2005 08:55:55 -0500

In adding the ability to handle missing values to Mark Schaffer
<[email protected]> and Carl Nelson's <[email protected]> version of
artificial regression for a Hausman-like test, I failed to add the critical
-if e(sample)- condition to the -egen- command.  Here is the corrected code.

---------------------------------- BEGIN --- artreg.do --- CUT HERE -------
local id idcode
local depvar ln_wage
local varlist ttl_exp union white

iis `id'
xtreg `depvar' `varlist' , re

local i 0
foreach var of varlist `varlist' {
	egen mymean`++i' = mean(`var') if e(sample), by(`id')
}

xtreg `depvar' `varlist' mymean1-mymean`i' , re

testparm mymean1-mymean`i'
---------------------------------- END   --- artreg.do --- CUT HERE -------

 
-- Vince
   [email protected]

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