How to export means from ttest

23 Views Asked by At

I am trying to output a table of the means and means difference after a paired ttest. However my output table is not reporting the information I would like. I would like the means of both variables and the mean of the difference. However, it is reporting the confidence interval instead.

Here is my code

eststo a1: ttest orange == apple, paired
esttab . using "$tables/ttest_fruit.rtf", replace ///
  cell("mu_1(label(Weight of Orange Basket) fmt(3)) mu_2(label(Weight of Apple Basket) fmt(3)) b(label(Difference) fmt(3) star)") ///
  b(label(Difference)) p se label replace

Here is my output:

Weight of Orange Basket
Weight of Apple Basket
Difference
5.775
4.992
0.783*

But I would like the results from the mean column of the ttest ouput in stata which is as follows:

------------------------------------------------------------------------------
Variable |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
orange |      78       5.775    .1776121    .7943054    5.403254    6.146746
apple |      78     4.6375    .2686926     1.20163     4.07512     5.19988
---------+--------------------------------------------------------------------
    diff |      78      1.1375    .1888983    .8447789    .7421313    1.532869
------------------------------------------------------------------------------
     mean(diff) = mean(orange - apple)           t =   6.0218
 Ho: mean(diff) = 0                              degrees of freedom =       19

 Ha: mean(diff) < 0           Ha: mean(diff) != 0           Ha: mean(diff) > 0
 Pr(T < t) = 1.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 0.0000
0

There are 0 best solutions below