g.stats: Calculates likelihood-ratio G-statistic on contingency table

Description Usage Arguments Value Author(s) References See Also Examples

Description

Calculates the likelihood ratio G-statistic on a contingency table of alleles at one locus X sampling unit. The sampling unit could be any hierarchical level

Usage

1

Arguments

data

a two-column data frame. The first column contains the sampling unit, the second the genotypes

diploid

Whether the data are from diploid (default) organisms

Value

obs

Observed contingency table

exp

Expected number of allelic observations

X.squared

The chi-squared statistics, Sum (O-E)^2/E

g.stats

The likelihood ratio statistics, 2 Sum(O Log(O/E))

Author(s)

Jerome Goudet, DEE, UNIL, CH-1015 Lausanne Switzerland

jerome.goudet@unil.ch

References

Goudet J., Raymond, M., DeMeeus, T. and Rousset F. (1996) Testing differentiation in diploid populations. Genetics. 144: 1933-1940

Goudet J. (2005). Hierfstat, a package for R to compute and test variance components and F-statistics. Molecular Ecology Notes. 5:184-186

Petit E., Balloux F. and Goudet J.(2001) Sex-biased dispersal in a migratory bat: A characterization using sex-specific demographic parameters. Evolution 55: 635-640.

See Also

g.stats.glob.

Examples

1
2
3

Example output

$obs
    y
x     1  2  3  4  5  6  7
  1   0 14  0  0  0  0 12
  2   0 22  0  0  0  0  2
  3   0 10  2  9  0  9  0
  4   0  0  2 19  0  9  0
  5   0 26  0  0  0  0  0
  6   0  0  0  0 24  0  0
  7   0  0  0  0 30  0  0
  8   0  0  0  0 26  0  0
  9   0  0  0  0 26  0  0
  10  0  0  0  0 30  0  0
  11  0 14  0  0  0  8  0
  12  0 14  0  0  0  8  0
  13  1  6  0  0  0 19  0
  14  1  8  0  0  1 16  0
  15  0  2  0  0 26  0  0
  16  0  2  0  0 28  0  0
  17  0  0  0  0 30  0  0
  18  0  0  0  0 30  0  0
  19  0 10  0  0 16  0  0
  20  0  5 23  0  0  0  0
  21  0  2 23  0  5  0  0
  22  0  0  0  0 28  0  0
  23  0 16 12  0  0  0  0
  24  0  0  0  0 30  0  0
  25  0  4  0  0 20  0  0
  26  0  8  0  0  8  0  0
  27  0  3  0  0 17  0  0
  28  0  3  0  0  7  0  0
  29  0  3  0  0  7  0  0

$expe
               1        2         3         4         5      6         7
 [1,] 0.07065217 6.076087 2.1902174 0.9891304 13.741848 2.4375 0.4945652
 [2,] 0.06521739 5.608696 2.0217391 0.9130435 12.684783 2.2500 0.4565217
 [3,] 0.08152174 7.010870 2.5271739 1.1413043 15.855978 2.8125 0.5706522
 [4,] 0.08152174 7.010870 2.5271739 1.1413043 15.855978 2.8125 0.5706522
 [5,] 0.07065217 6.076087 2.1902174 0.9891304 13.741848 2.4375 0.4945652
 [6,] 0.06521739 5.608696 2.0217391 0.9130435 12.684783 2.2500 0.4565217
 [7,] 0.08152174 7.010870 2.5271739 1.1413043 15.855978 2.8125 0.5706522
 [8,] 0.07065217 6.076087 2.1902174 0.9891304 13.741848 2.4375 0.4945652
 [9,] 0.07065217 6.076087 2.1902174 0.9891304 13.741848 2.4375 0.4945652
[10,] 0.08152174 7.010870 2.5271739 1.1413043 15.855978 2.8125 0.5706522
[11,] 0.05978261 5.141304 1.8532609 0.8369565 11.627717 2.0625 0.4184783
[12,] 0.05978261 5.141304 1.8532609 0.8369565 11.627717 2.0625 0.4184783
[13,] 0.07065217 6.076087 2.1902174 0.9891304 13.741848 2.4375 0.4945652
[14,] 0.07065217 6.076087 2.1902174 0.9891304 13.741848 2.4375 0.4945652
[15,] 0.07608696 6.543478 2.3586957 1.0652174 14.798913 2.6250 0.5326087
[16,] 0.08152174 7.010870 2.5271739 1.1413043 15.855978 2.8125 0.5706522
[17,] 0.08152174 7.010870 2.5271739 1.1413043 15.855978 2.8125 0.5706522
[18,] 0.08152174 7.010870 2.5271739 1.1413043 15.855978 2.8125 0.5706522
[19,] 0.07065217 6.076087 2.1902174 0.9891304 13.741848 2.4375 0.4945652
[20,] 0.07608696 6.543478 2.3586957 1.0652174 14.798913 2.6250 0.5326087
[21,] 0.08152174 7.010870 2.5271739 1.1413043 15.855978 2.8125 0.5706522
[22,] 0.07608696 6.543478 2.3586957 1.0652174 14.798913 2.6250 0.5326087
[23,] 0.07608696 6.543478 2.3586957 1.0652174 14.798913 2.6250 0.5326087
[24,] 0.08152174 7.010870 2.5271739 1.1413043 15.855978 2.8125 0.5706522
[25,] 0.06521739 5.608696 2.0217391 0.9130435 12.684783 2.2500 0.4565217
[26,] 0.04347826 3.739130 1.3478261 0.6086957  8.456522 1.5000 0.3043478
[27,] 0.05434783 4.673913 1.6847826 0.7608696 10.570652 1.8750 0.3804348
[28,] 0.02717391 2.336957 0.8423913 0.3804348  5.285326 0.9375 0.1902174
[29,] 0.02717391 2.336957 0.8423913 0.3804348  5.285326 0.9375 0.1902174

$x.squared
[1] 1958.605

$g.stats
[1] 1376.066

hierfstat documentation built on Nov. 17, 2021, 5:08 p.m.