MANAR_mechanism: MAAR missing data mechanism

Description Usage Arguments Details Value See Also Examples

Description

MAAR_mechanism takes a matrix and deletes some of the entries using a missing always not at random mechanism.

Usage

1
2
MANAR_mechanism(samples, miss.coef, miss.nvar, miss.var = NULL, prob.coef,
  self.dep = FALSE, seed = NULL)

Arguments

samples

A numeric matrix with no missing values.

miss.nvar

An integer specifying the number of variables that will have missing values. miss.nvar <= ncol(samples).

miss.var

An integer vector of length equal to miss.nvar specifying which variables will have missing values. If left blank a random sample will be taken from the columns of samples will be taken.

prob.coef

A numeric matrix that represents the regression coefficients that will be used to generate the missing data pattern. The nrow(miss.coef) == miss.var and ncol(miss.coef) == ncol(samples).

self.dep

A logical values indicating if the probability of variable j missing depends on the values that variable j took.

seed

A numeric value used to set a seed, leave blank for NULL.

miss.coef:

A numeric value or a vector of length equal to miss.nvar. The missingness coefficient(s) determines the proportion of missing values for each variable.

Details

MAAR_mechanism is part of the data generating functions used when conducting simulation studies involving missing data. The probability that a variable is missing is depends on all variables. For example, assume we have 3 variables, Y_1 and Y_2 can have missing values and Y_3 is always fully observed. Let R_1 and R_2 be the response indicators for Y_1 and Y_2 respectively Then the probability that the i-th variable is missing is

p(R_{i,1}=1|Y_{i,\cdot}) = \text{logit}^{-1}(α_1+β_1Y_{i,3}).

p(R_{i,2}=1|Y_{i,\cdot},R_{i,1}) = \text{logit}^{-1}(α_2+ γ_1Y_{i,1}+β_2Y_{i,3}).

The vector β is specified using the prob.coef parameter, and α is selected to ensure that the proportion of missing values in each variable is equal to the miss.coef parameter.

Value

samples.obs A data matrix of dimensions equal to samples with some missing values.

See Also

Other data generating functions: MAAR_mechanism_noindep, MAAR_mechanism, logistic_prob, sample_mvn

Examples

1
2
3
4
5
6
# 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.mvn <- MANAR_mechanism(samples = samples.mvn, miss.coef = 0.2, 
                           miss.nvar = 1, miss.var = 1, 
                           prob.coef = matrix(c(-1, 0.5, 0.7,- 0.2), 1, 4))

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