Description Usage Arguments Value Author(s) References See Also Examples
View source: R/select_traits.R
This function provides several strategies to discard some useless traits (nonpolymorphic, nondiscriminatory, etc.) upstream the MMD analysis.
1 2 3  select_traits(tab, k = 10, strategy = c("none", "excludeNPT",
"excludeQNPT", "excludeNOMD", "keepFisher"), OMDvalue = NULL, groups,
angular = c("Anscombe", "Freeman"))

tab 
A table of sample sizes and frequencies, typically returned
by the function 
k 
Numeric value: the required minimal number of individuals per group. Any trait that could be taken on fewer individuals in at least one group will be removed from the dataset. This allows to select only the traits with a sufficient amount of information in each group. 
strategy 
Strategy for trait selection, i.e. for the removal of
nonpolymorphic traits. The four options are fully described in
Santos (2018) and in the help page of 
OMDvalue 
To be specified if and only if 
groups 
A factor or character vector, indicating the group to be
considered in the analysis. Since some groups can have a very low
sample size, this will allow to discard those groups in order to
facilitate the trait selection via the argument

angular 
Formula for angular transformation, see Harris and Sjøvold (2004). Useful only for the calculation of overall measure of divergence. 
A list with two components:
filtered 
The dataset filtered according to the userdefined criteria. 
OMD 
The “overall measure of divergence” for each trait. 
Frédéric Santos, frederic.santos@ubordeaux.fr
Harris, E. F. and Sjøvold, T. (2004) Calculation of Smith's mean measure of divergence for intergroup comparisons using nonmetric data. Dental Anthropology, 17(3), 83–93.
Santos, F. (2018) AnthropMMD: an R package with a graphical user interface for the mean measure of divergence. American Journal of Physical Anthropology, 165(1), 200–205. doi: 10.1002/ajpa.23336
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19  ## Load and visualize a binary dataset:
data(toyMMD)
head(toyMMD)
## Convert this dataframe into a table of sample sizes and
## relative frequencies:
tab < binary_to_table(toyMMD, relative = TRUE)
tab
## Filter this dataset to keep only those traits that have at
## least k=10 individuals in each group:
select_traits(tab, k = 10)
## Only Trait1 is excluded.
## Filter this dataset to keep only those traits that have at
## least k=11 individuals in each group, and show significant
## differences at Fisher's exact test:
select_traits(tab, k = 11, strategy = "keepFisher")
## Traits 1, 5 and 8 are excluded.

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.