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