I am interested how some variables differ by gender. I want to create a table showing the means and standard deviations of each variable by gender, as well as the coefficients and standard errors from a t-test. This part is easy. But I also wish to go beyond the t-test to show whether these differences continue to hold after a regression.
My current code is
Code:
local summary_list age years education income employment
eststo: estpost summarize `summary_list' if male == 1
eststo: estpost summarize `summary_list' if male == 0
eststo: estpost ttest `summary_list', by(male) unequal
esttab using "summary_stats.tex", ///
cells("mean(pattern(1 1 0)) sd(pattern(1 1 0)) b(pattern(0 0 1)) se(pattern(0 0 1))")
This produces a table where each row is a variable in summary_list. There are six columns: (1) mean of the variable for males (2) std dev. of the variable for males (3) mean of the variable for females (4) std dev. of the variable for females (5) coefficient from the t-test comparing values of the variable for males and females (6) std error from the t-test.
I want to add two more columns to this table: (7) coefficient from a regression where the dependent variable is the row variable and the independent variable is male plus some controls (8) std error from this regression. How can I do so?
0 Response to How to combine summary stats and regression tables in Stata
Post a Comment