Learn R Programming

simFrame (version 0.1.2)

NAControl: Create objects of class "NAControl"

Description

Create objects of class "NAControl".

Usage

NAControl(...)

Arguments

...
arguments passed to new("NAControl", ...).

Value

  • An object of class "NAControl".

See Also

NAControl

Examples

Run this code
data(eusilc)
sam <- draw(eusilc[, c("id", "age", "eqIncome")], size = 25)

## 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