# Re: st: some unexplained issues with coefficient comparisons

 From "Narasimhan Sowmyanarayanan" To statalist@hsphsun2.harvard.edu Subject Re: st: some unexplained issues with coefficient comparisons Date Tue, 4 Jul 2006 12:15:39 -0400

```Hi all:

I just noticed something in my regressions. Not sure if it is a
problem with what I am trying to do or if this is expectes. I ran an
OLS of the mean centered variables by each case in a panel data and
then a fixed effect regression (xtreg), fe. I find that the estimates
are a bit differet (though not by a big margin). How can such a thing
happen. I checed that the number of observations in both regressions
is exactly the same.

Another detail issue is concerning mean centering if we want to run a
regression with a lag variable. Should one mean center and then lag to
create the mean centered lag variable, rather than create a lag
variable first and then mean center. how is this implemented in stata
?

Thanks

On 6/30/06, Narasimhan Sowmyanarayanan
<narasimhan.sowmyanarayanan@gmail.com> wrote:
```
```Hi All:

I am trying to implement the procedure as suggested by Mark but am not
being very successful (I did not write any code really since I am only
beginning to look at the stata codes). Here is one of the ways. It may
be very naive. Though this is not working. Here is what I wanted to
do:

I tried this using the auto data:

1. Run the regression and display e(V)
matrix list e(V)

2. Make the degree of correction by hand
I randomly multiplied each cell in the matrix by 20

3. Input the new matrix after making the DOF correction using
matrix input mymat = (0.0682692,0.1931934, -2.0322256\0.1931934,
3.192803, -13.671333\-2.0322256,-13.671333,86.07077)

4. Replacing operation
eret2 matrix mymat = e(V), replace

I want to store the estimates and save them to be used later. but
during the 4th step I am facing the following error

"eret2 matrix mymat = e(V), replace
varlist not allowed"

I have two questions:

1. Is there a more efficient method that I can implement
2. Am I doing somethig wrong with my eret2 command.

I will be grateful if someone can resolve this problem. Mark: I

Thanks

On 6/29/06, Schaffer, Mark E <M.E.Schaffer@hw.ac.uk> wrote:
> Narasimhan,
>
> I don't use eret2 often, and as I have a plane to catch I can't look
> into it now ... maybe some other Statalister can help?
>
> It would in any case be helpful if you show us your code, and the error
> message or where you think it's going wrong, so long as it isn't too
> voluminous.
>
> --Mark
>
> > -----Original Message-----
> > From: owner-statalist@hsphsun2.harvard.edu
> > [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of
> > Narasimhan Sowmyanarayanan
> > Sent: 29 June 2006 02:47
> > To: statalist@hsphsun2.harvard.edu
> > Subject: Re: st: some unexplained issues with coefficient comparisons
> >
> > Hello Mark:
> >
> > Thanks a lot for your email. I created two different datasets
> > of demeaned variables. and ran OLS. I extracted the variance
> > covariance matrix using estat and now know how to modify it.
> > This may be trivial, but I could not make myself to store the
> > matrix and make the DOF adjustment to the VCE. (If I am
> > correct my areg had  F(  6,  1181)
> > and my regress had  F(  6,  1357) =   19.23.  So the DOF adjustment is
> > (1357/1181) ? becasue the standard error adjustment is the
> > square root of this number.
> >
> > I thought that the eret2 command I think needs a matrix name
> > to enable me to repost the data but I am not very clear on
> > how I should repost the variance covariance matrix.
> >
> > Some help would be highly appreciated since I am kind of
> > stuck in this issue.
> >
> > Thanks
> >
> >
> >
> > On 6/27/06, Schaffer, Mark E <M.E.Schaffer@hw.ac.uk> wrote:
> > > Narasimhan,
> > >
> > > > -----Original Message-----
> > > > From: owner-statalist@hsphsun2.harvard.edu
> > > > [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Jeff
> > > > Pitblado, StataCorp LP
> > > > Sent: 27 June 2006 16:40
> > > > To: statalist@hsphsun2.harvard.edu
> > > > Subject: Re: st: some unexplained issues with coefficient
> > > > comparisons
> > > >
> > > > Narasimhan Sowmyanarayanan
> > > > <narasimhan.sowmyanarayanan@gmail.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
> > > 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
> > >
> > > Jeff's comment offers a clue on how you might be able to
> > proceed.  A
> > > fixed effects model can be estimated using OLS on
> > transformed data.
> > > The transformation is "demeaning", which is conveniently
> > done by Ben
> > > Jann's
> > > -center- package.  You might be able to do the following:
> > >
> > > (1) Create demeaned variables for each of your fixed effect
> > models.
> > > The variables may differ from model to model because the samples on
> > > which they are estimated may differ, hence the possible
> > need to create
> > > different sets of demeaned variables.
> > >
> > > (2) Estimate the fixed effects models using OLS on the demeaned
> > > variables.
> > >
> > > (3) Do the degrees-of-freedom adjustment for the N fixed effects on
> > > the var-cov matrix saved in e(V) by hand and repost using Ben's
> > > -eret2- routine (I *think* this will work).  The dof adjustment is
> > > standard and is discussed in various textbooks as well as
> > in the Stata
> > > manual's entries for xtreg etc.
> > >
> > > (4) Use -suest- to compare the coefficients.
> > >
> > > Rather laborious, but I think it should work.
> > >
> > > Hope this helps.
> > >
> > > Cheers,
> > > Mark
> > >
> > > Prof. Mark Schaffer
> > > Director, CERT
> > > Department of Economics
> > > School of Management & Languages
> > > Heriot-Watt University, Edinburgh EH14 4AS tel
> > +44-131-451-3494 / fax
> > > +44-131-451-3296
> > > email: m.e.schaffer@hw.ac.uk
> > > web: http://www.sml.hw.ac.uk/ecomes
> > >
> > >
> > > *
> > > *   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/
> >
> >
>
> *
> *   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/
```