test.between.within: Tests the significance of the effect of test.lev on genetic...

Description Usage Arguments Value Author(s) Examples

Description

Tests, using permutations of rand.unit within units defined by the vector within the significance of the contingency tables allele X (levels of test.lev)

Usage

1
test.between.within(data, within, test.lev, rand.unit, nperm, ...) 

Arguments

data

a data frame containing the genotypes for the different loci

within

A vector containing the units in which to keep the observations

test.lev

A vector containing the units from which to construct the contingency tables

rand.unit

A vector containing the assignment of each observation to the units to be permutted

nperm

The number of permutations to carry out for the test

...

Mainly here to allow passing diploid=FALSE if necessary

Value

g.star

A vector containing all the generated g-statistics, the last one beeing the observed

p.val

The p-value associated with the test

Author(s)

Jerome Goudet jerome.goudet@unil.ch

Examples

1
2
3
4
data(yangex)
attach(yangex)
#tests for the effect of spop on genetic structure
test.between.within(data.frame(genot),within=pop,test=spop,rand=sspop)

Example output

$g.star
  [1]  92.44678  87.13601 104.31388  89.94914 101.35698  90.43936  74.57773
  [8] 104.98355 121.51254  87.79335  69.54005 106.68064  84.71470  80.65865
 [15]  78.28297 119.98066  75.84841  98.82654  85.70272  89.39299  90.74660
 [22]  81.37860  77.81177  85.82737  87.01789  57.53312  81.33374  85.89130
 [29]  92.83148  93.99687  96.34031  87.01957  77.24270  98.43196 103.68360
 [36]  96.71065 100.37693  79.84073  98.15780  88.09954 104.14494  81.53751
 [43]  81.38765  87.02282  96.20578  84.85867  89.92863  69.64017  87.80394
 [50]  90.10476 111.39860  98.84355  84.72752 107.16021  99.60336  96.61335
 [57]  78.83927  95.64799  73.30420  86.17752 103.44258  83.03195  90.37644
 [64]  90.69107  75.55194  82.12427 100.26460 111.17116  83.73594 112.18301
 [71]  96.13117  69.57780  81.69094 116.25834 116.22538 105.10074  86.89603
 [78] 102.48360  80.08456  85.09900  77.84956 101.41974  90.20329  94.88991
 [85]  89.63531 102.59541 104.47297  74.96929  90.16994  77.10643  91.21122
 [92]  79.26630 123.37722  87.50744  92.15889  96.42790 100.81155  94.01629
 [99]  93.78607  95.27060

$p.val
[1] 0.37

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