View source: R/emxBehaviorGenetics.R
emxGeneticFactorComponent | R Documentation |
This function creates all the objects needed for Genetic Factor component
emxGeneticFactorComponent(x, xname, xvalues=.8, xfree=TRUE, xlbound=NA, xubound=NA, h=2, hname=paste0('H', xname), hvalues, hlabels)
x |
character vector. The base names of the variables used for the matrix with no repetition for twins (x, y, z not x1, y1, z1, x2, y2, z2). |
xname |
character. Name of the component matrix. |
xvalues |
numeric vector. Values of the genetic factor loadings. |
xfree |
logical vector. Whether the genetic factor loadings are free. |
xlbound |
numeric vector. Lower bounds of the factor loadings. |
xubound |
numeric vector. Upper bounds of the factor loadings. |
h |
numeric. The number of variables for the relatedness matrix, i.e. the number of critters with relationships |
hname |
character. Name of the relatedness matrix. |
hvalues |
numeric vector. Values for the relatedness matrix. |
hlabels |
character vector. Labels for the relatedness matrix. |
This function is a combination of emxGeneticFactorVariance, emxRelatednessMatrix, and emxKroneckerVariance.
A list with elements (1) the genetic factor loadings matrix, (2) the full positive definite variance matrix, (3) the relatedness matrix, and (4) the Kronecker product of the variance matrix and the relatedness matrix.
emxCholeskyComponent
# Create genetic factor A component for DZ twins require(EasyMx) xvars <- paste0('x', 1:4) acomp <- emxGeneticFactorComponent(xvars, 'A', hvalues=c(1, .5, 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.