Coding

"Form value" is the value the answer option has in the data file. "Score value" is the value used in the algorithm when zygocity is calculated.

VariableAnswer optionForm valueScore value
DropLike two drops of water11
Like most siblings2-1
Don't know30
StrangerOften11
Occasionally20
Never3-1
Don't know40
BeliefMonozygotic11
Dizygotic2-1
Don't know30
Eye, Voice & DexterExactly the same11
Almost like20
Different3-1
Don't know40

No answer option is used directly in the calculations, only the score values. In the following, it is these values (-1, 0 or 1) that are used in the algorithms. E.g. has Drop in the formula value 1 for a positive answer to whether the twins were equal to two drops of water.

zygo_recode(x, type)

Arguments

x

vector of numbers, either 1:3 or 1:4

type

Type of question to recode. Can either be 05, 06, 07 or 08, or drop, stranger, dexterity, voice, eye or belief.

Value

return a vector with 0, -1 or 1.

Examples

zygo_recode(c(1:4, NA), type = "eye")
#> [1]  1  0 -1  0 NA
zygo_recode(c(1:4, NA), type = "voice")
#> [1]  1  0 -1  0 NA
zygo_recode(c(1:3, NA), type = "drop")
#> [1]  1 -1  0 NA