diseq              package:GeneticsBase              R Documentation

_E_s_t_i_m_a_t_e _o_r _C_o_m_p_u_t_e _C_o_n_f_i_d_e_n_c_e _I_n_t_e_r_v_a_l _f_o_r _t_h_e _S_i_n_g_l_e-_M_a_r_k_e_r _D_i_s_e_q_u_i_l_i_b_r_i_u_m

_D_e_s_c_r_i_p_t_i_o_n:

     Estimate or compute confidence interval for single-marker
     disequilibrium.

_U_s_a_g_e:

     diseq.ci(object, marker, R = 1000, conf = 0.95, correct = TRUE, na.rm =
     TRUE, ...)
     diseq.inner(object, marker, ...)

_A_r_g_u_m_e_n_t_s:

  object: geneSet object

  marker: marker names 

       R: Number of bootstrap iterations to use when computing the
          confidence interval. Defaults to 1000.

    conf: Confidence level to use when computing the confidence level
          for D-hat.  Defaults to 0.95, should be in (0,1).

 correct: See details.

   na.rm: logical. Should missing values be removed?

     ...: optional additional parameters passed

_D_e_t_a_i_l_s:

     For a single-gene marker, 'diseq' computes the Hardy-Weinberg
     (dis)equilibrium statistic D, D', r (the correlation coefficient),
     and r^2 for each pair of allele values, as well as an overall
     summary value for each measure across all alleles.  'print.diseq'
     displays the contents of a 'diseq' object. 'diseq.ci' computes a
     bootstrap confidence interval for this estimate.

     For consistency, I have applied the standard definitions for D,
     D', and r from the Linkage Disequilibrium case, replacing all
     marker  probabilities with the appropriate allele probabilities.

     Thus, for each allele pair,

   _D is defined as the half of the raw difference in frequency between
        the observed number of heterozygotes and the expected number:

               D = 1/2 * ( p(ij) + p(ji) ) - p(i)*p(j)


   _D' rescales D to span the range [-1,1] 

                            D' = D / Dmax

        where, if D > 0:

              Dmax = min(p(i)p(j), p(j)p(i)) =  p(i)p(j)

        or if D < 0:

        Dmax = min( p(i) * (1 - p(j)), p(j)( 1 - (1-p(i) ) ) )


   _r is the correlation coefficient between two alleles, and can be
        computed by

            r = -D / sqrt( p(i)*(1-p(i)) * p(j)*(1-p(j)) )



     where

   - p(i) defined as the observed probability of allele 'i', 

   - p(j) defined as the observed probability of allele 'j', and 

   - p(ij) defined as the observed probability of the allele pair 'ij'. 

     When there are more than two alleles, the summary values for these
     statistics are obtained by computing a weighted average of the
     absolute value of each allele pair, where the weight is determined
     by the expected frequency. For example:


                   D.overall = sum |D(ij)| * p(ij)


     Bootstrapping is used to generate confidence interval in order to
     avoid reliance on parametric assumptions, which will not hold for
     alleles with low frequencies (e.g. D' following a a Chi-square 
     distribution).  

     See the function {HWE} from "genetics" package for testing
     Hardy-Weinberg Equilibrium, D=0.

_A_u_t_h_o_r(_s):

     Gregory R. Warnes warnes@bst.rochester.edu and Nitin Jain
     nitin.jain@pfizer.com

