Hey everyone,
I generated a table that shows the mean and standard error of the mean for different variables by groups.
I used esttab from SSC in Stata 18.0, but I'm not sure it is the right choice in this context.
This is my (simplified) data:
I need to generate a table like this:
My code so far is:
Question: My problem is labelling the 4 columns as shown above. I need to "group" the first two columns under the label "North" and the second two columns under the label "South".
I am not sure if this is a question of simply formatting the table differently or if I need to use an entirely different command for this.
Thank you!
I generated a table that shows the mean and standard error of the mean for different variables by groups.
I used esttab from SSC in Stata 18.0, but I'm not sure it is the right choice in this context.
This is my (simplified) data:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(treatment north expats_error expats_or1_error expats_or2_error) 0 0 20.14 4.82 3.58 0 0 30.14 2.82 6.58 1 0 8.14 4.82 2.58 0 1 23.14 1.82 8.58 0 1 15.13 29.82 6.58 0 1 4.13 .82 -.41 1 1 66.13 1.82 3.58 1 1 6.13 9.82 3.58 end
North | South | |||
Control | Treatment | Control | Treatment | |
Expats_error | mean (se) |
|||
Expats_o1_error | mean (se) |
|||
Expats_o2_error | mean (se) |
My code so far is:
Code:
eststo NorthC : estpost ci expats_error expats_or1_error expats_or2_error if north==1 & treatment==0 eststo NorthT : estpost ci expats_error expats_or1_error expats_or2_error if north==1 & treatment==1 eststo SouthC : estpost ci expats_error expats_or1_error expats_or2_error if north==0 & treatment==0 eststo SouthT : estpost ci expats_error expats_or1_error expats_or2_error if north==0 & treatment==1 esttab NorthC NorthT SouthC SouthT, nostar cells("b(fmt(3))" se(fmt(3) par)) collabels("mean (se)") f noobs
I am not sure if this is a question of simply formatting the table differently or if I need to use an entirely different command for this.
Thank you!
Comment