missing.gen0: Generating random missing values on a data matrix

Description Usage Arguments Details Value Author(s) See Also Examples

Description

The function generates a number of missing values (NA) completely at random on a data matrix.

Usage

1
missing.gen0(mat, nummiss)

Arguments

mat

a matrix of numerical data.

nummiss

number of missing values.

Details

The function generates a number of missing values (NA) completely at random on a data matrix.

Value

The data matrix with missing values (NA).

Author(s)

Nadia Solaro, Alessandro Barbiero, Giancarlo Manzi, Pier Alda Ferrari

See Also

missing.gen

Examples

1
2
3
4
5
6
sigma <- matrix(0.4, 4, 4)
diag(sigma) <- 1
x0 <- rmvnorm(n=100, mean=rep(0, 4), sigma=sigma)
x0 # complete matrix
x <- missing.gen0(x0, 50)
x # matrix with 50 missing values

GenForImp documentation built on May 2, 2019, 2:15 p.m.