emxRelatednessMatrix: Create a relatedness matrix

Description Usage Arguments Details Value See Also Examples

View source: R/emxBehaviorGenetics.R

Description

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

Usage

1
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

1
2
3
4
5
   
# 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.

jpritikin/emx documentation built on May 19, 2019, 11:50 p.m.