dewlap_dfa: Discriminant Function Analysis (DFA) of dewlap color

Description Usage Arguments Value Note Author(s)

View source: R/dewlap_dfa.R

Description

This function performs multiple DFA on each island separately. The algorithm fits functions that best discriminate among habitats based on dewlap color data. The type of DFA can be linear (LDA) or quadratic (QDA). Each data point is then classified i.e. its original habitat is predicted based on the discriminant functions. Predictions can be jacknifed (leave-one-out). The significance of the classification is assessed in two ways. First, a MANOVA tests for differences in dependent variables across predicted groups. Second, a binomial test assesses the departure of the observed number of successful predictions from the null expectation.

Usage

1
2
dewlap_dfa(specdata, vars, type = "linear", plotit = T, CV = F,
  method = "bonferroni")

Arguments

specdata

A data frame containing at least columns for the dependent variables, as well as a column "island" and a column "habitat".

vars

A character or integer vector. The names, or indices, of the dependent variables in specdata.

type

A character. Type of discriminant analysis. "linear" (default) or "quadratic".

plotit

Logical. Whether to plot the loadings of the data points on the discriminant functions (applicable only if type == "linear"). Also, whether to plot adjusted P-values, across islands, of the MANOVAs and binomial tests.

CV

Logical. Whether to jacknife the predictions (cross-validation).

method

A character. The method to use for P-value correction.

Value

A data frame with columns:

Note

Quadratic discriminant analysis doesn't require homogeneous covariance matrices among groups, unlike linear (Robert I. Kabacoff, Quick-R, https://www.statmethods.net/advstats/discriminant.html).

Author(s)

Raphael Scherrer


rscherrer/sagreicolor documentation built on May 26, 2019, 12:32 p.m.