process_twin_data: Process twin data into MxData objects

View source: R/twin_misc.R

process_twin_dataR Documentation

Process twin data into MxData objects

Description

Process twin data into MxData objects to add to MxModel. The function accepts raw data and covariance matrices.

Usage

process_twin_data(data, selvars, data_type = "raw", zyg = character(0))

Arguments

data

data.frame or list

data_type

'raw', 'cov' or 'cor', as required by type parameter of mxData

zyg

factor used to split the data frame when data_type = 'raw'

Details

When data_type = 'raw' (default), the data must be a data frame or matrix with raw data that will be split upon factor zyg and passed to mxData. When data_type = 'cov' or 'cor', the data must be a (named) list of arguments passed to mxData, including observed - covariation or correlation matrix, numObs - number of observations, means - vector of means. The type argument is not required as it is added from data_type. Refer to ?mxData for details on mxData arguments.

Value

A list of MxData objects


IvanVoronin/TwinAnalysis documentation built on July 24, 2024, 9:36 p.m.