Learn R Programming

strataG (version 1.0.5)

popStructTest: Population Differentiation Tests

Description

Conduct overall and/or pairwise tests of population differentiation.

Usage

popStructTest(g, nrep = 1000, stats = "all", type = c("both", "overall", "pairwise"), keep.null = FALSE, quietly = FALSE, max.cores = NULL, write.output = FALSE, ...)
overallTest(g, nrep = 1000, stats = "all", keep.null = FALSE, quietly = FALSE, max.cores = NULL, ...)
pairwiseTest(g, nrep = 1000, stats = "all", keep.null = FALSE, quietly = FALSE, max.cores = NULL, ...)
statList(stats = "all")

Arguments

g
a gtypes object.
nrep
number specifying number of permutation replicates to use for permutation test.
stats
a character vector or list of functions specifying which anlayses to conduct. If characters, then valid possible choices are: "phist", "fst", "fst.prime", "fis", "gst", "gst.prime", "gst.dbl.prime", "d", or "chi2", or "all". If a list, then functions must be a valid population structure function (see popStructStat) taking a gtypes object and returning a named statistic estimate.
type
character determining type of test to conduct. Can be "overall", "pairwise", or "both". If "pairwise" or "both" are chosen and there are only two strata, then only an overall test will be conducted.
keep.null
logical. Keep the null distribution from the permutation test?
quietly
logical. Print progress and results?
max.cores
The maximum number of cores to use to distribute separate statistics over. Default (NULL) sets value to what is reported by detectCores - 1. Any value greater than this will be set to this value. If detectCores reports NA, max.cores will be set to 1.
write.output
logical. Write a .csv file with results?
...
other parameters to be passed to population differentiation functions.

Value

Examples

Run this code
data(msats.g)
msats.g <- stratify(msats.g, "fine")

# Just an overall Chi-squared test
ovl <- overallTest(msats.g, stats = "chi2", nrep = 100)
ovl

#' Just a pairwise test for Gst
pws <- pairwiseTest(msats.g, stats = list(statGst), nrep = 100)
pws

## Not run: 
# #' Both overall and pairwise tests for Fst and F'st
# full <- popStructTest(msats.g, stats = c("fst", "fst.prime"))
# print(full$overall)
# print(full$pairwise)
# ## End(Not run)

Run the code above in your browser using DataLab