Hi everyone,
I'm struggling to create a summary statistics table. I just cannot get the layout correctly.
What I want is to get a single variable to be summarized under certain conditions:
I want to get the mean, median, sd, min and max values for that variable, first for the overall sample and then across agegroups and gender conditional on marital status.
I have tried estpost and outreg2 but failed with both.
This is what I tried with estpost:
And with outreg2 something like
But then I do not get the ,cross option working.
The table should look something like:
Many thanks for your time and help!
I'm struggling to create a summary statistics table. I just cannot get the layout correctly.
What I want is to get a single variable to be summarized under certain conditions:
I want to get the mean, median, sd, min and max values for that variable, first for the overall sample and then across agegroups and gender conditional on marital status.
I have tried estpost and outreg2 but failed with both.
This is what I tried with estpost:
Code:
estpost sum probors1, d forvalues agegroup =1(1)5 { bysort married: eststo: estpost sum probors1 if `agegroup', d } bysort married: eststo: estpost sum probors1 if female==1, d bysort married: eststo: estpost sum probors1 if female==0, d
And with outreg2 something like
Code:
bysort married: outreg2 using 23.xls, replace sum(detail) keep(probors1) eqkeep(mean p50 sd min max)
The table should look something like:
Code:
married not married mean median sd min max mean median sd min max overall agegroup 1 2 3 gender 0 1
Comment