prep: Prepare for diagnostic

Description Usage Arguments Details Value See Also Examples

Description

prep takes a data frame, or matrix and prepares it to be analyzed by diagMAAR.

Usage

1
prep(dt, daigtest)

Arguments

dt

A numeric matrix, data frame or data table.

daigtest

A string indicating which diagnostic daigtest to use. The options are: cop, dtmm, ppp. See help for prep.daigtest.

Details

prep is part of the data preparation functions used to pre-process data sets so that missing data diagnostic tests can easily be applied. Currently there are three diagnostic test implemented: A comparison of conditional means (ccm), directly testing a postulated missingness mechanism (dtmm), and Gaussian copula (cop).

Value

prep A prep S3 object that contains the original data, the desired diagnostic test to use, the sample size, the number of missing variables, the location of the missing variables, the number of variables and a data set that has the missingness indicators appended.

See Also

Other prep: prep.ccm, prep.cop, prep.dtmm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Generate 100 iid samples from a MVN with correlation equal to 0.3
samples.mvn <- sample_mvn(5, 0.3, 100)
# Take the Gaussian data and and delete some values from the fourth row.
obs.nvmn <- MAAR_mechanism(samples = samples.mvn, miss.coef = 0.2, 
                           miss.nvar = 1, miss.var = 4, 
                           prob.coef = matrix(c(-1, 0.5, 0.7, - 0.2), 1, 4))
dt.prep <- prep(obs.mvn, "cop")
print(dt.prep)
dt.prep <- prep(obs.mvn, "dtmm")
print(dt.prep)
dt.prep <- prep(obs.mvn, "ccm")
print(dt.prep)

bojinov/diagMAAR documentation built on May 22, 2019, 2:22 p.m.