Statalist The Stata Listserver


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

st: Postestimation issues with transformed variables - a suggestion


From   "Schaffer, Mark E" <[email protected]>
To   <[email protected]>
Subject   st: Postestimation issues with transformed variables - a suggestion
Date   Wed, 28 Jun 2006 10:41:42 +0100

Dear Statalisters:

The exchange between Narasimhan Sowmyanarayanan and Jeff Pitblado
(repeated below) raised an interesting issue that I have also had to
wrestle with.  I have a suggestion for how to deal with it that could be
more widely adopted, and I wonder what Statalisters think of it.

The issue is that some estimations transform the data before estimating.
The most common such transformation is demeaning for fixed effects
estimation, but there are others, e.g., quasi-demeaning for random
effects estimation.

The problem is that postestimation commands don't know about the data
transformation.  This is why -suest- won't work properly after areg
(Narasimhan's problem).  I suspect most postestimation commands won't
work properly, or if they do, it will be by accident.

Another example: we want to add a new option to -ivreg2- that will allow
the user to partial-out selected regressors.  But this means that all
the postestimation commands (standard Stata and the others we've
written, e.g., -ivendog-, -ivreset-, -ivreset-) won't work properly.

The exception is -predict-, which knows to look for the customised
predict code in the e(predict) macro.

My suggestion is to follow this last example and add a new macro to the
eclass list saved by a program.  Maybe call it e(transform).  The
-ivreg2- entry would be, say, "ivreg2_t".  If there is such a saved
macro, then postestimation commands would know to

1. -preserve-
2. Call ivreg2_t.ado to transform the data
3. Do whatever the postestimation command usually does
4. -restore-

What do you think?

Cheers,
Mark

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-3296 fax
http://www.sml.hw.ac.uk/cert
 

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> Jeff Pitblado, StataCorp LP
> Sent: Tuesday, June 27, 2006 4:40 PM
> To: [email protected]
> Subject: Re: st: some unexplained issues with coefficient comparisons
> 
> Narasimhan Sowmyanarayanan 
> <[email protected]> is comparing results 
> of -suest- after -areg- with an equivalent -regress- model 
> with indicator variables:
> 
> > I am facing one situation that I have not been able to 
> intuit. I ran 
> > two different fixed effect panel regressions for different 
> groups and 
> > compared the coefficients across the two groups. The test 
> yeilded that 
> > there was no significant difference when I used 'suest' to 
> compare the 
> > coefficients.
> > 
> > Then I tried to run the same models in OLS using explicit dummy 
> > variables. My estimates are very close (some difference 
> possibly came 
> > because of some additional dummy variables that I tried to 
> put in that 
> > I could not use in my fixed effects model). The coefficients that I 
> > compared were very close. But when I ran the same 
> comparison using OLS 
> > I found that the coefficients were significantly different.
> > 
> > To summarize the same coefficients when I used suest after 
> areg gave 
> > me insignificant difference as compared to the usage of 
> suest after a 
> > simple regression with dummy variables which indicated the 
> difference 
> > was significant.
> 
> We've recently discovered that -suest- yields incorrect 
> results when used after -areg-.  This is not something that 
> can easily be fixed given that the meat of the sandwich 
> estimator of variance (Robust/Huber/White VCE) cannot be 
> properly computed due to the fact that the coefficient 
> estimates for the absorbed categories in -areg- are not 
> present in -e(b)- (and the corresponding indicators are not 
> present in the dataset).
> 
> In the next ado-file update, -suest- will report an error 
> message when used with -areg- (something it should have done 
> from the start).
> 
> Note that -suest- was not listed as a supported 
> postestimation command after
> -areg- in [R] areg postestimation.
> 
> --Jeff
> [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/
> 
> 

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