Description Usage Arguments Value Note Author(s) Examples
View source: R/popStructTest.R
Conduct overall and/or pairwise tests of population differentiation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | popStructTest(
g,
nrep = 1000,
stats = "all",
type = c("both", "overall", "pairwise"),
keep.null = FALSE,
quietly = FALSE,
max.cores = 1,
write.output = FALSE,
...
)
overallTest(
g,
nrep = 1000,
stats = "all",
keep.null = FALSE,
quietly = FALSE,
max.cores = 1,
...
)
pairwiseTest(
g,
nrep = 1000,
stats = "all",
keep.null = FALSE,
quietly = FALSE,
max.cores = 1,
...
)
|
g |
a |
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 |
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. The number of cores to use to distribute separate
statistics over. If set to |
write.output |
logical. Write a .csv file with results? |
... |
other parameters to be passed to population differentiation functions. |
a list containing:
strata.freq
a vector of the sample sizes for each stratum
result
a matrix with the statistic estimate and p-value for each statistic
null.dist
a matrix with the null distributions for each statistic
a list containing:
result
a data.frame with the result of each pairwise comparison on each row
pair.mat
a list with a pairwise matrix for each statistic. Values in lower left are the statistic estimate, and upper right are p-values
null.dist
a matrix with the null distributions for each statistic
On multi-core systems, runs of separate statistics are automatically
distributed over as many cores as available (minus one). This can be
controlled by the max.cores
argument if less core usage is
desired.
Eric Archer eric.archer@noaa.gov
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 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 = "gst", 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.