Description Usage Arguments Value Note Author(s)
View source: R/dewlap_dfa_global.R
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.
1 2 | dewlap_dfa_global(specdata, vars, type = "linear", plotit = T,
CV = F)
|
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 |
type |
A character. Type of discriminant analysis. |
plotit |
Logical. Whether to plot the loadings of the data points on the discriminant functions (applicable only if |
CV |
Logical. Whether to jacknife the predictions (cross-validation). |
A vector with elements:
observed
: the observed number of succesful assignments
expected
: the number of succesful assignments expected by change
n
: the number of assignments
p.binom
: the P-value of the binomial test
df
: the degrees of freedom of the MANOVA
wilks
: Wilk's lambda
approx.F
: the approximate F-value calculated from Wilk's lambda
num.df
: numerator degrees of freedom for F-test
denom.df
: denumerator degrees of freedom for F-test
p.manova
: P-value of the MANOVA
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).
Raphael Scherrer
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.