miss_sim: Simulation of missings

Description Usage Arguments Value Examples

View source: R/Missing_simulation.R

Description

Simulates missing at random using a normal copula to create correlations between the missing (type="MAR"). Missings appear in each column of the provided data frame with the same ratio.

Usage

1
miss_sim(dat, p = 0.2, type = "MAR", seed_nr = 123)

Arguments

dat

Data frame with only numeric values

p

Fraction of missings (for entire data frame)

type

Type of missingness. Either MCAR (=missing completely at random) or MAR (=missing at random)

seed_nr

Number for set.seed()

Value

data frame with only numeric values and NAs

Examples

1
2
3
data(cars)
cars_with_missings <- miss_sim(cars,p = .2,seed_nr = 4)
summary(cars_with_missings)

ClustImpute documentation built on May 31, 2021, 9:06 a.m.