Stata: Combine table command with ttest and output latex -
for regression output, use combination of eststo
store estimations, estadd
add r2 , additional tests, estab
output lot.
i need same table
command. need mean, median , n variable across 3 by variables
, add stars result of ttest==1 on mean , signtest==1 on median. have 3 by variables
, i've been using table
collate mean, median , n, i'm calling following pseudo-code:
sysuse auto,clear table foreign rep78 , /// contents(mean price median price n price) format(%9.2f) ttest price==1, by(foreign rep78) signtest price=1, by(foreign rep78)
i've tried esttab
, estpost
no avail. i've looked @ tabstat
, tablemat
, summarize
alternatives table
, don't allow 3 by variables
.
how can create table, add stars ttest
, signtest
p-values , output full table?
the main point in question seems producing latex table. however, show "pseudo-code", looks pretty stata code, caveat illegal.
in particular, ttest
can have 1 variable in by()
option. notice ttest
allows also by:
prefix (you can use both, in fact). reasons-to-be different. on other hand, signtest
does not allow by()
option allow by:
prefix. should clarify want before creating table.
if trying use by:
prefix in both cases , afterwards produce table, can create grouping variable, , put commands in loop. in way, can try tabulating saved results each group using estout module (by ben jann in ssc). like:
*clear set more off sysuse auto keep price foreign rep78 * create group variable egen grou = group(foreign rep78) * tests group forvalues = 1/8 { ttest price == 1 if grou == `i' signtest price = 1 if grou == `i' *<complete estout syntax> }
see help by
, help egen
(the group function), help estout
, help saved results
.
Comments
Post a Comment