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

st: Re: SUR and Panels


From   "Scott Merryman" <[email protected]>
To   <[email protected]>
Subject   st: Re: SUR and Panels
Date   Mon, 13 Oct 2003 19:55:41 -0500

----- Original Message ----- 
From: <[email protected]>
To: <[email protected]>
Sent: Monday, October 13, 2003 7:01 AM
Subject: st: SUR and Panels


> Dear Statalisters,
>
> I have the following data format:
>
> i(1,2,3..N)   t      var1      var2     var3
> 1            91        .         .        .
> 1            92        .         .        .
> 1            93        .         .        .
> .             .
> 2            91        .         .
> 2            92        .         .
> 2            93        .         .
> .             .
> 3            91        .         .
> 3            92        .         .
> 3            93        .         .
> .             .
> 4            91        .
> .             .        .
>
>
> Let i(1,2,3,...,N)  be cross-sections and t the time operator. I want to run
> Seemingly Unrelated Regressions (sureg), for one equation per cross section,
> ie:
>
>  sureg (1_var1 1_var2 1_var3) (2_var1 2_var2 3_var3) ... (N_var1 N_var2 Nvar3)
>
> I didnt do my homework on panel data analysis in STATA, but I do know that the
> panels are balanced. Every suggestion is much appreciated,
> many thanx,
> Dimitris
>

In order to run -sureg- you need to reshape your data into the wide format (see
[R] reshape).

I believe the following should work (taken from an example by Kit Baum
10/22/02):

reshape wide var1 var2 var3, i(t) j(i)

forv i=1/N {
 local rhs "`rhs' ( `i'_var1  `i'_var2 `i'_var3) "
 }

di "`rhs'"

sureg `rhs'


Hope this helps,
Scott




*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index