* add the two matrices containing the means to ttest’s e-list * save ttest results to an e-list using estpost * save the matrix that stores the means e(mean) as matrix meanf0 In esttab or estout then use the margin option to display the marginal effects. To make mfxs results available for tabulation it is essential that the model is stored after applying mfx. * save summarize results for foreign=0 to an e-list using estpostĮstpost sum price mpg headroom trunk if foreign=0 esttab and estout support Statas mfx command for calculating marginal effects and elasticities. * save the matrix that stores the means e(mean) as matrix meanf1 * save summarize results for foreign=1 to an e-list using estpostĮstpost sum price mpg headroom trunk if foreign=1 * if you instead also want the means of each group to be displayed, you need some extra steps: Using a combination of estpost and estadd I have come up with a way of also including the means of each group in the table. Esttab’s website provides a way of outputting results from ttest but there is no option to include the means of each group separately, only the difference between them. Scott Long Indiana University Bloomington, IN Abstract. 4660 Tabulating SPost results using estout and esttab Ben Jann ETH Z¨urich Z¨urich, Switzerland J. The Pragmatic Programmer: From Journeyman to Master. Thanks Thanks and References Special thanks to Sally Hudson for letting us borrow and build on her slides from two years ago for this year’s IAP workshop Hunt, Andrew and David Thomas. * if you just want differences to be displayed in the table run:Įstpost ttest price mpg headroom trunk, by(foreign)Įsttab, noobs cells("b(star fmt(4)) se(fmt(4)) count(fmt(0))") star(* 0.1 **. Output Stata’s ttest results with esttab including means of each group. The Stata Journal (2010) 10, Number 1, pp. Programming with Stata IAP Skills Workshops Raymond Kluender and Benjamin Marx Janu1/34. So the Table exported as table1.tex will be Table section. If, as above, esttab (or estout) is applied without specifying the names of the sets to be tabulated, all sets stored by eststo are tabulated.
To make mfx 's results available for tabulation it is essential that the model is stored after applying mfx. However, esttab and estout also support Stata's old mfx command for calculating marginal effects and elasticities. * the goal here is to build a table with two-sample mean-comparison tests for price, mpg and headroom by foreign Tables generate in Stata are referenced with the same table number in the Overleaf. eststo keeps a list of the names of the stored estimation sets. Since Stata 11, margins is the preferred command to compute marginal effects.
You can actually use this system to include any other summary statistic you may want in the table.