heterozygosity              package:ape              R Documentation

_H_e_t_e_r_o_z_y_g_o_s_i_t_y _a_t _a _L_o_c_u_s _U_s_i_n_g _G_e_n_e _F_r_e_q_u_e_n_c_i_e_s

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

     This function computes the mean heterozygosity from gene
     frequencies, and returns optionally the associated variance.

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

     heterozygosity(x, variance = FALSE)
     H(x, variance = FALSE)

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

       x: a vector or a factor.

variance: a logical indicating whether the variance of the  estimated
          heterozygosity should be returned ('TRUE'), the default being
          'FALSE'.

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

     The argument 'x' can be either a factor or a vector. If it is a
     factor, then it is taken to give the individual alleles in the
     population. If it is a numeric vector, then its values are taken
     to be the numbers of each allele in the population. If it is a
     non-numeric vector, it is a coerced as a factor.

     The mean heterozygosity is estimated with:


             H = n(1 - SUM (FROM i=1 TO k) p_i^2)/(n - 1)


     where n is the number of genes in the sample, k is the number of
     alleles, and p_i is the observed (relative) frequency of the
     allele i.

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

     a numeric vector of length one with the estimated mean
     heterozygosity (the default), or of length two if the variance is
     returned 'variance = TRUE'.

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

     Emmanuel Paradis paradis@isem.univ-montp2.fr

_R_e_f_e_r_e_n_c_e_s:

     Nei, M. (1987) _Molecular Evolutionary Genetics_. New York:
     Columbia University Press.

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

     'theta.s'

