glamx: Comparison of selection gradients with different trait...

Description Usage Arguments Details Value Value Warning References See Also Examples

View source: R/SelectionGradients.R

Description

glamx 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). *Note* Only the OLS is currently supported in this version of the function.

Usage

1
glamx(fitness, z, method=c("linear", "nonlinear", "both"))

Arguments

fitness

Fitness measure. Gaussian fitness types should be 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). *Note* Only gaussian fitness measures are currently accepted in this version of the function.

z

Phenotypic traits.

method

Choice of whether analyses will be output for linear selection, nonlinear selection, or both.

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

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

See Also

glam, lm,

Examples

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

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

# Calculate the selection gradients using glam
mod1 <- glam(fitness, z, method = "linear")

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