View source: R/emxBehaviorGenetics.R
emxTwinModel | R Documentation |
This function creates an MxModel and associated objects for a basic Twin model.
emxTwinModel(model, relatedness, data, run=FALSE, use, name='model', components='ACE') emxModelTwin(model, relatedness, data, run=FALSE, use, name='model', components='ACE')
model |
Description of the model. Currently ignored. |
relatedness |
Description of the relatedness patterns. Currently the name of the variable that gives the coefficient of relatedness. |
data |
data.frame or matrix. The data set used in the model. |
run |
logical. Whether to run the model before returning. |
use |
character vector. Names of the variables used in the model. |
name |
character. Name of the model. |
components |
character. Name of the variance components to include. Current valid options are 'ACE' and 'ADE' |
Because the model argument is ignored and the relatedness argument has limited use, this function only constructs a very basic and rigid Twin model. It creates a Cholesky model with A, C, and E components or a Cholesky model with A, D, and E components. The means are constrained equal across twins.
MxModel.
emxFactorModel
# Create an ACE model in 10 lines # 8 of those are data handling. # 2 are the actual model. require(EasyMx) require(OpenMx) data(twinData) twinVar = names(twinData) selVars <- c('ht1', 'bmi1','ht2','bmi2') mzdzData <- subset(twinData, zyg %in% c(1, 3), c(selVars, 'zyg')) mzdzData$RCoef <- c(1, NA, .5)[mzdzData$zyg] ## Not run: run3 <- emxTwinModel(model='Cholesky', relatedness='RCoef', data=mzdzData, use=selVars, run=TRUE, name='TwCh') ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.