eigenPar: A multivariate test of parallel evolution between multiple...

View source: R/eigenPar.R

eigenParR Documentation

A multivariate test of parallel evolution between multiple lineages

Description

Test for the presence of preferencial lines of evolution among multiple independent lineages/replicates.

Usage

eigenPar(
  X1,
  X2 = NULL,
  null = c("random", "drift"),
  sims = 999,
  alpha = c(0.025, 0.975),
  G = NULL,
  parallel = FALSE
)

Arguments

X1

Matrix kxn for k number of traits and n lineages. A matrix of multivariate averages of lineages before selection/ experimental manipulation OR a multivariate matrix of differences between before and after selection.

X2

NULL or a kxn matrix of multivariate averages of lineages before selection. If a value is provided, it has to be of the same dimentions as X1

null

Character. Type of null hypothesis to be tested. If null= "random", tests if empirical vectors differs from totally random directions. If null="drift", function tests if vectors differsn from what is expected under drift. A G matrix has to be provided.

G

Default to NULL. A kxk matrix of genetic covariances. Only used if null="drift".

Details

The user can provide the function with either the lineages means before and after selection/experimental manipulation (by using both X1 and X2 respectively), or the vectors of differences between lineages.

The function uses the within-lineage vectors of differences to calculates the matrix C of pairwise vector correlations

C=XX^t

with X being the matrix of within-lineage normalized vectors of divergence. The eigenvalues of C are a measure of how much divergence occured along the same directions.

To evaluate if observed patterns cannot be explained by chance alone, the function employs a simulation procedure to generate a distribution of eigenvalues. The "random" eigenvalues are confronted agaist the observed ones to provide a p-value for each individual dimension. The function allows for the test of two null hypotheses. If null="random", the null distribution is built by re-estimating C from completly random vectors, as suggested by De Lisle & Bolnick (2020). If null="drift", vectors are simulated using the multivariate breeder's equation (Lande, 1979) as follows

\Delta x= G (t/Nef)

where G is the among traits genetic variance-covariance matrix, t is time and Nef is the effective population size. Because we are only interested in directions, both t and Nef can be ignored, but G has to be provided by the user.

Value

eigenvalues
CI
A
vector correlation matrix

Author(s)

Fabio Andrade Machado

References

De Lisle, S. P., & Bolnick, D. I. 2020. A multivariate view of parallel evolution. Evolution, 65, 1143–16. http://doi.org/10.1111/evo.14035

See Also

angleTest


FabioLugar/mvEvol documentation built on Dec. 21, 2024, 7:25 p.m.