1 들어가며 — Ch.14 의 자리와 결측 데이터의 결정적 중요성
Ch.4-13 의 모든 mixed-effects framework 의 공통 가정 — 결측 데이터 메커니즘. Ch.14 는 이 가정을 명시적으로 다루고 위반 시 처리 방법 제시.
| Chapter | 모형 | Missing Data 가정 |
|---|---|---|
| Ch.4-7 | MRM/CPM/MRM-AC | MAR (full likelihood) |
| Ch.8 | GEE | MCAR (강한 가정) |
| Ch.9-12 | GLMM | MAR (full likelihood) |
| Ch.13 | 3-Level GLMM | MAR |
| Ch.14 | 결측 데이터 | 모든 framework 의 공통 토대 |
→ Ch.14 가 다른 모든 chapter 의 가정을 명시적으로 검토.
“Ch.14 = Ch.4-13 의 모든 mixed-effects framework 의 공통 가정 (결측 데이터 메커니즘) 의 정밀 분석. Rubin (1976) typology — 3 가지 mechanism: MCAR (가장 강한 가정, \(R_i \perp y_i^O, y_i^M\)), MAR (\(R_i \perp y_i^M \mid X_i, y_i^O\) — 관측 데이터 조건부 독립), MNAR (\(R_i\) 가 \(y_i^M\) 의존, 검정 불가능). 모형 별 가정 차이: MRM/CPM (full likelihood) → MAR 충분 (ignorability), GEE → MCAR 필요. § 14.4 Little’s MCAR test 로 MCAR vs MAR 구분. § 14.5 Nonignorable missingness — Selection model (Diggle-Kenward 1994) + Pattern-Mixture (Little 1993, 1994) 의 두 framework + sensitivity analysis 의 필수성. 결측이 클수록 가정의 영향 크다 — analytic decision 의 통계적 토대.”
본 overview 의 절 구성:
- § 14.1 Introduction.
- § 14.2 Missing Data Mechanisms (Rubin typology).
- § 14.3 Models 와 Mechanisms 의 매핑.
- § 14.4 Testing MCAR.
- § 14.5 Nonignorable Missingness (Selection + Pattern-Mixture).
- § 14.6 핵심 메시지.
2 § 14.1 — Introduction
2.1 종단 연구의 결측 데이터
저자 본문 인용:
“Even in well-controlled situations, missing data invariably occur in longitudinal studies.”
세 가지 흔한 형태:
- Intermittent missing: subject 가 일부 시점만 measurement 안 됨 (재방문 가능).
- Item nonresponse: 한 시점에서 일부 변수만 응답.
- Dropout (lost to follow-up): 한 시점 이후 영원히 측정 안 됨.
→ 모두 처리 방법 다름.
저자 본문 인용:
“An attractive and important feature of many of the models considered in this book is their flexibility in handling missing data. For example, for both MRMs and GEE models, subjects are not assumed to be measured at the same number of timepoints, and in fact, can be measured at different timepoints.”
왜 Mixed-Effects 가 결측 데이터에 유리:
- 같은 환자의 시점 수 변동 자연 처리 (variable cluster size).
- ANOVA / repeated measures 처럼 complete cases 만 사용 안 함.
- → 결측 데이터의 정보 손실 최소화.
그러나 — 여전히 가정에 의존:
- 결측의 메커니즘 (\(R_i\) 가 어떻게 결정되는가) 이 모형 결과에 영향.
- → § 14.2 의 typology + § 14.3 의 모형 별 가정 분석 필수.
핵심 references:
- Little (1995) — seminal article.
- Hogan et al. (2004) — tutorial.
- Diggle, Heagerty, Liang & Zeger (2002) — longitudinal data analysis textbook.
- Little & Rubin (2002) — missing data textbook.
- Verbeke & Molenberghs (2000) — linear mixed models.
2.2 Chapter 의 범위
저자 본문 인용:
“we present most of the missing data methods in terms of longitudinal modeling using mixed-effects regression models (MRMs) for continuous outcomes… we will focus on ways in which the basic MRM can be augmented to more generally deal with missing data, detailing how selection and pattern-mixture MRMs can be constructed using standard software.”
다루는 것:
- 결측 메커니즘 (MCAR/MAR/MNAR).
- MRM 의 missing data 처리 능력.
- Selection model (§ 14.5.1).
- Pattern-mixture model (§ 14.5.2).
다루지 않는 것:
- Multiple imputation: Rubin (1987, 1996), Schafer (1997).
- Weighting approaches: Robins et al. (1995), Rotnitzky & Robins (1999), Demirtas (2004a).
→ 본 chapter 는 mixed-effects framework 위에서의 결측 처리 에 집중.
다른 응답 형태: Continuous (MRM) 위주이지만 categorical (GLMM) 에도 일반화 가능.
3 § 14.2 — Missing Data Mechanisms (Rubin Typology)
3.1 표기
저자 본문 인용:
“The missing data mechanism is what characterizes the reasons for the missing data. In other words, the mechanism addresses the basic question of ‘why are the data missing?’”
표기:
- \(R_{ij}\): indicator — 1 if observed, 0 if missing.
- \(R_i = (R_{i1}, R_{i2}, \ldots, R_{in})^\top\): subject \(i\) 의 indicator vector.
\(y_i\) 의 분해:
- \(y_i = (y_{i1}, \ldots, y_{in})^\top\): complete (planned) dependent variable.
- \(y_i^O\): actually observed (관측된).
- \(y_i^M\): missing (관측 안 된).
Dropout 표기:
- \(D_i = j'\): subject \(i\) 가 시점 \((j' - 1)\) 와 \(j'\) 사이 dropout.
- \(D_i = 0\) 또는 \(n + 1\): completers (해석에 따라 다름).
\(y_i^M\) 의 의미:
- “측정했어야 했지만 못한 값” — 실제로는 존재하지 않음.
- Counterfactual 또는 potential outcome.
- → 결측 메커니즘의 분류는 “관측되지 않은 가상 값과의 관계” 에 따라.
Dropout vs Intermittent missing:
- Dropout: \(R_i\) 가 monotone pattern (한 번 0 이면 이후 모두 0).
- Intermittent: \(R_i\) 가 임의 pattern (관측 → 결측 → 관측 가능).
- → Dropout 분석이 더 단순 (monotone 가정).
\(D_i\) 의 단순화:
- Monotone dropout 가정 시 \(R_i\) 대신 단일 \(D_i\) 만으로 충분.
- 통계적 분석 단순화.
- 본 chapter 의 많은 분석이 dropout 기준.
3.2 § 14.2.1 — MCAR (Missing Completely at Random)
가장 강한 가정 — 결측이 dependent variable 과 독립:
\[ R_i \perp y_i^O, y_i^M \]
→ “\(R_i\) 가 \(y_i\) 의 관측 부분과 미관측 부분 모두와 무관”.
Covariate-dependent MCAR (Little 1995):
\[ R_i \perp y_i^O, y_i^M \mid X_i \]
→ 관측 covariate \(X_i\) 조건부 독립.
→ 시간이 지남에 따라 결측 증가 허용 (time 을 \(X_i\) 에 포함).
MCAR 의 의미:
- “실제로 어떤 값을 측정했어도 결측 여부가 같을 것”.
- 결측이 random — 우연히, dependent variable 과 무관하게.
임상 예시 (MCAR 충족):
- 환자가 우연히 hospital 못 옴 (날씨, 차량 고장 등).
- 측정 도구 고장 (random failure).
- Administrative error.
임상 예시 (MCAR 위반):
- 우울증 환자가 너무 우울해서 follow-up 안 옴.
- 호전된 환자가 더 이상 진료 필요 없어 안 옴.
- → 결측이 dependent variable (우울증 정도) 와 연관.
Covariate-dependent MCAR 의 가치:
- 시간 따라 결측 증가는 longitudinal study 의 자연 패턴.
- \(X_i\) 에 time 포함 → MCAR 가정 만족 가능.
- 시간 외에도 baseline covariate (age, baseline severity 등) 추가 가능.
Schafer-Graham (2002), Demirtas-Schafer (2003) 권고:
“How likely is it that you will remain in this study through the next measurement period?”
→ 자기 보고 attendance 가능성을 covariate 추가 → MCAR 가능성 ↑.
MCAR 의 강점:
- 만족 시 — 모든 표준 분석 (complete case 포함) 이 unbiased.
- 만족 시 — GEE, MRM, CPM 모두 valid.
MCAR 의 약점:
- 가정 너무 강함 — 임상 현실에서 자주 깨짐.
- Dropout 이 outcome 과 연관되면 위반.
3.3 § 14.2.2 — MAR (Missing at Random)
저자 본문 인용:
“Missing at random (MAR) goes one important step further by allowing the missingness to depend on both fully observed model covariates \(X_i\) and the observed dependent variable vector \(y_i^O\).”
\[ R_i \perp y_i^M \mid X_i, y_i^O \]
→ “관측 covariate + 관측 dependent variable 조건부, 결측이 미관측 dependent variable 과 독립”.
MAR 의 의미:
- 결측이 관측된 데이터 (covariate + 이전 관측치) 에는 의존 가능.
- 그러나 미관측 데이터 (\(y^M\)) 에는 의존 안 함.
임상 예시 (MAR):
- “Hamilton depression score < 15 인 환자가 dropout” (Fitzmaurice 2004).
- 즉 관측된 점수가 dropout 결정 → MAR.
- 미관측 점수에는 의존 안 함 (관측된 정보로 충분히 예측 가능).
MCAR vs MAR 의 차이:
- MCAR: 결측이 어떤 dependent variable 와도 무관 (강한 가정).
- MAR: 결측이 관측된 dependent variable 에 의존 가능 (덜 강한 가정).
- → MAR 가 더 현실적.
Default 권고 (Fitzmaurice et al. 2004):
“many experts on missing data advocate use of MAR analysis as the default approach, unless there are strong reasons to support the MCAR assumption.”
MCAR vs MAR 검정 가능:
- 두 가정의 차이가 \(y_i^O\) 활용 — 관측 가능.
- Little’s MCAR test (§ 14.4) 로 검정.
결정적 권고:
- \(X_i\) 와 covariance structure 가 정확히 specified 되어야 MAR 가 valid.
- Covariate 누락 또는 구조 잘못 → MAR 가정 위반 → biased 추정.
저자 본문 인용:
“A missing data mechanism is ignorable if (1) the missing data are MAR and (2) the parameters of the data model and the parameters of the missingness mechanism are distinct.”
두 조건:
- MAR.
- Distinct parameters condition (Shih 1992): data model 모수와 missingness 모수가 독립.
Ignorable: missing data mechanism 을 무시하고 모형화 가능.
Full likelihood-based models (MRM, CPM):
- MAR + distinct parameters → ignorable.
- 결측 메커니즘 명시적으로 모형 안 함.
- → 단순한 분석으로 valid.
GEE1 (Liang-Zeger 1986):
- MCAR 필요 (MAR 만으로 부족).
- 더 강한 가정.
- → MAR 데이터에 GEE 사용 시 biased.
왜 차이:
- Full likelihood: \(y_i^O\) 의 결합 분포 모형화 → MAR 자동 처리.
- GEE: marginal moments 만 사용 → MAR 의 추가 정보 활용 못함.
→ 결측 데이터가 있는 longitudinal study 에서 MRM/CPM 우선 권고.
예외 — GEE 변형:
- WGEE (weighted GEE, Robins et al. 1995): MAR 처리.
- 본 chapter 에서는 다루지 않음.
3.4 § 14.2.3 — MNAR (Missing Not at Random)
저자 본문 인용:
“Missing not at random (MNAR) is the situation where the missingness is related to the unobserved dependent variable vector \(y_i^M\) after taking observed variables (i.e., \(X_i\) and \(y_i^O\)) into account.”
\[ R_i \not\perp y_i^M \mid X_i, y_i^O \]
→ 관측 정보 조건부에도 결측이 미관측 값과 연관.
MNAR 의 의미:
- 결측이 측정되지 않은 dependent variable 자체에 의존.
- 관측된 정보로 보정 불가능.
임상 예시 (MNAR):
- “HAM-D 가 측정 시점에 ≥ 15 면 측정 안 함” (즉 미관측 값 자체가 결정).
- “Smoking cessation 연구 — missing 환자는 흡연 중이라 가정” (강한 MNAR).
MAR vs MNAR 차이:
- MAR: 관측된 이전 값 (15 이하) 이 dropout 결정.
- MNAR: 측정해야 할 현재 값 (15 이상) 이 dropout 결정.
- 둘의 차이는 관측된 데이터로 구분 불가능.
저자 본문 인용:
“Because the distinction between MAR and MNAR involves the unobserved data \(y_i^M\), there is no way to confirm or reject MAR versus MNAR.”
→ MNAR 가정은 검정 불가능. 모형 가정에 직접 의존.
Sensitivity analysis 의 필수성:
- MNAR 가능성이 높으면 (자살, dropout, 흡연 cessation 등):
- 다양한 MNAR 모형 적합 → 결과의 robustness 평가.
- 결과가 모형 따라 크게 변하면 → conclusion 신중.
Smoking cessation 의 강한 MNAR 가정:
- “Missing = smoking” (강한 MNAR).
- 사실은 대부분의 경우 MAR 더 적절 (관측된 이전 흡연 이력 → dropout 예측).
- 그러나 conservative 분석으로 MNAR 가정 사용.
§ 14.5 의 두 framework:
- Selection model: \(P(R \mid y, X)\) 명시적 모형화.
- Pattern-mixture: 결측 패턴별 별도 모형.
- 두 접근 모두 MNAR 처리.
4 § 14.3 — Models 와 Mechanisms 의 매핑
| 모형 | Valid Missing Data 가정 | 비고 |
|---|---|---|
| Complete-case analysis | MCAR | 정보 손실 큼 |
| ANOVA / Repeated Measures | MCAR | Complete cases 만 |
| LOCF (Last Observation Carried Forward) | MCAR (강한) | Bias 위험 |
| GEE1 | MCAR | Marginal model |
| MRM, CPM (full likelihood) | MAR | Default 권고 |
| WGEE (weighted GEE) | MAR | GEE 의 MAR 확장 |
| Multiple Imputation | MAR | Rubin 표준 |
| Selection Models | MNAR | § 14.5.1 |
| Pattern-Mixture Models | MNAR | § 14.5.2 |
가정 강도 (강한 → 약한):
- MCAR > MAR > MNAR.
- 약한 가정일수록 더 일반적, 그러나 더 복잡한 모형.
모형 선택 절차:
- MCAR 검정 (Little’s test, § 14.4):
- 통과 → MCAR 가정, 모든 모형 가능.
- 실패 → MAR 또는 MNAR.
- MAR 가정:
- 검정 불가능 (다음 단계인 MNAR 와의 비교 어려움).
- Default — full likelihood (MRM/CPM/GLMM) 권고.
- Distinct parameters 가정 함께 (보통 OK).
- MNAR 의심:
- 임상적 이유 (예: dropout 가 outcome 의존).
- Sensitivity analysis (§ 14.5) — Selection 또는 Pattern-Mixture.
§ 14.3.1, 14.3.2 의 시뮬레이션:
- MCAR 시뮬레이션: 모든 모형 unbiased 검증.
- MAR/MNAR 시뮬레이션: MRM 의 우위, GEE 의 bias 검증.
→ GEE 사용 시 항상 MCAR 가정 명시 필수.
실무 권고:
- 종단 연구 default: MRM/CPM with MAR 가정.
- Sensitivity analysis: MNAR 모형 적합.
- 결과 일치 → conclusion 강건.
5 § 14.4 — Testing MCAR
가장 표준적인 MCAR 검정.
가설:
- \(H_0\): MCAR 만족.
- \(H_a\): MAR 또는 MNAR.
아이디어:
- 결측 패턴별 그룹화.
- 각 그룹의 관측 dependent variable 평균 비교.
- MCAR 면 모든 그룹의 평균이 비슷.
Test statistic: \(\chi^2\) 분포 근사.
가치:
- MCAR 검정 가능 (rare).
- 표본 크기 충분하면 정확.
- R
naniar::mcar_test등에서 구현.
한계:
- MCAR 거부 ≠ MAR/MNAR 구분 불가능:
- 통과 → MCAR.
- 실패 → MAR 또는 MNAR (구분 어려움).
- 검정의 power 부족:
- 작은 표본 또는 약한 violation → 검정 통과해도 MCAR 위반 가능.
- → MCAR 의 conservative 평가 필요.
- 다변량 정규 가정:
- 표준 Little’s test 가 정규 가정 기반.
- 응답이 binary/ordinal 이면 다른 검정 필요.
§ 14.4.1 Example:
- 본문에서 NIMH 또는 다른 데이터의 Little’s test 적용.
- 자세한 분석은 후속 sub-post.
6 § 14.5 — Models for Nonignorable Missingness
6.1 § 14.5.1 — Selection Models
저자 본문 인용 (§ 14.5 도입):
응답 모형 + 결측 모형의 결합:
\[ f(y_i, R_i \mid X_i; \theta, \phi) = f(y_i \mid X_i; \theta) \cdot f(R_i \mid y_i, X_i; \phi) \]
Selection 의 발상:
- 응답이 먼저 발생, 그 결과로 결측 발생.
- \(f(R_i \mid y_i, X_i)\) 가 결측 메커니즘 명시.
- 표준 logistic regression 으로 모형화 가능.
Diggle-Kenward (1994) 의 표준 selection model:
- 응답 \(y_i\) ~ MRM (continuous longitudinal).
- 결측 \(R_{ij}\) ~ logistic regression of \(y_{i,j-1}\) (직전 관측치) 와 \(y_{ij}\) (현재 미관측치).
- → MNAR 메커니즘 명시.
모수:
- \(\theta\): data model parameters (MRM).
- \(\phi\): missingness model parameters (logistic).
Likelihood:
- 두 모형의 결합 likelihood.
- ML 추정.
한계:
- 강한 모형 가정 (특히 MNAR 부분).
- Identification 어려움 (sensitivity 큼).
- 다양한 specification → 다양한 결과.
Sensitivity analysis 권고:
- 다양한 \(\phi\) 가정으로 결과 비교.
- 결과 일치 → 강건한 conclusion.
6.2 § 14.5.2 — Pattern-Mixture Models
Little (1993, 1994) 의 alternative framework.
아이디어:
- 결측 패턴별 별도 응답 분포.
- 전체 = 패턴별 mixture.
\[ f(y_i \mid X_i) = \sum_d f(y_i \mid D_i = d, X_i) \cdot P(D_i = d \mid X_i) \]
표기:
- \(D_i\): dropout time (또는 missing pattern).
- 각 \(d\) 에 대해 별도 model.
Selection vs Pattern-Mixture 의 차이:
- Selection: \(y\) 가 먼저, \(R\) 이 다음 (인과 순서).
- Pattern-Mixture: 결측 pattern 이 먼저, \(y\) 분포가 다음.
Pattern-Mixture 의 강점:
- Marginal interpretation 자연.
- Identification assumption 명시적.
- Sensitivity analysis 직접.
Pattern-Mixture 의 약점:
- 미관측 패턴의 분포는 추정 불가능 (data 없음).
- → Identification assumption 필수 (각 패턴의 미관측 부분에 대한 가정).
일반적 가정:
- ACMV (Available Case Missing Value): 미관측 분포가 가용 case 와 같음.
- NCMV (Neighboring Case Missing Value): 미관측 분포가 인접 case 와 같음.
- → 이런 가정의 robustness 가 sensitivity analysis 의 핵심.
Selection 과 Pattern-Mixture 의 사용 시점:
- Selection: 결측 메커니즘에 대한 명확한 가설 있을 때.
- Pattern-Mixture: 패턴별 결과의 기술적 분석 + sensitivity 평가.
→ Sensitivity analysis 의 두 framework 으로 함께 활용.
7 § 14.6 — Chapter 의 핵심 메시지
결측 데이터는 longitudinal study 의 본질적 특성: 무시 또는 잘못된 처리는 biased 결론.
Rubin (1976) typology 가 토대: MCAR > MAR > MNAR 의 가정 강도. 모형 선택의 통계적 기준.
MRM/CPM (full likelihood) 의 MAR 충분 (ignorability): GEE 의 MCAR 필요와 결정적 차이. → Default 로 MRM/CPM 권고.
MCAR 검정 가능, MAR vs MNAR 검정 불가능: 후자는 가정에 직접 의존 → sensitivity analysis 필수.
MNAR 처리의 두 framework: Selection model (Diggle-Kenward) vs Pattern-Mixture (Little). 둘 다 가정 strong, sensitivity analysis 의 도구.
8 응용 분야
| 분야 | 결측 메커니즘 가능성 | 권고 분석 |
|---|---|---|
| 임상시험 | MAR (보통), MNAR (효과 없음 환자 dropout) | MRM + sensitivity (MNAR) |
| 우울증 추적 | MNAR (심한 우울 환자 측정 안 함) | Selection or Pattern-Mixture |
| 약물 cessation | MNAR (실패자 dropout) | 보수적 MNAR 가정 |
| 학교 연구 | MAR (이사) 또는 MNAR (자퇴) | MRM + sensitivity |
| 만성 질환 관리 | MNAR (사망 또는 호전 dropout) | Joint model 또는 PM |
| Survey | MAR (보통) | Multiple imputation + MRM |
| Internet panel | MNAR (관심 부족 dropout) | Sensitivity analysis 필수 |
9 코드 예시
9.1 Step 1: Missing Data 시뮬레이션 (MCAR/MAR/MNAR)
library(dplyr)
# Longitudinal continuous outcome 시뮬레이션
set.seed(2026)
n_subjects <- 200
n_times <- 5
# Complete data
df_complete <- expand.grid(subject = 1:n_subjects, time = 1:n_times)
df_complete$x <- rep(rnorm(n_subjects), each = n_times)
upsilon <- rep(rnorm(n_subjects, 0, 1), each = n_times)
df_complete$y <- 1 + 0.3 * df_complete$time + 0.5 * df_complete$x +
upsilon + rnorm(nrow(df_complete), 0, 1)
# === MCAR ===
# Random missing — 각 관측이 30% 확률로 결측
df_mcar <- df_complete
mcar_indicator <- rbinom(nrow(df_mcar), 1, 0.7)
df_mcar$y_mcar <- ifelse(mcar_indicator == 1, df_mcar$y, NA)
# === MAR ===
# 직전 시점 y 값에 따라 결측 확률 결정 (관측된 y 기반)
df_mar <- df_complete %>% group_by(subject) %>% mutate(y_prev = lag(y))
df_mar$prob_missing <- 1 / (1 + exp(-(0 - 0.5 * (df_mar$y_prev - mean(df_mar$y_prev, na.rm=TRUE)))))
df_mar$prob_missing[is.na(df_mar$prob_missing)] <- 0 # baseline 안 결측
mar_indicator <- rbinom(nrow(df_mar), 1, 1 - df_mar$prob_missing)
df_mar$y_mar <- ifelse(mar_indicator == 1, df_mar$y, NA)
# === MNAR ===
# 현재 시점 y 값에 따라 결측 확률 결정 (미관측 y 기반)
df_mnar <- df_complete
df_mnar$prob_missing <- 1 / (1 + exp(-(0 - 0.5 * (df_mnar$y - mean(df_mnar$y)))))
mnar_indicator <- rbinom(nrow(df_mnar), 1, 1 - df_mnar$prob_missing)
df_mnar$y_mnar <- ifelse(mnar_indicator == 1, df_mnar$y, NA)
# 결측률 비교
cat("Missing rates:\n")
cat(" MCAR:", round(mean(is.na(df_mcar$y_mcar)), 3), "\n")
cat(" MAR:", round(mean(is.na(df_mar$y_mar)), 3), "\n")
cat(" MNAR:", round(mean(is.na(df_mnar$y_mnar)), 3), "\n")세 메커니즘의 차이:
- MCAR: 결측이 random — 관측 평균이 진짜 평균과 같음.
- MAR: 결측이 이전 관측값에 의존 — 관측 평균이 약간 biased (보정 가능).
- MNAR: 결측이 현재 미관측값에 의존 — 관측 평균이 강하게 biased.
검증 — 관측된 데이터의 평균 비교:
cat("관측된 y 의 평균 비교:\n")
cat(" Complete:", mean(df_complete$y), "\n")
cat(" MCAR observed:", mean(df_mcar$y_mcar, na.rm=TRUE), "\n")
cat(" MAR observed:", mean(df_mar$y_mar, na.rm=TRUE), "\n")
cat(" MNAR observed:", mean(df_mnar$y_mnar, na.rm=TRUE), "\n")→ MCAR 만 unbiased, MAR/MNAR 은 biased.
9.2 Step 2: Little’s MCAR Test
library(naniar)
# Little's MCAR test on three datasets
cat("\n=== Little's MCAR Test ===\n")
cat("MCAR data:\n")
print(mcar_test(df_mcar[, c("x", "y_mcar", "time")]))
cat("\nMAR data:\n")
print(mcar_test(df_mar[, c("x", "y_mar", "time")]))
cat("\nMNAR data:\n")
print(mcar_test(df_mnar[, c("x", "y_mnar", "time")]))MCAR data:
- p > .05 → MCAR 가정 채택 (정확).
MAR data:
- p < .05 → MCAR 가정 거부 → MAR 또는 MNAR.
- 그러나 MAR vs MNAR 구분 불가능.
MNAR data:
- p < .05 → MCAR 가정 거부.
- 같은 결론 — 추가 분석 (sensitivity) 필요.
한계:
- 검정의 power 가 작은 표본에서 부족.
- MAR vs MNAR 구분 불가능 — 임상적 판단 필요.
9.3 Step 3: MRM (MAR) vs GEE (MCAR) 비교
library(lme4)
library(geepack)
# Long format with NA's for missing
analyze_data <- function(df, y_var) {
df_long <- df[!is.na(df[[y_var]]), ]
# MRM (MAR 가정 valid)
fit_mrm <- lmer(as.formula(paste(y_var, "~ time + x + (1 | subject)")),
data = df_long)
# GEE (MCAR 가정 필요)
fit_gee <- geeglm(as.formula(paste(y_var, "~ time + x")),
id = subject, data = df_long, family = gaussian)
list(mrm = coef(fit_mrm)[c("(Intercept)", "time", "x")],
gee = coef(fit_gee))
}
# 세 데이터에 두 모형
cat("=== 진짜 모수: intercept=1, time=0.3, x=0.5 ===\n\n")
cat("MCAR data:\n")
res_mcar <- analyze_data(df_mcar, "y_mcar")
print(round(rbind(MRM = res_mcar$mrm, GEE = res_mcar$gee), 3))
cat("\nMAR data:\n")
res_mar <- analyze_data(df_mar, "y_mar")
print(round(rbind(MRM = res_mar$mrm, GEE = res_mar$gee), 3))
cat("\nMNAR data:\n")
res_mnar <- analyze_data(df_mnar, "y_mnar")
print(round(rbind(MRM = res_mnar$mrm, GEE = res_mnar$gee), 3))예상 결과:
| 데이터 | MRM | GEE |
|---|---|---|
| MCAR | unbiased | unbiased |
| MAR | unbiased | biased |
| MNAR | biased | biased |
검증 핵심:
- MAR 데이터: MRM 이 unbiased, GEE 가 biased — § 14.3 의 핵심 메시지.
- MNAR 데이터: 둘 다 biased — sensitivity analysis 필요.
실무 결론:
- 결측이 있는 종단 데이터: MRM/CPM 권고.
- GEE 사용 시 MCAR 검정 필수.
- MNAR 의심 시 selection/pattern-mixture 모형 검토.
9.4 Step 4: Sensitivity Analysis (다양한 MNAR 가정)
# Pattern-mixture 의 단순한 형태 — dropout 패턴별 별도 분석
library(dplyr)
# Dropout pattern 정의 (마지막 관측 시점)
df_mnar_pattern <- df_mnar %>%
group_by(subject) %>%
mutate(last_observed = max(time[!is.na(y_mnar)], na.rm = TRUE)) %>%
ungroup()
# Pattern 별 평균 비교
pattern_summary <- df_mnar_pattern %>%
group_by(last_observed) %>%
summarise(n_subjects = n_distinct(subject),
mean_y_observed = mean(y_mnar, na.rm = TRUE))
print(pattern_summary)
# Sensitivity analysis — MNAR 가정 강도 변화
sensitivity_analysis <- function(df, delta_values = c(0, -0.5, -1, -1.5)) {
result <- data.frame(delta = delta_values, mean_y = NA)
for (i in seq_along(delta_values)) {
delta <- delta_values[i]
# 결측 값을 imputed value (관측 평균 + delta) 로 대체
df_imputed <- df
df_imputed$y_imputed <- ifelse(is.na(df$y_mnar),
mean(df$y_mnar, na.rm = TRUE) + delta,
df$y_mnar)
result$mean_y[i] <- mean(df_imputed$y_imputed)
}
return(result)
}
cat("\n=== Sensitivity Analysis (다양한 MNAR delta) ===\n")
sens <- sensitivity_analysis(df_mnar)
print(sens)
cat("\n진짜 평균 (complete):", mean(df_complete$y), "\n")Delta 의 의미:
- \(\delta = 0\): 미관측 = 관측 평균 (MAR 같은 가정).
- \(\delta < 0\): 미관측이 관측보다 낮음 (MNAR — 낮은 값이 더 결측 경향).
- \(\delta > 0\): 미관측이 관측보다 높음.
결과 평가:
- 결과 (예: 평균 또는 회귀 계수) 가 \(\delta\) 변화에 따라 어떻게 변하는가.
- 변화 작음 → robust conclusion.
- 변화 큼 → MNAR 가정에 sensitive — 신중한 해석.
실무 권고:
- Default: MAR (delta = 0).
- Sensitivity: \(\delta = \pm 0.5, \pm 1\) SD.
- 결과 큰 변화 → 임상적 판단 + MNAR 모형 (selection/PM) 적합.
§ 14.5 의 두 framework:
- Selection model: \(\delta\) 자동 모형화 (logistic dropout model).
- Pattern-mixture: \(\delta\) 명시적 가정 (pattern 별).
→ 본 코드는 PM 의 가장 단순한 형태.
10 관련 주제
선행 지식
- Ch.4 정규 종단 MRM — MRM 의 토대
- Ch.8 GEE — Marginal model (MCAR 가정)
- Ch.9-13 GLMM — Categorical 응답 (모두 MAR 가정)
- § 9.7 NIMH attrition — Attrition 패턴 인지 사례
후속 주제 (Ch.14 sub-posts)
- § 14.2 ~ 14.2.3 — Mechanisms 깊이 (MCAR/MAR/MNAR)
- § 14.3 ~ 14.3.2 — Models + simulations
- § 14.4 ~ 14.4.1 — Testing MCAR
- § 14.5 ~ 14.5.2 — Selection + Pattern-Mixture
- § 14.6 — Summary
관련 개념
- Rubin (1976) — Missing data typology 원전 (Biometrika)
- Little (1988) — MCAR test
- Little (1995) — Longitudinal modeling with missing data
- Little (1993, 1994) — Pattern-mixture models
- Diggle & Kenward (1994) — Selection model 표준
- Hogan & Laird (1997) — Reviews
- Hogan, Roy & Korkontzelou (2004) — Tutorial
- Schafer & Graham (2002) — Accessible review
- Demirtas (2004a, 2004b) — Methods reviews
- Fitzmaurice et al. (2004) — MAR default 권고
- Rubin (1987, 1996) — Multiple imputation
- Schafer (1997) — MI textbook
- Robins, Rotnitzky & Zhao (1995) — WGEE
- Verbeke & Molenberghs (2000) — Linear mixed models textbook
- Little & Rubin (2002) — Missing data textbook
- Diggle, Heagerty, Liang, Zeger (2002) — Longitudinal data textbook