conditionalG | R Documentation |
conditinoalG
calculates a conditional variance matrix.
conditionalG(G, condition_on = NULL)
G |
A variance matrix (must be symmetric and positive definite). |
condition_on |
Either an integer with the column number indicating which trait to condition on or a vector with several column numbers (integers). |
The function calculates a sub-matrix of G
conditional on the
traits defined by the the condition_on
vector. The function is based
on equation 3 in Hansen et al. (2003).
A matrix that is a sub-matrix of the input matrix conditional on the non-included traits.
Geir H. Bolstad
Hansen TF, Armbruster WS, Carlsson ML & PĂ©labon C. 2003. Evolvability and genetic constraint in Dalechampia blossoms: genetic correlations and conditional evolvability. J. Exp. Zool. 296B:23-39.
# Constructing a G-matrix: G <- matrix(c( 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 2, 1, 1, 1, 1, 3 ), ncol = 4) # Computing a conditional 2x2 sub-matrix by conditioning on # trait 3 and 4: G_sub_conditional <- conditionalG(G, condition_on = c(3, 4)) G_sub_conditional # The average evolvabilities of this matrix can then be # compared can than be compared to the average evolvabilities # of the corresponding unconditional sub-matrix of G: evolvabilityMeans(G_sub_conditional) evolvabilityMeans(G[-c(3, 4), -c(3, 4)])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.