Learn R Programming

DEMEtics (version 0.8.1)

p.val: Bootstrap Test of Significance

Description

This function gives the significance level for an empirical value to be significantly larger than a distribution of bootstrapped values.

Usage

p.val(empirical.value, bootstrapped.values)

Arguments

empirical.value
The test statistic that is obtained from the empirical data.
bootstrapped.values
A vector of test statistics obtained from a bootstrap method (i.e. resampling with replacement). Bootstrap values of genetic differentiation measurements for example can be generated by the functions described in the help file

Value

  • A p-value giving an estimate of the probability that the empirical value or a value more extreme than this could have occurred by chance, if the null hypothesis were true.

    The calculated 'p.value' is assigned to the workspace (.GlobalEnv).

Details

Since the empirical value of genetic differentiation is expected to be larger than a value obtained from within a panmictic population when the tested populations are significantly differentiated, a one tailed test is carried out. The empirical value is significantly large at the 95% level if it is one of the largest 5% of the test statistics (the bootstrapped ones and the empirical one). It is calculated according to Manly (1997, p. 62).

References

Manly, B. F. J. 1997 Randomization, Bootstrap and Monte Carlo Methods in Biology. Chapman & Hall

See Also

Bootstrapping.D, allelefreq, Dest.calc, p.value.correcture, all.pops.Dest, all.pops.Dest.Chao, all.pops.Gst, all.pops.Gst.est, pair.pops.Dest, pair.pops.Dest.Chao, pair.pops.Gst, pair.pops.Gst.est

Examples

Run this code
data(Example.transformed)
Example1 <- Example.transformed
Bootstrapping.Dest(Example1,bt=10)

# 10 bootstrap values are created. This is not enough to test real data
# but avoids long calculation time in this example.

allelefreq(Example1)

# The allelefrequencies as well as the sample sizes
# are calculated.

Dest.calc(allelefrequency, sample.sizes)

# The empirical Dest values
# for each locus and over all loci are calculated.

p.val(D.values$Mean.Dest.value,Dest.means)

p.value

Run the code above in your browser using DataLab