You are here

UnivariateTwinAnalysis_MatrixRaw.R

4 posts / 0 new
Last post
tbates's picture
Offline
Joined: 07/31/2009 - 14:25
UnivariateTwinAnalysis_MatrixRaw.R

There are close to zero comments on this script, and much of it is quite obscure.

  1. There are still places with T instead of TRUE and unlabeled parameters relying on being in the right place:

mxMatrix("Full", 1, 2, T, 20, "mean", dimnames=list(NULL, selVars), name="expMeanMZ"),

  1. Most matrices need a comment about what it is they are holding, i.e.:

mxMatrix("Full", nrow=1, ncol=1, free=TRUE, values=.6, label="a", name="X") # what is this for?

mxAlgebra(X %*% t(X), name="A"), # what does this do?

Proposing an algebra for the the groups is critical and needs a comment:

mxAlgebra(rbind (cbind(A+C+E , A+C),
cbind(A+C , A+C+E)), dimnames = list(selVars, selVars), name="expCovMZ"), # Algebra for expected variance/covariance matrix in MZs

The actual MZ and DZ groups are quite obscure, especially because, unlike the pathic example, all the expectations are done outside these groups - some comment on this would be helpful. Something along the lines of

"We next build a model for the MZ data. This needs to read in the columns of manifest variables we are modeling (selVars), which will provide the observed covariance matrix and means for this group. We need then to link these observations to an objective - our expected MZ covariance and means, so that the likelihood of the observed data can be calculated from any departure from the expectations our model generates."

mxModel("MZ",
    mxData(mzfData, type="raw"), 
    mxFIMLObjective("twinACE.expCovMZ", "twinACE.expMeanMZ")), 

Can someone have a look and add these or further clarifications?

mspiegel's picture
Offline
Joined: 07/31/2009 - 15:24
Sounds like you've

Sounds like you've volunteered yourself to add comments to this script.

tbates's picture
Offline
Joined: 07/31/2009 - 14:25
What's the workflow with

What's the workflow with that: Can I just make changes and commit them via svn?

mspiegel's picture
Offline
Joined: 07/31/2009 - 15:24
Yes, that's the recommended

Yes, that's the recommended way.