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

st: Re: Re: Serial Correlation in system estimator


From   "Jan Pettersson" <jan.pettersson@ne.su.se>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: Re: Serial Correlation in system estimator
Date   Wed, 3 Mar 2004 20:23:34 +0100

Thanks a lot, I guess this will work. However, I have an additional
problem...
My system has the following form:
EP =  a10 + a11*X + a12*Z + a13*A
EA = a20 + a21*X + a22*Z + a23*A
EO = a30 + a31*X + a32*P
RV  =  a40 + a41*X + a42*P

Data is now in wide format. As I understand it, I must reshape data into
long. In order to "tag" e.g. X to all dependent vars, would it be correct to
first make three "copys" of this variable (as well as one copy of Z, A, and
P) before reshape? I am thinking of:

rename EP dep1

rename EA dep2

rename EO dep3

rename RV dep4



rename X indeA1

rename Z indeB1

rename A indeC1

rename P indeD1



gen indeA2 = indeA1

gen indeA3 = indeA1

gen indeA4 = indeA1
etc.

and then:
reshape long dep indeA indeB indeC indeD, i(year) j(id)

But clearly, there must be a better way of doing this... Any help
appreciated.
All best,
Jan

----- Original Message ----- 
From: "Scott Merryman" <smerryman@kc.rr.com>
To: <statalist@hsphsun2.harvard.edu>
Sent: Wednesday, March 03, 2004 4:00 AM
Subject: st: Re: Serial Correlation in system estimator


> Jan,
>
> I believe you can.  The basic idea to use -xtgls- with individual
intercepts and
> slope variables and with cross-sectional correlation (as in SUR) and
> panel-specific AR(1) (as in -prais-).
>
> Here is an example and comparison of -xtgls, p(c)- to -sureg-
>
> webuse grunfeld, clear
> tab com, gen(D)
> foreach var1 of varlist D* {
>     foreach var2 of varlist mvalue kstock {
>         gen `var1'`var2' = `var1'*`var2'
>         }
>  }
>
> aorder
>
> xtgls invest D*, nocons  p(c) corr(psar1)
>
> *
> *Compare to xtgls, p(c) to SUR
> *
>
> xtgls invest D*, nocons p(c)
>
> keep invest mval kstock year com
> reshape wide invest mval kstock, i(year) j(com)
>
> forv i=1/10 {
>   local rhs "`rhs' ( invest`i' mvalue`i' kstock`i') "
>    }
>
> sureg `rhs'
>
> I hope this helps,
> Scott
>
> ----- Original Message ----- 
> From: "Jan Pettersson" <jan.pettersson@ne.su.se>
> To: <statalist@hsphsun2.harvard.edu>
> Sent: Friday, February 27, 2004 8:39 AM
> Subject: st: Serial Correlation in system estimator
>
>
> > Dear all,
> >
> > Does anyone know any (preferably easy) way to correct for serial
correlation
> > (such as newey or prais) when a system is estimated?
> > I am running SUREG.
> >
> > Thanks in advance,
> > Jan
> >
>
> *
> *   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index