glam: Calculating gradients based on the Lande-Arnold Method

Description Usage Arguments Details Value Value Warning References See Also Examples

View source: R/SelectionGradients.R

Description

glam is used to fit generalized linear models, specified by error distributions and link functions as denoted by family, using approaches based on the quantitative framework established by Lande and Arnold (1983). Statistical methods are based on glm for linear models and glmer for linear mixed effects models. An option to employ the Janzen and Stern (1998) correction factor for logistic regression models is available via JS = TRUE. Model formulae are constructed such that regression coefficients and standard errors for quadratic terms do NOT need to be doubled (Stinchcombe et al. 2008)

Usage

1
glam(w, z, fitType=c("gaussian", "binomial"), JS = FALSE, prep = TRUE, st= NULL, RE = NULL)

Arguments

fitness

Fitness measure. Gaussian fitness types should use relative fitness, which is calculated as the absolute fitness for each individual W(z) divided by the mean absolute fitness W. Binomial fitness types should use the absolute fitness measures (e.g., 0 = failed, 1 = survived)

z

Phenotypic traits.

fitType

Type of distribution for the fitness metric. Option to either "gaussian" or "binomial".

JS

Janzen and Stern (1998) correction factor for make logistic regression coefficients congruent with linear regression coefficients for estimating multivariate selection. Default is FALSE. Setting JS = TRUE applies the Janzen and Stern correction factor to the logistic regression coefficients.

prep

Option to scale the phenotypic trait data (z) to a mean of zero and unit variance in preparation for running regression models. Default is set to TRUE, with the assumption that z are the raw data for the morphological traits.

st

Option to standardize the regression coefficients by either the mean or the standard deviation of z.

RE

Random effects of the model, if applicable.

Details

The Lande-Arnold Method is based on the 1983 paper by Russell Lande and Stevan Arnold, entitled "The measurement of selection on correlated characters". Their method involves applying ordinary least-squares (OLS) regression to estimate selection gradients.

Value

The function returns an object of classes "glam", "lm", and "glm."

Value

GL

Warning

These analyses are currently only available for longitudinal data. Selection gradients for cross-sectional data must be evalated using matrix algebra rather than OLS regressions (Lande and Arnold 1983).

References

Janzen FJ, Stern HL. 1998. Logistic regression for empirical studies of multivariate selection. Evolution 52(6): 1564-1571. http://www.jstor.org/stable/2411330?seq=1#page_scan_tab_contents

Lande R, Arnold SJ. 1983. The measurement of selection on correlated characters. Evolution 37(6): 1210-1226. http://www.jstor.org/stable/2408842

Stinchcombe JR, Agrawal AF, Hohenlohe PA, Arnold SJ, Blows MW. 2008. Estimating nonlinear selection gradients using quadratic regression coefficients: double or nothing? Evolution 62(9): 2435-2440. http://onlinelibrary.wiley.com/doi/10.1111/j.1558-5646.2008.00449.x/abstract

See Also

glamx, glm, lm, summary.glam, glmer

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# use the BumpusMales data set
data(BumpusMales)

# Define the input
w <- BumpusMales$w
z <- BumpusMales[,3:11]

# Calculate the selection gradients using glam
mod1 <- glam(w, z, "gaussian")

# Review the summary statistics for the linear gradients
summary.glam(mod1$GL)

MorphoFun/psa documentation built on Nov. 10, 2021, 7:01 a.m.