Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: RE: Comparing fixed effect regression coefficients between two groups


From   "Schaffer, Mark E" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: Comparing fixed effect regression coefficients between two groups
Date   Mon, 17 Jan 2011 19:52:34 -0000

Dominik,

I was afraid of that ...

The reason you get an estimated zero constant when you omit the -nocons-
option is because all the groups are centered at zero after the within
transformation.  (Have a look at any textbook covering panel data.)

The constant term that -xtreg,fe- reports always struck me as a strange
beast.  All the other coefficients use within variation in the data as
the identifying variation, but the estimated constant uses between
variation.

Here's how -xtreg- centers and manipulates the data so that regress
generates an estimate of the constant.  The example again uses the
abdata.

*************************************

gen one=1

by id: gen double n_dm =  sum(n)/sum(one)
summ n
by id: replace n_dm = (n - n_dm[_N]) + r(mean)

by id: gen double w_dm =  sum(w)/sum(one)
summ w
by id: replace w_dm = (w - w_dm[_N]) + r(mean)

reg n_dm w_dm, dof(890)

*************************************

But may others want to comment on whether -suest- applied to regressions
like the last one here would generate sensible results.

--Mark

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> Dominik Hennen
> Sent: 17 January 2011 17:24
> To: [email protected]
> Subject: Re: st: RE: Comparing fixed effect regression 
> coefficients between two groups
> 
> Dear Mark,
> thanks very much for the fast reply and the detailed 
> instructions. I followed your idea, and the approach works 
> perfectly for the coefficient part (w and c_w) of the fixed 
> effect model in my data set. I derive the same coefficient 
> results using xtreg and your approach. However, I am 
> primarily interested in the constant ( _cons ) of the 
> equation. In your example this would be 3.16 for the xtreg 
> command. When I leave out the "nocons" command in your "reg 
> c_n c_w, dof(890) nocons" regression, the resulting value for 
> "_cons" is not equal to the one derived from the xtreg 
> regression. Same situation occurs in my data set(or am I 
> missing something?) I guess in this case a comparison via 
> suest doesnt make sense any more. Do you have an idea or a 
> workaround how I can also compare the _cons values of to 
> fixed effect models as well? 
> Thanks again for your help Mark
> With best regards
> Dominik
> 
> 
> -------- Original-Nachricht --------
> > Datum: Mon, 17 Jan 2011 14:07:44 -0000
> > Von: "Schaffer, Mark E" <[email protected]>
> > An: [email protected]
> > Betreff: st: RE: Comparing fixed effect regression coefficients 
> > between two groups
> 
> > Dominik,
> > 
> > > -----Original Message-----
> > > From: [email protected]
> > > [mailto:[email protected]] On Behalf 
> Of Dominik 
> > > Hennen
> > > Sent: 17 January 2011 13:36
> > > To: [email protected]
> > > Subject: st: Comparing fixed effect regression 
> coefficients between 
> > > two groups
> > > 
> > > Dear all,
> > > I have estimated a fixed effect panel regression model for two 
> > > groups in my data set. In particular I compare high 
> frequent stock 
> > > trader with low frequent stock trader. In a second step I want to 
> > > test if the coefficients, in particular the alpha return (the 
> > > "constant" in the Carhart four factor model)are significantly 
> > > different for both groups. The "suest" command does not work for 
> > > xtreg. An alternative would be to include dummmies, however as I 
> > > have more than 6000 investors this option doesn't work either.
> > > Is there any command/approach to compare coefficients between two 
> > > groups which were estimated via fixed effects?
> > 
> > If you apply the within transformation (i.e., demean your data) by 
> > hand, you can obtain the FE coefficients using -regress-.  
> Ben Jann's 
> > -center- command (available from ssc archives in the usual 
> way) is an 
> > easy way to implement the within transformation.
> > 
> > The vcv, error variance and SEs after using -regress- on 
> demeaned data 
> > will be wrong (too small) since the degree of freedom won't 
> > incorporate the loss of dfs because of the FEs.  But if you use the 
> > undocumented
> > -dof- option of -regress-, you can impose the right degrees 
> of freedom 
> > on the estimation on the demeaned data.
> > 
> > Here's an example:
> > 
> > *************************************
> > 
> > webuse abdata, clear
> > 
> > * Note the degrees of freedom = 890
> > xtreg n w, fe
> > 
> > * Apply centering to the same sample
> > by id: center n w if e(sample)
> > 
> > * Force dof to be 890
> > reg c_n c_w, dof(890) nocons
> > 
> > *************************************
> > 
> > Do this for both your FE estimations and then use -suest-, as you 
> > propose.
> > 
> > HTH,
> > Mark
> > 
> > > I highly appreciate your help
> > > With best regards
> > > Dominik
> > > 
> > > 
> > > 
> > > 
> > > --
> > > Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und 
> wir belohnen 
> > > Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
> > > *
> > > *   For searches and help try:
> > > *   http://www.stata.com/help.cgi?search
> > > *   http://www.stata.com/support/statalist/faq
> > > *   http://www.ats.ucla.edu/stat/stata/
> > > 
> > 
> > 
> > --
> > Heriot-Watt University is a Scottish charity registered 
> under charity 
> > number SC000278.
> > 
> > 
> > *
> > *   For searches and help try:
> > *   http://www.stata.com/help.cgi?search
> > *   http://www.stata.com/support/statalist/faq
> > *   http://www.ats.ucla.edu/stat/stata/
> 
> -- 
> NEU: FreePhone - kostenlos mobil telefonieren und surfen!	
> 		
> Jetzt informieren: http://www.gmx.net/de/go/freephone
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
> 


-- 
Heriot-Watt University is a Scottish charity
registered under charity number SC000278.


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index