rrisk                package:MChtest                R Documentation

_C_a_l_c_u_l_a_t_e _r_e_s_a_m_p_l_i_n_g _r_i_s_k _a_n_d _e_x_p_e_c_t_e_d _r_e_s_a_m_p_l_i_n_g _s_i_z_e

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

     Calculates for a particular stopping boundary the resampling risk
     of making the wrong  accept/reject decision. Can be calculated for
     different distributions of the p-value. If type="p" then assume
     point mass at pparms. If type="b" then assume a beta distribution
     with two shape parameters given by pparms.

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

     rrisk(bound, pparms, sig.level = 0.05, type = "b")

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

   bound: an object of class MCbound, i.e., a stopping boundary. See
          'MCbound' to create

  pparms: either a vector of possible point mass p-value distributions
          (type="p"), or a vector (or matrix with two columns)
          representing two beta shape parameters (type="b")

sig.level: significance level for defining resampling risk

    type: either "p" for point mass p-value distributions, or "b" for a
          beta distribution

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

     The resampling risk (RR) is defined as the probability of making
     an accept/reject decision different from complete enumeration. In
     other words, for any Monte Carlo test the true p-value for any
     data is either below the sig.level (reject the null) or above the
     sig.level (accept the null), and the RR is the probability of
     either deciding p<=sig.level when p>sig.level or vise versa. We
     also calculate the expected resampling size for the assumed
     distributions on the p-values. As a check of the MCbound, we sum 
     the probability of stopping at any point in the boundary over the
     entire stopping boundary for each assumed distribution on the 
     p-values; the ouput value check should give a vector of all ones
     if the MCbound is calculated correctly.

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

     A list with the following elements: 

   check: Sum of the probabilities of the stopping boundary
          corresponding to the p-value distribution(s). Should be a
          vector with all values equal to 1.

      rr: resampling risk corresponding to the p-value distribution(s)

      EN: expected resampling size corresponding to the p-value
          distribution(s)

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

     Michael P. Fay

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

     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:

     ### caculate resampling risk and E(N) under null, i.e., uniform distribution on p-values 
     rrisk(MCbound.precalc1,c(1,1))

