emxTwinModel: Creates behavior genetics Twin Model

Description Usage Arguments Details Value See Also Examples

View source: R/emxBehaviorGenetics.R

Description

This function creates an MxModel and associated objects for a basic Twin model.

Usage

1
2
emxTwinModel(model, relatedness, data, run=FALSE, use, name='model')
emxModelTwin(model, relatedness, data, run=FALSE, use, name='model')

Arguments

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.

Details

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. The means are constrained equal across twins.

Value

MxModel.

See Also

emxFactorModel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
   
# 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]

run3 <- emxTwinModel(model='Cholesky', relatedness='RCoef',
	data=mzdzData, use=selVars, run=TRUE, name='TwCh')

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