dewlap_gls: Fit and analyze generalized least squares models

Description Usage Arguments Details Value Author(s)

View source: R/dewlap_gls.R

Description

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.

Usage

1
dewlap_gls(specdata, vars, method = "bonferroni", plotit = F)

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.

method

A character, the method used for P-value correction. See ?p.adjust.

plotit

Logical. Whether to plot the residuals of the best model or not.

Details

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.

Value

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.

Author(s)

Raphael Scherrer


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