I am new to Open and so I am still trying to learn my way about it - sorry for a simple question.
I used the reshape code to pair my twin data:
TwD_DM <- reshape(D_DM, idvar = "PAIRID", timevar = "TVAB", direction = "wide"
But then I now have two variables for zygosity - zyg.1 and zyg.2 for each twin pair.
I do not seem able to subset my data into MZ and DZ:
> vars <-c('DM','D')
> selVars <-c('DM1', 'D1', 'DM2', 'D2')
> useVars <-c('DM1', 'D1', 'age1', 'DM2', 'D2', 'age2')
> mzData <- subset(TwD_DM, zyg=1, useVars)
Error in subset.data.frame(TwD_DM, zyg = 1, useVars) :
'subset' must be logical
Shall I constrict so that zyg.1=zyg.2?
Any help will be much appreciated.