Please, I would like to append the results from several t-tests in one table using esttab which is from the Stata Journal. I have done the following:
first, test that price=turn
second, test that trunk=turn
To put the two tests in one table, I have done this:
which yields:
But this is not quite what I want. I want all test results placed vertically under the same 3 columns i.e actual, predicted and ATE (in other words m4, m5 and m6 respectively are 'actual', 'predicted' and 'ATE' from the second test). For simplicity this example invloves just two separate. But my work involves several of such tests.
Code:
sysuse auto
Code:
quietly{ ttest price=turn preserve expand 2, g(new) gen diff= cond(new, turn, price) eststo m1: mean diff if !new eststo m2: mean diff if new eststo m3: estpost ttest diff, by(new) esttab m1 m2 m3, se mlab(actual predicted ATE) coeflab(diff "private") }
Code:
quietly{ ttest trunk=turn preserve expand 2, g(new1) gen diff1= cond(new1, turn, trunk) eststo m4: mean diff1 if !new1 eststo m5: mean diff1 if new1 eststo m6: estpost ttest diff1, by(new1) esttab m4 m5 m6, se mlab(actual predicted ATE) coeflab(diff1 "public") }
Code:
esttab m1 m2 m3 m4 m5 m6, se mlab(actual predicted ATE) coeflab(diff "private" diff1 "public")
Code:
--------------------------------------------------------------------------------------------------------- > --- (1) (2) (3) (4) (5) (6) > actual predicted ATE m4 m5 m6 > --------------------------------------------------------------------------------------------------------- > --- private 6165.3*** 39.65*** 6125.6*** > (342.9) (0.511) (342.9) > public 13.76*** 39.65*** -25.89 > *** (0.497) (0.511) (0.713) > --------------------------------------------------------------------------------------------------------- > --- N 74 74 148 74 74 148 > --------------------------------------------------------------------------------------------------------- > --- Standard errors in parentheses * p<0.05, ** p<0.01, *** p<0.001
Comment