[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Postestimation issues with transformed variables - a suggestion
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
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
2. Call ivreg2_t.ado to transform the data
3. Do whatever the postestimation command usually does
What do you think?
Prof. Mark E. Schaffer
Centre for Economic Reform and Transformation
Department of Economics
School of Management & Languages
Edinburgh EH14 4AS UK
> -----Original Message-----
> From: firstname.lastname@example.org
> [mailto:email@example.com] On Behalf Of
> Jeff Pitblado, StataCorp LP
> Sent: Tuesday, June 27, 2006 4:40 PM
> To: firstname.lastname@example.org
> Subject: Re: st: some unexplained issues with coefficient comparisons
> Narasimhan Sowmyanarayanan
> <email@example.com> 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
> > 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.
> * 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: