dcor0                package:fdrtool                R Documentation

_D_i_s_t_r_i_b_u_t_i_o_n _o_f _t_h_e _V_a_n_i_s_h_i_n_g _C_o_r_r_e_l_a_t_i_o_n _C_o_e_f_f_i_c_i_e_n_t (_r_h_o=_0) _a_n_d _R_e_l_a_t_e_d _F_u_n_c_t_i_o_n_s

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

     The above functions describe the distribution of the Pearson
     correlation  coefficient 'r' assuming that there is no correlation
     present ('rho = 0').

     Note that the distribution has only a single parameter: the degree
      of freedom 'kappa', which is equal to the inverse of the variance
     of the distribution.

     The theoretical value of  'kappa' depends both on the sample size
     'n' and the number  'p' of considered variables.  If a simple
     correlation coefficient between two variables  ('p=2')  is
     considered the degree of freedom equals 'kappa = n-1'. However, if
     a partial correlation coefficient is considered (conditioned on
     'p-2' remaining  variables) the degree of freedom is 'kappa =
     n-1-(p-2) = n-p+1'.

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

     dcor0(x, kappa, log=FALSE)
     pcor0(q, kappa, lower.tail=TRUE, log.p=FALSE)
     qcor0(p, kappa, lower.tail=TRUE, log.p=FALSE)
     rcor0(n, kappa)

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

     x,q: vector of sample correlations

       p: vector of probabilities

   kappa: the degree of freedom of the distribution (= inverse
          variance)

       n: number of values to generate. If n is a vector, length(n)
          values will be generated

log, log.p: logical vector; if TRUE, probabilities p are given as
          log(p)

lower.tail: logical vector; if TRUE (default), probabilities are P[R <=
          r], otherwise, P[R > r]

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

     For density and distribution functions as well as a corresponding
     random number generator of the correlation coefficient for
     arbitrary non-vanishing correlation 'rho' please refer to the
     'SuppDists' package by  Bob Wheeler bwheeler@echip.com (available
     on CRAN). Note that the parameter 'N' in his 'dPearson' function
     corresponds to  'N=kappa+1'.

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

     'dcor0' gives the density,  'pcor0'  gives the distribution
     function, 'qcor0' gives the quantile function, and 'rcor0'
     generates random deviates.

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

     Korbinian Strimmer (<URL: http://strimmerlab.org>).

_S_e_e _A_l_s_o:

     'cor'.

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

     # load fdrtool library
     library("fdrtool")

     # distribution of r for various degrees of freedom
     x <- seq(-1,1,0.01)
     y1 <- dcor0(x, kappa=7)
     y2 <- dcor0(x, kappa=15)
     plot(x,y2,type="l", xlab="r", ylab="pdf",
       xlim=c(-1,1), ylim=c(0,2))
     lines(x,y1)

     # simulated data
     r <- rcor0(1000, kappa=7)
     hist(r, freq=FALSE, 
       xlim=c(-1,1), ylim=c(0,5))
     lines(x,y1,type="l")

     # distribution function
     pcor0(-0.2, kappa=15)

