create_missings: Create missing values in a 'data.frame'

View source: R/create_missingness.R

create_missingsR Documentation

Create missing values in a data.frame

Description

Create missing values in a data.frame

Usage

create_missings(
  data,
  idvars,
  prop_mis,
  prop_cc,
  patterns = NULL,
  weights = NULL,
  type = "RIGHT",
  groups = NULL,
  varlvls = NULL
)

Arguments

data

a complete data.frame

prop_mis

a named vector indicating the proportion of missing values per variable (only variables with proportions > 0 have to be included)

prop_cc

the proportion of complete cases

patterns

a matrix specifying the missing data patterns to be used; a 1 indicates a variable is completely observed and 0 that it is incomplete; if unspecified, this is created automatically.

weights

a matrix of the same dimension as patterns that indicates which variables are predictive of missingness in this pattern; this argument allows to define MCAR, MAR or MNAR missingness. If not specified, weights is set equal to patterns, i.e., MAR with all observed variables being predictors.


NErler/simvalidator documentation built on May 17, 2022, 7:54 a.m.