Hi statalist,
I'm trying to export multiple results of summarise into the same excel spreadsheet.
The codes I'm using are
But when I try esttab after the first time, I get an error that the file already exists.
I'm trying to make the data look something like this
Is it possible to obtain this kind of structure with some code or it can only be done manually?
Please help!
I'm trying to export multiple results of summarise into the same excel spreadsheet.
The codes I'm using are
Code:
estpost sum health if round==2
esttab using "$sum\3_descriptives_2.csv",cells("mean(fmt(2)) sd(fmt(2)) sum(fmt(2))")
estpost sum health if round==3&hi==1
estpost sum health if round==4&hi==1
estpost sum health if round==5&hi==1
estpost sum health if round==3&hi==0
estpost sum health if round==4&hi==0
estpost sum health if round==5&hi==0
I'm trying to make the data look something like this
| variable | mean | sd | sum | hi | round |
| health | some value | some value | some value | 2 | |
| health | some value | some value | some value | 1 | 3 |
| health | some value | some value | some value | 1 | 4 |
| health | some value | some value | some value | 1 | 5 |
| health | some value | some value | some value | 0 | 3 |
| health | some value | some value | some value | 0 | 4 |
| health | some value | some value | some value | o | 5 |
Please help!

Comment