Learn R Programming

SSLfmm (version 0.1.0)

simulate_mixed_missingness: Simulate a Gaussian Mixture Dataset with a Mixed-Missingness Mechanism (MAR + MCAR)

Description

Simulate a Gaussian Mixture Dataset with a Mixed-Missingness Mechanism (MAR + MCAR)

Usage

simulate_mixed_missingness(
  n = 500,
  pi,
  mu,
  sigma,
  xi0 = 2,
  xi1 = 3,
  alpha = 0.1,
  seed_id = 123
)

Value

A list with:

  • data: data.frame with columns x1..xp, en, missing, label, truth

  • true_setup: list(pi, mu, sigma)

  • groups: list(mar_group, obs_group, mcar_in_mar, mcar_in_obs)

  • probs: vector prob_mar

  • raw: original rmix output dat augmented with en and labels

Arguments

n

Integer; sample size.

pi

Numeric vector; mixing proportions (sum to 1).

mu

Matrix (p x K); component means, columns = components.

sigma

Array (p x p x K); component covariance matrices.

xi0

Numeric; MAR logit intercept.

xi1

Numeric; MAR logit slope on entropy.

alpha

Numeric in [0,1]; MCAR rate applied within both MAR and observed groups.

seed_id

Integer; seed passed to rmix() (your generator).

Details

Requires user-provided functions:

  • rmix(n, pi, mu, sigma, seed_number)

  • get_entropy(dat, n, p, g, paralist)

Missingness mechanism codes:

  • 0 = fully observed

  • 1 = MCAR

  • 2 = MAR (entropy-based)