Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: RE: Stacking results


From   Abhradeep Maiti <am4m@mtmail.mtsu.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
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: owner-statalist@hsphsun2.harvard.edu [owner-statalist@hsphsun2.harvard.edu] on behalf of Md. Alauddin Majumder [mm4v@mtmail.mtsu.edu]
Sent: Saturday, April 20, 2013 4:59 PM
To: statalist@hsphsun2.harvard.edu
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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index