***************************************************************
*                                                             *
*          Two Sample T-test and Confidence Interval          *
* for the Mean BMI Difference Between Males and Females       *
*                                                             *
***************************************************************


insheet using  http://hedwig.mgh.harvard.edu/biostatistics/sites/default/files/public/education/tmp_sample_data.csv


ttest bmi, by(gender)



********************************** ANNOTATED RESULTS **********************************


Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |      16     25.9375    .7783462    3.113385    24.27849    27.59651
       1 |      44    26.03182    .6033362    4.002079    24.81507    27.24856
---------+--------------------------------------------------------------------
combined |      60    26.00667    .4854427    3.760223     25.0353    26.97804
---------+--------------------------------------------------------------------
    diff |           -.0943184    1.107102               -2.310424    2.121788
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -0.0852
Ho: diff = 0                                     degrees of freedom =       58

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.4662         Pr(|T| > |t|) = 0.9324          Pr(T > t) = 0.5338