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

By *Nienke*

Created *06/24/2013 - 04:38*

Mon, 06/24/2013 - 04:38 — Nienke [1]

Hi,

I am trying to fit a biv model (2 continuous phenotypes) with sex as definition variable to test for mean differences, however I get the same error over and over again:

Error: A definition variable has been declared in model 'Chol' that does not contain a data set

I cannot find where it goes wrong, I suspect it's somewhere in the matrices declared to store linear coefficients for covariate:

grandMean <- mxMatrix(type="Full", nrow=1, ncol=nphen, free = TRUE, values=c(2700, 19), label=c("mean1","mean2"), name="Mean")

B_Sex <- mxMatrix(type="Full", nrow=ndef, ncol=nvar, free=TRUE, values=c(900,2.7), label=(rep(c("bphen1","bphen2"), 2)), name="bSex" )

defSex <- mxMatrix(type="Full", nrow=ndef, ncol=nvar, free=FALSE, labels=(rep(c("data.Sex1","data.Sex2"),each=2)), name="Sex")

SexR <- mxAlgebra(bSex * Sex, name="SexR")

expMean <- mxAlgebra(name="expMean", expression= cbind(Mean, Mean) + SexR)

Any help would be very much appreciated!

Regards,

Nienke

**Links:**

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

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

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

[4] http://openmx.psyc.virginia.edu/forums/opensem-forums/behavioral-genetics-models