gen.mar.dv.R: sim_miss_data

Description Usage Arguments Details Value

Description

sim_miss_data generates a dataframe with a specified missingness pattern.

Usage

1
2
gen.mar.dv.R(data, R, miss_prob, var, varlist, dv_miss_prob, miss.bound.on,
  miss.bound.val, max_miss, directory, seed)

Arguments

data

dataset you want to inflict the missingness on

R

Number of datasets you want.

var

which variable will cause the missingness?

varlist

which variables will be used in the dataset?

dv_miss_prob

set the probability that the dv will go missing

miss.bound.on

set the missing boundary on, creating a MNAR/MAR scenario. = 1 when you want the missingness to only occur when miss.bound.valary is a certain value = 0 when you don't want the missingness to occur according to a miss.bound.value

miss.bound.val

at what value do you want things to go missing? e.g., from value 60 - make the missingness occur

max_miss

what is the probability that things will go missing if miss.bound is on?

directory

where you want the file to be saved, e.g., "~/Dropbox/ALL THE THINGS/PhD/MD_Paper_Prep/knitr/ 2014_28_04_miss_data_sim/simulated_data/mcar"

seed

set the random seed so that the results can be replicated. #examples

miss.perc

percent of missing data you want (approximately)

Details

This function gives the user a great deal of control over creating different patterns of missingness, however it was created with a specific purpose in mind, and so it might actually need to be broken up into a couple of different functions, as it is quite a large function.

Value

this function currently saves as an Rdataset.


njtierney/mex documentation built on May 23, 2019, 8:22 p.m.