# NOT RUN {
data(eusilcP)
eusilcP$age[eusilcP$age < 0] <- 0 # this actually occurs
sam <- draw(eusilcP[, c("id", "age", "eqIncome")], size = 20)
## missing completely at random
mcarc <- NAControl(target = "eqIncome", NArate = 0.2)
setNA(sam, mcarc)
## missing at random
marc <- NAControl(target = "eqIncome", NArate = 0.2, aux = "age")
setNA(sam, marc)
## missing not at random
mnarc <- NAControl(target = "eqIncome",
NArate = 0.2, aux = "eqIncome")
setNA(sam, mnarc)
# }
Run the code above in your browser using DataLab