Hi
I have a table that I create like this:
-esttab- is of course from SSC. The resulting table look like this:
I'm quite pleased with this, but I'm also interested in whether the Domestic and Foreign groups are statistically different from one another:
How can I manipulate esttab into creating a table that looks more like this?
Or if you can think of a solution not using -esttab-, I would also be interested in that -- feels a bit like I am re-inventing the wheel here, but I couldn't google a solution.
Thanks so much
Go
I have a table that I create like this:
Code:
sysuse auto, clear
// Turn categorical variable into a set of dummies to fit it into the table
tabulate rep78, gen(repair)
// Three columns of the table:
eststo clear
eststo: estpost tabstat price repair*, statistics(mean sd) columns(statistics)
eststo: estpost tabstat price repair* if !foreign, statistics(mean sd) columns(statistics)
eststo: estpost tabstat price repair* if foreign, statistics(mean sd) columns(statistics)
// Assemble table:
esttab, cells(mean(fmt(2)) sd(fmt(2) par keep(price))) ///
mtitle("Total" "Domestic" "Foreign") nonumbers collabels("") ///
note(Note: SD in parentheses.)
Code:
---------------------------------------------------
Total Domestic Foreign
Mean/% Mean/% Mean/%
---------------------------------------------------
price 6165.26 6072.42 6384.68
(2949.50) (3097.10) (2621.92)
repair1 .03 .04 .00
repair2 .12 .17 .00
repair3 .43 .56 .14
repair4 .26 .19 .43
repair5 .16 .04 .43
---------------------------------------------------
N 74 52 22
---------------------------------------------------
Note: SD in parentheses.
Code:
ttest price, by(foreign) tabulate rep78 foreign, chi2
Code:
----------------------------------------------------------------------
Total Domestic Foreign Test
Mean/% Mean/% Mean/%
----------------------------------------------------------------------
price 6165.26 6072.42 6384.68 t(72) = -.41,
(2949.50) (3097.10) (2621.92) p = .68
repair1 .03 .04 .00 chi2(4) = 27.6,
repair2 .12 .17 .00 p = .00
repair3 .43 .56 .14
repair4 .26 .19 .43
repair5 .16 .04 .43
---------------------------------------------------------------------
N 74 52 22
---------------------------------------------------------------------
Note: SD in parentheses.
Or if you can think of a solution not using -esttab-, I would also be interested in that -- feels a bit like I am re-inventing the wheel here, but I couldn't google a solution.
Thanks so much
Go

Comment