moments.differentials: Calculates selection differentials directly from the...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/moments.differentials.R

Description

The calculations are based on the difference between the fitness-weighted moments (means, variances, covariances) of the phenotypic distribution and the unweighted moments. For viability selection, this is simply the moments after minus the moments before, as there are two fitness classes, zero and one.

Usage

1
moments.differentials(z, W, n.boot = 1000, standardized = FALSE)

Arguments

z

phenotypic traits, a data frame, table, or array with individuals on rows and traits in columns

W

a vector of fitness (relative or absolute) of the same length as the number of indivdiuals represented in z

n.boot

number of bootstrap replicates to use for calculation of standard errors and P-values

standardized

whether or not to calculate variance-standardized selection differentials

Value

A table containing the estimated directional and quadratic selection gradients, and if bootstrap-based standard errors are generated, columns containing those standard errors and associated P-values

Author(s)

Michael Morrissey michael.morrissey@st-andrews.ac.uk

References

M.B. Morrissey and K. Sakrejda. 2013. Unification of regression-based methods for the analysis of natural selection. Evolution 67: 2094-2100.

See Also

gam.gradients

Examples

1
2
3
4
5
6
7
8
9
# simulated data (stabilizing selection)
z<-rnorm(200,0,2)
W<-rpois(200,exp(1-0.3*z^2))
d<-as.data.frame(list(W=W,z=z))

# estimate selection coefficients by least-squares regression
moments.differentials(z=z,W=W)
# note that standardized differentials and gradients are trivially
# the same in a univariate analysis

gsg documentation built on May 2, 2019, 9:37 a.m.