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

Re: st: panel within transformation cause serial correlation?

From   "Enrico Pellizzoni" <>
Subject   Re: st: panel within transformation cause serial correlation?
Date   Tue, 16 Dec 2003 09:32:01 +0100

Probably now I got your point.

Let's write your model as      y_(it)=D*a_i+B*X+e_(it)    (1)

where D is simply the matrix of dummy variables

It is true that:
   the OLS estimation of this model    (in Stata   reg  y  x  a_1  a_2 ...)
   the within estimation of the model     (in Stata   xtreg  y  x )

give exactly the same result.

The fact is that the Within estimation in Stata doesn't perform you trasformation (2), but simply uses a partitioned OLS
estimation of (1).
The estimator for B, in a simple partitioned regression, is:

B=(X*Md*X')-1 * Md*X*y     where  Md= I-D*(D'*D)-1*D'.  Md has the property that:  Md*Md'=Md

This is exaclty the estiamtor you get from an OLS estimation of   y_{it} -y_{i.} = B*(X_{it}-X_{i.}) + e_{it}
that is your transformation number 2, but there is not the correction in the error term.
This is the important point.

For this reason there is no serial correlation in the error and the only difference between (1) and (2) is in the
standard errors because in (1) the number of degrees of freedom is NT-N-K, while in (2) is NT-K.
(K is the number of varables in X, N is the nuber of individuals).

Anyway,the within estimation of the model  in Stata  ( xtreg  y  x ) automatically adjust for the number of degrees of
That's why you have two exactly identical results.

Enrico Pellizzoni
Borsa Italiana Spa
Research & Development
Piazza Affari, 6 - 20123 Milano
Tel: 02 72426 304
Fax: 02 86464323

                      <>           To:                                            
                      Sent by:                         cc:                                                                                 
                      owner-statalist@hsphsun2.        Subject:  Re: st: panel within transformation cause serial correlation?             
                      12/12/2003 16.28                                                                                                     
                      Please respond to                                                                                                    

Eddy wrote:
> In a typical panel data model with individual fixed effect, we have
>    y_{it} = a_i + B*X + e_{it}, --- (1)
> where a_i is individual effect. Assume e_{it} is iid distributed
> i and t. A standard estimation procedure is to first do the
> transformation to get rid of the potentially large number of the
> dummies. The transformation essentially subtracts the group means
> from the variables:
>   y_{it} -y_{i.} = B*(X_{it}-X_{i.}) + (e_{it}-e_{i.}),  -- (2)
> where e_{i.} = (1/T) *(e_{i1} + e_{i2} + ... + e_{iT}).
> It can be shown numerically that OLS estimations on models (1) and
> (2) give you exactly the same results.
> My question is: In model (2), the transformed error term
> (e_{it}-e_{i.}) seems to be serially correlated within any given
> individual (i.e., for any i), but the OLS estimation assumes no
> correlation. Thus, how come the serial correlation can be ignored
> in estimating (2), and the results are still the same as (1)?
> To be more clear, consider the transformed error terms of
> i in period t and t-1. They are
>  (e_{it}-e{i.})   = e_{it}   - (1/T) *(e_{i1} + e_{i2} + ... +
> e_{iT})
>  (e_{it-1}-e{i.}) = e_{it-1} - (1/T) *(e_{i1} + e_{i2} + ... +
> e_{iT})
> . I think they are correlated because of the common term on the RHS
> of the expressions.

Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
*   For searches and help try:

L'utilizzo non  autorizzato  del  presente  messaggio  Ŕ  vietato  e  potrebbe costituire  reato. Se il presente
messaggio non e' a Lei indirizzato, Le saremmo grati  se,  via  e-mail,  ne  comunicasse  l'errata  ricezione. Il
contenuto del presente  messaggio  non deve essere considerato come trasmesso o autorizzato da Borsa Italiana. Borsa
Italiana non si assume alcuna responsabilitÓ per eventuali intercettazioni, modifiche o danneggiamenti del presente
messaggio e-mail.

The unauthorized use of this e-mail is prohibited and could constitute an offence. Please notify Borsa Italiana
immediately by reply e-mail if you are not the intended recepient. The contents of this message shall be understood as
neither given nor endorsed by Borsa Italiana. Borsa Italiana does not accept liability for corruption, interception or
amendment, if any, or the consequences thereof.

(Embedded image moved to file: pic07579.pcx)

Attachment: pic07579.pcx
Description: Binary data

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index