***************************************************************
*                                                             *
*          One Sample Test for Binomial Proportion            *
*                                                             *
*                                                             *
***************************************************************



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

bitest diabetes == 0.50

ci diabetes , binomial



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



    Variable |        N   Observed k   Expected k   Assumed p   Observed p
-------------+------------------------------------------------------------
    diabetes |       60         17           30       0.50000      0.28333

  Pr(k >= 17)            = 0.999803  (one-sided test)
  Pr(k <= 17)            = 0.000533  (one-sided test)
  Pr(k <= 17 or k >= 43) = 0.001066  (two-sided test)





                                                         -- Binomial Exact --
    Variable |        Obs        Mean    Std. Err.       [95% Conf. Interval]
-------------+---------------------------------------------------------------
    diabetes |         60    .2833333    .0581744        .1745053    .4144361