Hi Everybody!!!
I'm really naive using OpenMx. So probably my question is a silly mistake. Any way;
I try to perform a twin analysis with sex and age as covariates. I have used the script "UnivariateTwinAnalysis_MatrixRaw-3" from Dr. neale that I found in this forum. But I don't want generate sex and age data because I have mine. So I changed a bit the script.
summary(test)
selVars <- c('hear1','hear2')
mzData <- as.matrix(subset(test, zyg==1, c(hear1,hear2,sex1,sex2,age1,age2)))
dzData <- as.matrix(subset(test, zyg==2, c(hear1,hear2,sex1,sex2,age1,age2)))
colMeans(mzData,na.rm=TRUE)
colMeans(dzData,na.rm=TRUE)
cov(mzData,use="complete")
cov(dzData,use="complete")
head(mzData)
head(dzData)
I haven't change any more in the script. However when I run the script I have the following Error message:
Error: The data object 'MZ.data' contains an observed matrix that is not of type 'double'
Any suggestions to fix it??
Thank you so much in advance!!
Sorry for the inconvenience and solve it!
But now I have another question.
It is possible to add a extra covariate, the third one ? I mean, a variable that a symptom is present or absent. And if so it must be defined as 0 and 1 or 1 and 2 (like sex)?
Thanks you so much!
It certainly is. You'd need to edit the MxMatrices named 'MZDefVars', 'DZDefVars', and 'beta' to accommodate the new variable. For instance,
and
0 & 1 would provide the easiest interpretation, I'd say.
Thanks!!!!!!!!!!!
I think this is an area where umx is of value in that it brings a higher level function which takes an argument as to the list of covariates to use. The headache of getting the rows & columns of matrices of covariates and their corresponding beta weights and algebra right has been solved for the general case.