Learn R Programming

simFrame (version 0.5.0)

NAControl-class: Class "NAControl"

Description

Class for controlling the insertion of missing values in a simulation experiment.

Arguments

Objects from the Class

Objects can be created by calls of the form new("NAControl", ...) or NAControl(...).

Extends

Class "VirtualNAControl", directly. Class "OptNAControl", by class "VirtualNAControl", distance 2.

UML class diagram

A slightly simplified UML class diagram of the framework can be found in Figure 1 of the package vignette An Object-Oriented Framework for Statistical Simulation: The RPackage simFrame. Use vignette("simFrame-intro") to view this vignette.

References

Alfons, A., Templ, M. and Filzmoser, P. (2010) An Object-Oriented Framework for Statistical Simulation: The RPackage simFrame. Journal of Statistical Software, 37(3), 1--36. URL http://www.jstatsoft.org/v37/i03/.

See Also

"VirtualNAControl", setNA

Examples

Run this code
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