View source: R/emxBehaviorGenetics.R
emxRelatednessMatrix | R Documentation |
This function creates a relatedness matrix as an MxMatrix, often used in behavior genetics modeling.
emxRelatednessMatrix(nvar, values, labels, name='h')
nvar |
numeric. The number of variables for the matrix, i.e. the number of rows or columns. |
values |
numeric vector. Values used in the matrix. |
labels |
character vector. Labels of the elements in the matrix. See Details. |
name |
character. The name of the matrix created. |
The labels
argument can be used to create a "definition variable" which populates the value from one of the data columns for each row in the data. In this context, if the genetic relatedness coefficient between a pair of individuals is given by a column in the data then that information can be used to create in the relatedness matrix. Alternatively, multiple groups can be created
An MxMatrix object.
emxGeneticFactorVariance
# Create a Cholesky variance matrix called 'A' require(EasyMx) ahmat <- emxRelatednessMatrix(2, c(1, .5, 1), labels=c(NA, 'data.RCoef', NA), name='AH') # data.RCoef creates a definition variable and ignores the .5 value.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.