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

By *CarolKan*

Created *04/22/2014 - 10:31*

Tue, 04/22/2014 - 10:31 — CarolKan [1]

Dear all

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.

Kind regards

Carol

**Links:**

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

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

[3] http://openmx.psyc.virginia.edu/forums/openmx-help/converting-and-openmx