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]

st: RE: Stacking results


From   Abhradeep Maiti <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: Stacking results
Date   Sun, 21 Apr 2013 01:05:24 +0000

Alauddin,
You might want to use the following code to set your data as panel, assuming your dataset has three dimensiions: state, year, county (and you want `state' as your panel identifier and `year' as your time identifier):

egen panelid = group(state county)
xtset panelid year

Then you can run the analysis for specific counties as before. This way you don't encounter the problem of creating subsets of variables for each county and can directly export the results. This is an indirect answer to your question, but it should work at a more fundamental level. Hope this helps. 


Thanks & Regards,
Abhradeep 


________________________________________
From: [email protected] [[email protected]] on behalf of Md. Alauddin Majumder [[email protected]]
Sent: Saturday, April 20, 2013 4:59 PM
To: [email protected]
Subject: st: Stacking results

Dear Statalist,
My Stata command (esttab) returns the following table:




Variables    Model-1    Model-2    Model-3
   x1              -0.03           -               -
   z1               0.01           -               -

   x2                 -            0.05            -
   z2                 -            0.02            -

   x3                 -              -              0.07
   z3                 -              -             -0.02




where subscripts 1, 2, and 3 indicate models 1, 2, and 3 respectively, and models 1, 2, and 3 are for county 1, 2, and 3 respectively (that means x1, x2 and x3 are the values of x for county 1, 2, and 3 respectively).




I would like to stack the results as follows:
Variables    Model-1    Model-2    Model-3
   x               -0.03          0.05         0.07
   z                0.01          0.02        -0.02

Is there any way to do this? Please note that I will have to use the subscripts (1,2, and 3) to retain the panel structure of data. Any help will be highly appreciated. Thanks.








Regards
Majumder


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



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


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