plotcf                package:Davies                R Documentation

_p-_v_a_l_u_e _i_n_v_e_s_t_i_g_a_t_i_o_n

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

     Plots sorted p-values showing which ones would have been rejected

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

     plotcf(y, q=0.05)

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

       y: dataset

       q: p-value of critical region

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

     Sorts p-values and plots the order statistic.  Useful for
     investigating a statistical test by using it when the null
     hypothesis is KNOWN to be true, just to check if the probability
     of rejection really is alpha.

     Also can be used when H0 is wrong, showing what beta is.

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

     Robin K. S. Hankin

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

     f.H0.T <- function(n,free=5){t.test(rt(n,df=free))$p.value}
     f.H0.F <- function(n,free=5){t.test(rf(n,df1=free,df2=free))$p.value}

     plotcf(sapply(rep(10,100),f.H0.T))  # should reject about 5: thus
                                          # probability of a type I error is
                                          # about 0.05 (as it should be; this
                                          # is an exact test)
     plotcf(sapply(rep(10,100),f.H0.F))  # should reject about 80: thus
                                          # probability of a type II error is
                                          # about 0.2 for this H_A.

