binconf                package:Hmisc                R Documentation

_C_o_n_f_i_d_e_n_c_e _I_n_t_e_r_v_a_l_s _f_o_r _B_i_n_o_m_i_a_l _P_r_o_b_a_b_i_l_i_t_i_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Produces 1-alpha confidence intervals for binomial probabilities.

_U_s_a_g_e:

     binconf(x, n, alpha=0.05,
             method=c("wilson","exact","asymptotic","all"),
             include.x=FALSE, include.n=FALSE, return.df=FALSE)

_A_r_g_u_m_e_n_t_s:

       x: vector containing the number of "successes" for binomial
          variates 

       n: vector containing the numbers of corresponding observations  

   alpha: probability of a type I error, so confidence coefficient =
          1-alpha 

  method: character string specifing which method to use.  The "all"
          method only works when  x and n are length 1.  The "exact"
          method uses the F distribution to compute exact (based on the
          binomial cdf) intervals; the "wilson" interval is
          score-test-based; and the "asymptotic" is the text-book,
          asymptotic normal interval.  Following Agresti and Coull, the
          Wilson interval is to be preferred and so is the default. 

include.x: logical flag to indicate whether 'x' should be included in
          the returned matrix or data frame  

include.n: logical flag to indicate whether 'n' should be included in
          the returned matrix or data frame  

return.df: logical flag to indicate that a data frame rather than a
          matrix be returned 

_V_a_l_u_e:

     a matrix or data.frame containing the computed intervals and,
     optionally, 'x' and 'n'.

_A_u_t_h_o_r(_s):

     Rollin Brant, Modified by Frank Harrell and 
      Brad Biggerstaff 
      Centers for Disease Control and Prevention 
      National Center for Infectious Diseases 
      Division of Vector-Borne Infectious Diseases 
      P.O. Box 2087, Fort Collins, CO, 80522-2087, USA 
      bkb5@cdc.gov

_R_e_f_e_r_e_n_c_e_s:

     A. Agresti and B.A. Coull, Approximate is better than "exact" for
     interval estimation of binomial proportions,   _American
     Statistician,_ *52*:119-126, 1998.

     R.G. Newcombe, Logit confidence intervals and the inverse sinh
     transformation, _American Statistician,_ *55*:200-202, 2001.

     L.D. Brown, T.T. Cai and A. DasGupta, Interval estimation for a
     binomial proportion (with discussion), _Statistical Science,_
     *16*:101-133, 2001.

_E_x_a_m_p_l_e_s:

     binconf(0:10,10,include.x=TRUE,include.n=TRUE)
     binconf(46,50,method="all")

