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

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

     Hardy-Weinberg equilibrium test

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

     hwe(data,yates.correct=FALSE, miss.val=0)
     hwe(data,is.genotype=FALSE, yates.correct=FALSE, miss.val=0)
     hwe(data,is.count=FALSE, 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

is.genotype: A flag indicating if the data is an array of genotypes

is.count: A flag indicating if the data is an array of genotypes 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 is.genotype=TRUE) and counts corresponding
     to individual genotypes (by setting is.count=TRUE) ; the latter
     does not need is.genotype to be specified but requires that
     genotype counts for all possible genotypes, i.e. n(n+1)/2, where n
     is the number of alleles.

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

     The returned value is a list containing:

      x2: Pearson chi-square

    p.x2: p value for chi-square

     lrt: Log-likelihood ratio test statistic

_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: 
     a <- c(3,2,2)
     a.out <- hwe(a,is.genotype=TRUE)
     a.out
     a.out <- hwe(a,is.count=TRUE)
     a.out
     ## End(Not run)

