I'm trying to compute summary statistics for the following variable into one column in Stata.
q58_amount_1 - 4 are saving amounts for different option (e.g. using bank accounts, putting the money underneath a mattress, etc.). q56_save1 == 1 indicates that there are indeed positive savings for the given option. wave indicates the time period.
Using the above command I get the following output:
What I would like to have are two columns: One for the mean and one for the sd, i.e. not 8 separate columns. I'm not familiar with esttab so this might seem obvious for regular Stata users. I`d be grateful for some advice.
Code:
eststo: quietly estpost sum q58_amount_1 if wave == 1 & q56_save1 == 1 eststo: quietly estpost sum q58_amount_2 if wave == 1 & q56_save2 == 1 eststo: quietly estpost sum q58_amount_3 if wave == 1 & q56_save3 == 1 eststo: quietly estpost sum q58_amount_4 if wave == 1 & q56_save4 == 1 esttab, replace cells("mean(fmt(2)) sd(fmt(2))") label title(Savings II) noobs eststo clear
Using the above command I get the following output:
Code:
. esttab, replace cells("mean(fmt(2)) sd(fmt(2))") label title(Savings II) noobs Savings II -------------------------------------------------------------------------------------------------------------------- > -------- (1) (2) (3) (4) > > mean sd mean sd mean sd mean > sd -------------------------------------------------------------------------------------------------------------------- > -------- q58_amount_1 288669.40 987614.42 > q58_amount_2 664938.81 1609076.48 > q58_amount_3 2448495.47 5439977.76 > q58_amount_4 243138.35 5 > 33569.69 -------------------------------------------------------------------------------------------------------------------- > -------- . eststo clear . end of do-file .
Comment