tbates / umx

Making Structural Equation Modeling (SEM) in R quick & powerful
https://tbates.github.io/
44 stars 17 forks source link

enhance umx_make_TwinData to work with raw correlations as well as AA, CC, EE #31

Closed tbates closed 7 years ago

tbates commented 7 years ago

umx_make_TwinData is already pretty slick in simulating tiwn data based on any 2 of AA, CC, and EE, gxE, etc.

A handy enhancement would be to support MZr and DZr as parameters, so this would work:

require(umx)
tmp = umx_make_TwinData(10000, MZr = .86, DZr= .60, varNames= "IQ")
mzData = tmp[[1]]
dzData = tmp[[2]]
umxAPA(mzData); umxAPA(dzData)

m1 = umxACE(selDVs = "IQ", dzData = dzData, mzData = mzData, sep = "_T")

plot(m1)
|   |   a1|   c1|   e1|
|:--|----:|----:|----:|
|IQ | 0.72| 0.58| 0.37|
tbates commented 7 years ago

done