Description Usage Arguments Details Value Author(s)
This function fits GLS models to a set of dependent variables, one after the other. It compares several residual variance structures with AIC and retains the best. The fixed effects of the model are tested by model comparison using likelihood ratio tests.
1 | dewlap_gls(specdata, vars, method = "bonferroni", plotit = F)
|
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 |
method |
A character, the method used for P-value correction. See |
plotit |
Logical. Whether to plot the residuals of the best model or not. |
GLS models are used to account for heteroscedasticity of the residuals across groups (Pinheiro and Bates 2000). The workflow here follows recommendations of Zuur et al. 2009.
A list one element per dependent variable. Each element contains an AIC table comparing variance structures, and the ANOVA table summarizing the sequential LRTs of fixed effects. The function also plots the residuals (if plotit = T
) and prints to the prompt the best model with the best variance structure.
Raphael Scherrer
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.