glottostat_permanova: Permanova across all groups (overall or pairwise)

View source: R/glottostat.R

glottostat_permanovaR Documentation

Permanova across all groups (overall or pairwise)

Description

This function takes a glottodata or glottosubdata object and performs a Permutational Multivariate Analysis of Variance (PERMANOVA). It can be used to test whether two or more groups are significantly different from each other (by specifying the 'comparison' argument with either 'overall' or 'pairwise'). The function uses the 'group' column in the sample table to do the comparisons. Before running the analysis, a distance matrix is constructed from the glotto(sub)data object using glottodist(). The function calls vegan::adonis2(), type ?adonis2 for more details.

Usage

glottostat_permanova(
  glottodata,
  comparison = NULL,
  sample = NULL,
  permutations = NULL,
  metric = "gower"
)

Arguments

glottodata

glottodata or glottosubdata

comparison

Either "overall" or "pairwise"

sample

sample table (optional). By default, searches for sample table in glottodata/glottosubdata.

permutations

Number of permutations (default is 999)

metric

Either "gower" or "anderberg"

Examples

glottodata <- glottoget("demodata", meta = TRUE)
glottostat_permanova(glottodata, comparison = "pairwise")

# Use subgroup (or another column in the structure table) as group
glottodata[["sample"]][,"group"] <- NULL # delete old 'group' column
glottodata[["sample"]][,"group"] <- glottodata[["sample"]][,"subgroup"]
glottostat_permanova(glottodata, comparison = "pairwise")

glottosubdata <- glottoget("demosubdata", meta = TRUE)
glottostat_permanova(glottodata = glottosubdata, comparison = "pairwise")

SietzeN/glottospace documentation built on June 15, 2024, 10:45 p.m.