MCbound               package:MChtest               R Documentation

_C_r_e_a_t_e _M_o_n_t_e _C_a_r_l_o _s_t_o_p_p_i_n_g _b_o_u_n_d_a_r_y

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

     Creates one of several different types of Monte Carlo stopping
     boundaries

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

     MCbound(type, parms, conf.level = 0.99)

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

    type: a character vector of type of boundary, possible values:
          "fixed", "tsprt","Bvalue", and "BC"

   parms: a numeric vector of parameter values, different for each type
          (see details)

conf.level: confidence level for intervals about Monte Carlo p-values

_D_e_t_a_i_l_s:

     Create Monte Carlo stopping boundaries for use with 'MCtest',
     where we keep resampling until hitting  the stopping boundary.
     There are several possible types, each with a different length
     parameter vector. 

       type="fixed"   then names(parms)=c("Nmax")
       type="tsprt"   then names(parms)=c("p0","p1","A","B","Nmax")
                      or  names(parms)=c("p0","p1","alpha0","beta0","Nmax")
       type="Bvalue"  then names(parms)=c("Nmax","alpha","e0","e1")
       type="BC"      then names(parms)=c("Nmax","Smax")

     The object parms should be a named vector, although unnamed
     vectors will work if the parameters are in the above order  (for
     the tsprt it assumes the first parameterization). For type="fixed"
     we keep reampling until N=Nmax resamples.  For type="tsprt" we
     keep resampling until stopping for a truncated sequential
     probability ratio test for  a  binary parmaeter. The
     parameterizations are the usual Wald notation, except alpha0=alpha
     and beta0=beta, where  A=(1-beta0)/alpha0 and B=beta0/(1-alpha0).
     The Bvalue is a test that p=alpha or not and we stop if the
     B-value at information time t, B(t), is B(t)<= qnorm(e0) or B
     >=qnorm(1-e1). Note that the B-value stopping boundary is  just a
     reparameterization of the truncated sequential probability ratio
     test. For type="BC" we keep resampling  until N=Nmax or S=Smax
     following a design recommended by Besag and Clifford (1991). For
     each stopping boundary  we calculate valid p-values at each
     stopping point ordering by S/N. For details see Fay, Kim and
     Hachey, 2006.

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

     An object of class MCbound. A list with the following elements: 

       S: number of sucesses at points on the boundary

       N: number of resamples at points on the boundary

 p.value: valid p-value at each point on boundary, calculated using
          ordering by S/N

ci.lower: lower confidence limit of p-value at each boundary point

ci.upper: upper confidence limit of p-value at each boundary point

   Kstar: number of ways to reach each point, (S,N), on boundary times
          beta(S+1,N-S+1) 

conf.level: confidence level for intervals on p-values

    type: type of boundary: either "fixed", "tsprt", "Bvalue" or "BC"

   parms: parameter vector that defines boundary (see details) 

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

     Michael P. Fay

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

     Besag, J. and Clifford, P. (1991). Sequential Monte Carlo
     p-values. Biometrika. 78: 301-304.

     Fay, M.P., Kim, H-J. and Hachey, M. (2007). Using truncated
     sequential probability ratio test boundaries  for Monte Carlo
     implementation of hypothesis tests. (to appear Journal of
     Computational and Graphical Statistics).

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

     MCbound("tsprt",c(alpha0=.001,beta0=.01,Nmax=99,p0=.06,p1=.04))

