Published on *OpenMx* (http://openmx.psyc.virginia.edu)

By *tbates*

Created *08/21/2009 - 06:24*

Fri, 08/21/2009 - 06:24 — tbates [1]

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"),

2. 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?

**Links:**

[1] http://openmx.psyc.virginia.edu/users/tbates

[2] http://openmx.psyc.virginia.edu/thread/69

[3] http://openmx.psyc.virginia.edu/thread/86

[4] http://openmx.psyc.virginia.edu/forums/openmx-developer-forums/documentation