hwe                   package:gap                   R Documentation

_H_a_r_d_y-_W_e_i_n_b_e_r_g _e_q_u_l_i_b_r_i_u_m _t_e_s_t _f_o_r _m_u_l_t_i_a_l_l_e_l_i_c _m_a_r_k_e_r

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

     Hardy-Weinberg equilibrium test

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

     hwe(data, data.type="allele", yates.correct=FALSE, miss.val=0)

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

    data: A rectangular data containing the genotype, or an array of
          genotype counts

data.type: An option taking values "allele", "genotype", "count"  if
          data is alleles, genotype or genotype count

yates.correct: A flag indicating if Yates' correction is used for
          Pearson chi-squared statistic

miss.val: A list of missing values

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

     This function obtains Hardy-Weinberg equilibrium test statistics.
     It can handle data coded as allele numbers (default), genotype
     identifiers (by setting data.type="genotype") and counts
     corresponding to individual genotypes (by setting
     data.type="count") which requires that genotype counts for all
     n(n+1) possible genotypes, with n being the number of alleles.

     For highly polymorphic markers when asymptotic results do not
     hold, please resort to hwe.hardy.

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

     The returned value is a list containing: 

allele.freq: Frequencies of alleles

      x2: Pearson chi-square

    p.x2: p value for chi-square

     lrt: Log-likelihood ratio test statistic

   p.lrt: p value for lrt

      df: Degree(s) of freedom

     rho: sqrt{chi-square/N} the contingency table coefficient

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

     Jing Hua Zhao

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

     'hwe.hardy'

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

     ## Not run: 
     data(hla)
     hla.DQR <- hwe(hla[,3:4])
     summary(hla.DQR)
     a <- c(3,2,2)
     a.out <- hwe(a,data.type="genotype")
     a.out
     a.out <- hwe(a,data.type="count")
     a.out
     ## End(Not run)

