rMNAR {MNARclust} | R Documentation |
Function used to simulate data from mixture model with specific missingness mechanism
Description
Generation of data set to perform the simulation presented in Section 4.1 of Du Roy de Chaumaray (2020)
Usage
rMNAR(
n,
K,
d = 3,
delta = 3,
gamma = 1,
law = "gauss",
linkmissing = "logit-X"
)
Arguments
n |
sample size (numeric of length 1) |
K |
number of clusters (numeric of length 1) |
d |
number of variables (numeric of length 1) |
delta |
tuning parameter to define the rate of misclassification (numeric of length 1) |
gamma |
tuning parameter to define the rate of missingness (numeric of length 1) |
law |
specifies the distribution of the variables within components (character that must be equal to gauss, student, laplace or skewgauss) |
linkmissing |
specify the missingness mechanism (character that must be equal to MCAR, logit-Z, logit-X or censoring) |
Value
rMNAR returns a list containing the observed data (x), the true cluster membership (z), the complete data (xfull), the cluster membership given by the Baye's rule (zhat), the empirical rates of misclassification (meanerrorclass) and missngness (meanmiss).
References
Clustering Data with Non-Ignorable Missingness using Semi-Parametric Mixture Models, Marie Du Roy de Chaumaray and Matthieu Marbac <arXiv:2009.07662>.
Examples
set.seed(123)
# Data generation
ech <- rMNAR(n=100, K=3, d=3, delta=2, gamma=1)
# Head of the observed data
head(ech$x)
# Table of the cluster memberships
table(ech$z)
# Empirical rate of misclassification
ech$meanerrorclass
# Empirical rate of missingness
ech$meanmiss