emxRelatednessMatrix: Create a relatedness matrix

View source: R/emxBehaviorGenetics.R

emxRelatednessMatrixR Documentation

Create a relatedness matrix

Description

This function creates a relatedness matrix as an MxMatrix, often used in behavior genetics modeling.

Usage

emxRelatednessMatrix(nvar, values, labels, name='h')

Arguments

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.

Details

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

Value

An MxMatrix object.

See Also

emxGeneticFactorVariance

Examples

   
# 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.


EasyMx documentation built on Feb. 16, 2023, 7:27 p.m.