zygo_recode: Zygocity - recode variables

View source: R/zygocity-funcs.R

zygo_recodeR Documentation

Zygocity - recode variables

Description

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.

Variable Answer option Form value Score value
Drop Like two drops of water 1 1
Like most siblings 2 -1
Don't know 3 0
Stranger Often 1 1
Occasionally 2 0
Never 3 -1
Don't know 4 0
Belief Monozygotic 1 1
Dizygotic 2 -1
Don't know 3 0
Eye, Voice & Dexter Exactly the same 1 1
Almost like 2 0
Different 3 -1
Don't know 4 0

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.

Usage

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")
zygo_recode(c(1:4, NA), type = "voice")
zygo_recode(c(1:3, NA), type = "drop")

LCBC-UiO/Questionnaires documentation built on July 18, 2023, 6:45 p.m.