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 at the end of May, and its replacement, is already up and running.

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

st: RE: Stacking results

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

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,

From: [] on behalf of Md. Alauddin Majumder []
Sent: Saturday, April 20, 2013 4:59 PM
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.


*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index