Pval.dist              package:Rtreemix              R Documentation

_p-_v_a_l_u_e _o_f _a _g_i_v_e_n _s_i_m_i_l_a_r_i_t_y _v_a_l_u_e

_D_e_s_c_r_i_p_t_i_o_n:

     This function calculates the p-value of a given similarity value,
     i.e. the probability for obtaining the same or a smaller value
     than the given one in a vector of random similarity values. The
     p-value is used to determine whether the given similarity value is
     significant.

_U_s_a_g_e:

     Pval.dist(dist.val, random.vals)

_A_r_g_u_m_e_n_t_s:

dist.val: A 'numeric' value quanifying the similarity for which a
          p-value should be calculated. 

random.vals: A 'numeric' vector of random similarities used for
          calculating the p-value.

_V_a_l_u_e:

     It returns a 'numeric' value between 0 and 1 that specifies the
     p-value of the given 'dist.val'.

_A_u_t_h_o_r(_s):

     Jasmina Bogojeska

_S_e_e _A_l_s_o:

     'L1.dist', 'kullback.leibler, \code{comp.models},
     \code{stability.sim}'

_E_x_a_m_p_l_e_s:

     ## The function is currently defined as
     function(dist.val, random.vals) {
       return((sum(random.vals <= dist.val) + 1) /(length(random.vals) + 1))
       }

     ## Define the similarity value and a vector of random similarities
     sim.val <- 0.2
     rand.vals <- c(0.1, 0.24, 0.28, 0.35, 0.15, 0.5, 0.14, 0.6, 0.8, 0.3)

     ## Calculate the p-value of sim.val using the vector of random
     ## similarities
     Pval.dist(dist.val = sim.val, random.vals = rand.vals)
      

