hierfstat (version 0.04-14)

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

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

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.starA vector containing all the generated g-statistics, the last one beeing the observed
  • p.valThe p-value associated with the test

Examples

Run this code
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)

Run the code above in your browser using DataLab