dewlap_dfa_global: Global Discriminant Function Analysis (DFA) of dewlap color

Description Usage Arguments Value Note Author(s)

View source: R/dewlap_dfa_global.R

Description

This function performs a single, global DFA to test clustering by habitat across all islands. 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_global(specdata, vars, type = "linear", plotit = T,
  CV = F)

Arguments

specdata

A data frame containing at least columns for the dependent variables, as well as 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").

CV

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

Value

A vector with elements:

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 Dec. 26, 2018, 1:15 p.m.