§ 13.2.4 ~ 13.2.4.1 — Three-Level Ordinal Outcomes: 일반 Framework + Ordinal 확장

More General Outcomes (식 13.16-13.25) · 응답 형태별 \(\ell_{ij}\) 만 변경 · §13.2.4.1 Ordinal: Raman-Hedeker (2005), Liu-Hedeker (2006) · 식 (13.26) cumulative probit conditional likelihood · 식 (13.27) c-무관 score · 식 (13.28) 절단점 score with Kronecker delta · 식 (13.29) logistic 변형

Hedeker & Gibbons (2006) Ch.13 §13.2.4 + §13.2.4.1 의 깊이 있는 풀이. 13-2 sub-post 의 3-level probit/logistic framework 의 자연 확장 — ordinal/nominal/count outcomes. (1) §13.2.4 일반 framework 의 핵심 통찰 — 식 (13.16-13.21) 의 통합 표기, 응답 형태별 conditional likelihood \(\ell_{ij}(\theta)\) 만 변경 하면 같은 적분 분해 (식 13.17-13.19) + 같은 score 형태 (식 13.22-13.23) + 같은 Fisher scoring (식 13.24-13.25). (2) §13.2.4.1 Ordinal Outcomes: Raman & Hedeker (2005), Liu & Hedeker (2006) 의 정립. 식 (13.26) cumulative probit conditional likelihood\(C\) 범주, \(C-1\) 절단점 \(\gamma_c\), indicator \(d_{ijkc}\). 식 (13.27) c-무관 모수 score\(\beta, T, \sigma_{(3)}\) 의 미분, § 10.2.4 의 식 (10.19) 와 동일 형태. 식 (13.28) c-가변 모수 score — 절단점 \(\gamma_c\) 의 미분, Kronecker delta \(\delta_{c,c'}\) 로 인접 cumulative 만 영향. 식 (13.29) logistic 변형 — Φ → Ψ 단순 대체.

Statistics
저자

Kwangmin Kim

공개

2026년 05월 06일

1 들어가며 — 13-2 framework 의 일반화

§ 13.2 ~ 13.2.2 (13-2) 에서 3-level probit/logistic 의 framework 와 적분 분해 (식 13.9) 를 다뤘다. § 13.2.4 는 그 framework 를 다른 응답 형태 (ordinal, nominal, count) 로 일반화. 본 sub-post 는 § 13.2.4 일반 framework + § 13.2.4.1 Ordinal 의 깊이.

한 줄 요약

“§ 13.2.4 = 13-2 의 probit framework 가 ordinal/nominal/count 로 자연 확장. 핵심 통찰: 식 (13.16-13.21) 의 통합 표기 — 응답 형태별 conditional likelihood \(\ell_{ij}(\theta)\) 만 변경 하면 같은 적분 분해 + 같은 score 형태 + 같은 Fisher scoring (식 13.22-13.25). 새 알고리즘 학습 불필요. §13.2.4.1 Ordinal: Raman-Hedeker 2005, Liu-Hedeker 2006 정립. 식 (13.26) cumulative probit (인접 cumulative 차이) — \(C-1\) 절단점 \(\gamma_c\) + indicator \(d_{ijkc}\). 식 (13.27) c-무관 모수 score (\(\beta, T, \sigma_{(3)}\)): § 10.2.4 식 (10.19) 와 동일 형태. 식 (13.28) c-가변 모수 score (\(\gamma_c\)): Kronecker delta \(\delta_{c,c'}\) 로 인접 cumulative 만 영향. 식 (13.29) logistic 변형 — \(\Phi \to \Psi\) 단순. → Ch.10 의 2-level cumulative ordinal 의 3-level 일반화.”

2 § 13.2.4 — 일반 Framework

2.1 응답 형태별 \(\ell_{ij}\) 만 변경

식 (13.16) — Log-likelihood

\[ \log L = \sum_{i=1}^N \log h(y_i) \tag{13.16} \]

모든 GLMM 의 공통 형태 — 응답 형태 무관.

식 (13.17-13.19) — 적분 분해

식 (13.17) — Cluster level marginal:

\[ h(y_i) = \int_{\theta_{(3)}} \ell_i(\theta_{(3)}) g(\theta_{(3)}) d\theta_{(3)} \tag{13.17} \]

식 (13.18) — Subject level product:

\[ \ell_i(\theta_{(3)}) = \prod_{j=1}^{n_i} h(y_{ij}) \tag{13.18} \]

식 (13.19) — Subject level marginal:

\[ h(y_{ij}) = \int_{\theta_{(2)}} \ell_{ij}(\theta) g(\theta_{(2)}) d\theta_{(2)} \tag{13.19} \]

→ 13-2 의 식 (13.9) 의 통합 표기.

식 (13.20-13.21) — Probit conditional likelihood (예시)

\[ \ell_{ij}(\theta) = \prod_{k=1}^{n_{ij}} [\Phi(z_{ijk})]^{1-y_{ijk}} [1 - \Phi(z_{ijk})]^{y_{ijk}} \tag{13.20} \]

with response model:

\[ z_{ijk} = \sigma_{(3)} \theta_{0i} + z_{ijk}^\top T \theta_{ij} + x_{ijk}^\top \beta \tag{13.21} \]

직관 — 응답 형태별 \(\ell_{ij}\) 만 변경

핵심 통찰 (저자 본문 인용):

“It is this likelihood function \(\ell_{ij}(\theta)\) that changes as we move from dichotomous to ordinal and other types of categorical responses. Thus, it is the specification of this likelihood function, along with the derivatives with respect to (the log of) it, that needs to be modified for these other types of outcomes.”

응답 형태별 \(\ell_{ij}\) 형태:

응답 형태 \(\ell_{ij}\) 형태
Binary (Probit) \(\prod \Phi^{y}(1-\Phi)^{1-y}\) (13.20)
Binary (Logit) \(\prod \Psi^{y}(1-\Psi)^{1-y}\) (13.20) with \(\Phi \to \Psi\)
Ordinal (cumulative) \(\prod \prod [\Phi(\gamma_c - z) - \Phi(\gamma_{c-1} - z)]^{d_c}\) (13.26)
Nominal (multinomial) \(\prod \prod p_{ijc}^{d_c}\) (13.30-13.32)
Count (Poisson) \(\prod e^{-\lambda} \lambda^y / y!\) (13.39)

Conditional likelihood 의 모양만 다름, 적분 분해와 추정 algorithm 동일.

§ 9-12 의 GLMM 시리즈 와 같은 unifying 통찰 — 모든 GLMM 이 같은 framework 위.

2.2 Score 의 일반 형태 — 식 (13.22-13.23)

식 (13.22) — 모수별 score

\[ \frac{\partial \log L}{\partial \eta} = \sum_i h^{-1}(y_i) \int_{\theta_{(3)}} \ell_i(\theta_{(3)}) \frac{\partial \log \ell_i(\theta_{(3)})}{\partial \eta} g(\theta_{(3)}) d\theta_{(3)} \tag{13.22} \]

식 (13.23) — Subject 레벨 score

\[ \frac{\partial \log \ell_i(\theta_{(3)})}{\partial \eta} = \sum_{j=1}^{n_i} h^{-1}(y_{ij}) \int_{\theta_{(2)}} \ell_{ij}(\theta) \frac{\partial \log \ell_{ij}(\theta)}{\partial \eta} g(\theta_{(2)}) d\theta_{(2)} \tag{13.23} \]

직관 — 두 단계 적분 + chain rule

식 (13.22-13.23) 의 구조:

  1. 외부 적분 (\(\theta_{(3)}\)): cluster level — 1 차원.
  2. 내부 적분 (\(\theta_{(2)}\)): subject level — \(r\) 차원.
  3. Chain rule: \(\partial \log \ell_{ij} / \partial \eta\) 가 응답 형태별 다른 형태.

Score 가 사후 평균 형태:

  • \(h^{-1}(y_i)\) + 적분 = 사후 분포에 대한 평균.
  • → § 9.6 식 (9.43) 의 일반화.

응답 형태별 \(\partial \log \ell_{ij} / \partial \eta\):

응답 형태 Score 형태 참조
Binary (Probit) \(\sum (y - \Phi(z))/[\Phi(1-\Phi)] \cdot \phi \cdot \partial z / \partial \eta\) 13-2 식 (13.11)
Ordinal (cumulative) 식 (13.27) — c-무관 + 식 (13.28) — c-가변 본 sub-post
Nominal 식 (13.34) — \(D(y - p)\) 다음 sub-post
Count (Poisson) 식 (13.40) — \((y - \lambda) x\) 다음 sub-post

모두 같은 framework, 다른 conditional likelihood 의 미분.

2.3 Fisher Scoring — 식 (13.24-13.25)

식 (13.24) — Update

\[ \eta_{l+1} = \eta_l - \mathcal{E}\left[\frac{\partial^2 \log L}{\partial \eta_l \partial \eta_l^\top}\right]^{-1} \frac{\partial \log L}{\partial \eta_l} \tag{13.24} \]

식 (13.25) — Empirical information matrix

\[ \mathcal{E}\left[\frac{\partial^2 \log L}{\partial \eta_l \partial \eta_l^\top}\right] = -\sum_{i=1}^N h^{-2}(y_i) \frac{\partial h(y_i)}{\partial \eta_l} \left(\frac{\partial h(y_i)}{\partial \eta_l}\right)^\top \tag{13.25} \]

→ Score 의 outer product 합 — § 9.6 식 (9.47) 의 정보 행렬과 같은 형태.

직관 — 1 차 도함수만 필요

저자 본문 인용:

“Thus, it is only the first derivatives that are needed for the algorithm.”

Empirical information matrix 의 가치 (BHHH-like):

  • Score 만 사용 (Hessian 불필요).
  • 항상 양정치 (outer product 합).
  • 알고리즘 단순.

§ 12-2 (12-2) 의 BHHH 와 같은 발상 — Hessian 회피.

Fisher scoring 의 작동:

  1. 현재 \(\eta_l\) 에서 score 계산 (응답 형태별 \(\partial \log \ell_{ij} / \partial \eta\)).
  2. Empirical information matrix 계산 (식 13.25).
  3. Update (식 13.24).
  4. 수렴까지 반복.

응답 형태가 binary → ordinal 으로 바뀌어도:

  • Score 식만 변경 (식 13.27-13.28).
  • 알고리즘 (Fisher scoring + Gauss-Hermite quadrature) 그대로.
  • 모듈화된 framework.

3 § 13.2.4.1 — Ordinal Outcomes

3.1 모형 정의 — 식 (13.26)

표기와 절단점

저자 본문 인용:

“The results presented here follow those from Hedeker and Gibbons [1994].”

표기:

  • \(C\) 순서 범주 (\(c = 1, 2, \ldots, C\)).
  • \(C-1\) 절단점 (\(\gamma_c\)): \(\gamma_1 < \gamma_2 < \ldots < \gamma_{C-1}\).
  • 식별: \(\gamma_1 = 0, \gamma_0 = -\infty, \gamma_C = \infty\).
  • Indicator: \(d_{ijkc} = 1\) if \(y_{ijk} = c\), 0 otherwise.
식 (13.26) — Cumulative probit conditional likelihood

\[ \ell_{ij}(\theta) = \prod_{k=1}^{n_{ij}} \prod_{c=1}^C [\Phi(\gamma_c - z_{ijk}) - \Phi(\gamma_{c-1} - z_{ijk})]^{d_{ijkc}} \tag{13.26} \]

표기:

  • \(\Phi(\gamma_c - z_{ijk}) = P(y_{ijk} \leq c \mid \theta)\) — cumulative probability.
  • 차이 = single category \(c\) 의 확률 (인접 cumulative 의 차이).
직관 — 인접 Cumulative 의 차이

식 (13.26) 의 핵심 — 순서형의 cell 확률은 인접 cumulative 차이:

\[ P(y_{ijk} = c \mid \theta) = \Phi(\gamma_c - z_{ijk}) - \Phi(\gamma_{c-1} - z_{ijk}) \]

§ 10.2.4 식 (10.14) 와 정확히 같은 형태 — § 10 의 2-level cumulative ordinal 의 3-level 일반화.

경계 처리:

  • \(c = 1\): \(P(y = 1) = \Phi(\gamma_1 - z) - 0 = \Phi(\gamma_1 - z)\).
  • \(c = C\): \(P(y = C) = 1 - \Phi(\gamma_{C-1} - z)\).
  • 중간 \(c\): 인접 cumulative 차이.

Indicator \(d_{ijkc}\):

  • 각 관측 \((i, j, k)\) 에서 \(c\) 중 하나만 1.
  • → 곱이 효과적으로 단일 cell 확률.

\(z_{ijk}\) 의 부호 (식 13.21):

\[ z_{ijk} = \sigma_{(3)} \theta_{0i} + z_{ijk}^\top T \theta_{ij} + x_{ijk}^\top \beta \]

식 (13.26) 의 형태: \(\gamma_c - z_{ijk}\).

→ § 10.2 의 식 (10.1) 의 부호 관행 (\(\gamma_c - x^\top\beta\)). 양의 covariate effect = 응답을 큰 범주로 이동.

§ 10.2 vs § 13.2.4.1 의 차이:

  • § 10.2: 2-level (subject random effects 만).
  • § 13.2.4.1: 3-level (cluster + subject random effects).
  • 적분 분해 (식 13.17-13.19) 가 추가 적용.

3.2 Score for c-무관 모수 — 식 (13.27)

\(\beta, T, \sigma_{(3)}\) 의 score

\[ \frac{\partial \log \ell_{ij}(\theta)}{\partial \eta} = \sum_{k=1}^{n_{ij}} \sum_{c=1}^C d_{ijkc} \frac{\phi(\gamma_{c-1} - z_{ijk}) - \phi(\gamma_c - z_{ijk})}{\Phi(\gamma_c - z_{ijk}) - \Phi(\gamma_{c-1} - z_{ijk})} \frac{\partial z_{ijk}}{\partial \eta} \tag{13.27} \]

with:

\[ \frac{\partial z_{ijk}}{\partial \beta} = x_{ijk}, \quad \frac{\partial z_{ijk}}{\partial v(T)} = J_r (\theta_{(2)} \otimes z_{ijk}), \quad \frac{\partial z_{ijk}}{\partial \sigma_{(3)}} = \theta_{(3)} \]

\(J_r\) = Magnus (1988) elimination matrix.

직관 — Score 의 핵심 항

핵심 항 \(\frac{\phi(\gamma_{c-1} - z) - \phi(\gamma_c - z)}{\Phi(\gamma_c - z) - \Phi(\gamma_{c-1} - z)}\):

  • 분자: 인접 pdf 의 차이 (단일 cell 의 marginal 변화율).
  • 분모: 인접 cumulative 차이 = cell 확률.
  • → “단위 잠재 분산당 cell 확률 변화율” — score 의 자연스러운 weighting.

§ 10.2.4 식 (10.19) 와 동일 형태:

  • 2-level cumulative ordinal 의 score 형태와 정확히 같음.
  • 차이는 \(z_{ijk}\) 가 3-level random effects 포함 (\(\sigma_{(3)} \theta_{0i} + z'T\theta_{ij}\)).

모수별 미분:

  • \(\beta\) (fixed effects): \(x_{ijk}\) — 표준 회귀 covariate.
  • \(v(T)\) (subject random): \(J_r (\theta_{(2)} \otimes z_{ijk})\) — § 9.6.2 의 Cholesky 미분.
  • \(\sigma_{(3)}\) (cluster random): \(\theta_{(3)}\) — random effect 자체.

→ § 13.2.1 식 (13.13) 의 미분과 동일 (차이는 응답 형태별 score 의 핵심 항).

c-무관 모수의 의미:

  • \(\beta, T, \sigma_{(3)}\) 가 모든 절단점 \(c\) 에 같은 값으로 적용.
  • 이것이 proportional odds 가정 (§ 10.2 의 핵심).
  • 한 회귀 계수가 모든 cumulative comparison 에 동일 효과.

3.3 Score for c-가변 모수 — 식 (13.28)

절단점 \(\gamma_c\) 의 score

\[ \frac{\partial \log \ell_{ij}(\theta)}{\partial \gamma_{c'}} = \sum_{k=1}^{n_{ij}} \sum_{c=1}^C d_{ijkc} \frac{\phi(\gamma_c - z_{ijk}) \delta_{c, c'} - \phi(\gamma_{c-1} - z_{ijk}) \delta_{c-1, c'}}{\Phi(\gamma_c - z_{ijk}) - \Phi(\gamma_{c-1} - z_{ijk})} \tag{13.28} \]

Kronecker delta:

\[ \delta_{c, c'} = \begin{cases} 1 & \text{if } c = c' \\ 0 & \text{if } c \neq c' \end{cases} \]

직관 — Kronecker Delta 의 의미

식 (13.28) 의 \(\gamma_{c'}\) score 의 작동:

  • \(\gamma_{c'}\)두 cumulative 에만 영향:
    • \(\Phi(\gamma_{c'} - z_{ijk})\) — 직접.
    • \(\Phi(\gamma_{c'-1} - z_{ijk})\) — 간접 (다음 cumulative 의 시작점).
  • Kronecker delta \(\delta_{c, c'}\):
    • \(c = c'\): 첫 항 (\(\phi(\gamma_c - z) \delta_{c, c'}\)) 살림.
    • \(c - 1 = c'\) (즉 \(c = c' + 1\)): 둘째 항 (\(\phi(\gamma_{c-1} - z) \delta_{c-1, c'}\)) 살림.
    • 다른 \(c\): 둘 다 0.

\(\gamma_{c'}\) 의 score 가 \(c = c'\)\(c = c' + 1\) 두 cell 에만 contribution.

§ 10.2.4 식 (10.19) 의 c-가변 부분과 동일.

임상적 의미:

  • 각 절단점이 두 인접 범주 사이의 boundary.
  • 절단점 추정 = 두 범주의 cell 확률 균형.
  • → 본질적으로 ordinal 의 자연 구조.

3-level 의 추가:

  • 절단점 \(\gamma_c\) 가 cluster-level 에서 동일.
  • 모든 cluster 가 같은 cutpoint 가정 (response scale 의 동질성).

Score 행렬의 구조:

  • \(C - 1\) 개 절단점에 대한 score 가 band-like 구조 (인접 cell 만 영향).
  • 계산 효율적 — sparse 행렬 활용 가능.

3.4 Logistic 변형 — 식 (13.29)

\(\Phi \to \Psi\) 단순 대체

식 (13.29) — Logistic cdf:

\[ \Psi(\gamma_c - z_{ijk}) = \frac{1}{1 + \exp[-(\gamma_c - z_{ijk})]} \tag{13.29} \]

Pdf 대체:

\[ \phi(\gamma_c - z_{ijk}) \to \Psi(\gamma_c - z_{ijk})(1 - \Psi(\gamma_c - z_{ijk})) \]

직관 — Logistic 의 추정 단순화

§ 9.5.5 의 logistic cdf-pdf 관계 (\(\psi = \Psi(1-\Psi)\)) 의 가치 (13-2 의 § 13.2.2 와 동일):

  1. 계산 효율: \(\Psi\) 만 계산 → pdf 자동.

  2. Score 단순화 (식 13.27 의 logit 버전):

    \[ \frac{\Psi(\gamma_{c-1} - z)(1 - \Psi(\gamma_{c-1} - z)) - \Psi(\gamma_c - z)(1 - \Psi(\gamma_c - z))}{\Psi(\gamma_c - z) - \Psi(\gamma_{c-1} - z)} \]

  3. Tail probability: rare events 또는 extreme categories 에서 logistic 가 더 정확.

Probit vs Logistic 의 ICC 차이 (식 13.7 의 \(\sigma_{\varepsilon}^2\)):

  • Probit: \(\sigma_\varepsilon^2 = 1\).
  • Logistic: \(\sigma_\varepsilon^2 = \pi^2/3\).

두 ICC 의 분모 차이:

\[ \text{Cluster ICC}_{\text{probit}} = \frac{\sigma_{(3)}^2}{\sigma_{(3)}^2 + \sigma_\upsilon^2 + 1} \]

\[ \text{Cluster ICC}_{\text{logit}} = \frac{\sigma_{(3)}^2}{\sigma_{(3)}^2 + \sigma_\upsilon^2 + \pi^2/3} \]

같은 random effects 추정에서 logistic ICC 가 작아 보임 — 표준화 환산 필요.

실무 권고:

  • 일반 응용: logistic (OR 해석 + 표준).
  • Family/genetic: probit (polychoric correlation).
  • Rare events / extreme categories: logistic.

4 응용 분야

분야 3-Level 구조 Ordinal 응답
학교 학업 평가 School × Class × Student 학업 등급 (A/B/C/D/F)
정신과 multi-center Center × Patient × Visit 중증도 (정상/경증/중등도/중증)
만족도 조사 Region × Branch × Customer Likert 5/7 점
환자 통증 Hospital × Patient × Daily NRS 0-10 → 4 범주화
기능 평가 Region × Subject × Time ADL/IADL 단계
약물 부작용 Center × Patient × Visit CTCAE Grade (1-5)
회사 성과 Company × Employee × Review 성과 등급

→ “3-level + ordinal” 의 모든 사례.

5 코드 예시

5.1 Step 1: 3-Level Ordinal Probit 시뮬레이션

library(ordinal)
library(dplyr)


# 3-level ordinal 시뮬레이션 (4 범주)
set.seed(2026)
n_clusters <- 15
n_subjects_per_cluster <- 8
n_times_per_subject <- 4

# 모수 (probit, sigma_eps = 1)
gamma <- c(-1.5, 0, 1.5)  # 3 절단점 (gamma_1 = -1.5 not 0 for variety)
beta_time <- 0.3
beta_x <- 0.5
sigma_cluster <- 0.4
sigma_subject <- 0.5

# Cluster random effects
cluster_effects <- rnorm(n_clusters, 0, sigma_cluster)

df <- data.frame()
subject_id <- 0
for (i in 1:n_clusters) {
  for (j in 1:n_subjects_per_cluster) {
    subject_id <- subject_id + 1
    subject_effect <- rnorm(1, 0, sigma_subject)
    for (k in 1:n_times_per_subject) {
      time <- k - 1
      x <- rnorm(1)
      # Latent variable
      eta <- cluster_effects[i] + subject_effect +
             beta_time * time + beta_x * x
      y_latent <- eta + rnorm(1, 0, 1)  # probit
      # 4 범주 분류 (식 13.26 에서 P(Y = c) = Phi(gamma_c - z) - Phi(gamma_{c-1} - z))
      if (y_latent < gamma[1]) y <- 1
      else if (y_latent < gamma[2]) y <- 2
      else if (y_latent < gamma[3]) y <- 3
      else y <- 4
      df <- rbind(df, data.frame(
        cluster = i, subject = subject_id,
        time = time, x = x, y = factor(y, ordered = TRUE)
      ))
    }
  }
}

cat("전체 관측:", nrow(df), "\n")
cat("응답 분포:\n")
print(table(df$y))
시뮬레이션의 검증

Latent variable framework 의 직접 구현:

  • 3-level random effects 합 → latent variable.
  • \(\sigma_\varepsilon = 1\) (probit) 잡음.
  • 절단점 \(\gamma_c\) 으로 4 범주 분류.

→ 식 (13.26) 의 정확한 generative process.

검증 포인트:

  • 4 범주가 균형적으로 분포.
  • Cluster + subject + time 효과 누적.

5.2 Step 2: 3-Level Ordinal 적합 (R ordinal::clmm)

# R 의 clmm 가 3-level ordinal 직접 지원
fit_3level_ordinal <- clmm(y ~ time + x + (1 | subject) + (1 | cluster),
                            data = df, link = "probit",
                            nAGQ = 1)  # Laplace approximation
summary(fit_3level_ordinal)

# Fixed effects 와 절단점
cat("\n추정값 (진짜 vs 추정):\n")
cat("  beta_time (진짜 0.3):",
    round(coef(fit_3level_ordinal)["time"], 3), "\n")
cat("  beta_x (진짜 0.5):",
    round(coef(fit_3level_ordinal)["x"], 3), "\n")

# 절단점 (clmm 의 thresholds)
cat("\n절단점 (gamma_2, gamma_3 진짜:", gamma[2], gamma[3], "):\n")
print(round(fit_3level_ordinal$alpha, 3))

# Random effects
varcomp <- VarCorr(fit_3level_ordinal)
cat("\nRandom effects:\n")
print(varcomp)

# ICC 계산 (probit, sigma_eps² = 1)
sigma_c <- as.numeric(varcomp$cluster)
sigma_s <- as.numeric(varcomp$subject)
icc_cluster <- sigma_c / (sigma_c + sigma_s + 1)
icc_subject_within_cluster <- sigma_s / (sigma_c + sigma_s + 1)

cat("\nICC (probit):\n")
cat("  Cluster ICC:", round(icc_cluster, 3), "\n")
cat("  Subject ICC (within cluster):", round(icc_subject_within_cluster, 3), "\n")
R clmm 의 3-Level Ordinal

Syntax(1 | subject) + (1 | cluster):

  • 같은 syntax 가 linear (lmer) 와 동일.
  • ordinal::clmm 가 ordinal 전용.

Family / Link:

  • link = "probit": 표준 probit.
  • link = "logit": logistic 변형 (식 13.29).

Estimation:

  • Default: Laplace approximation (nAGQ = 1).
  • nAGQ > 1: adaptive Gauss-Hermite (단, single random effect 만).
  • 다중 random effects + adaptive quadrature: brms 우회.

ICC 계산 (식 § 13.1 의 ICC):

  • Probit: 분모 \(\sigma^2_\text{rand} + 1\).
  • Logistic: 분모 \(\sigma^2_\text{rand} + \pi^2/3\).

대안 패키지:

  • R ordinal::clmm (Cumulative Link Mixed Model): 표준.
  • R brms::brm(family = cumulative()): Bayesian.
  • SAS PROC NLMIXED: 직접 코딩.

5.3 Step 3: Probit vs Logistic 비교

# 같은 데이터에 logit 적합
fit_3level_logit <- clmm(y ~ time + x + (1 | subject) + (1 | cluster),
                          data = df, link = "logit",
                          nAGQ = 1)
summary(fit_3level_logit)

# 비교
cat("\nFixed effects 비교 (Probit vs Logit):\n")
print(round(rbind(
  Probit = coef(fit_3level_ordinal)[c("time", "x")],
  Logit = coef(fit_3level_logit)[c("time", "x")]
), 3))

# Logit / Probit 비율 (이론: ~1.81)
cat("\nLogit / Probit 비율 (이론: ~1.81):\n")
print(round(coef(fit_3level_logit)[c("time", "x")] /
              coef(fit_3level_ordinal)[c("time", "x")], 2))

# ICC 비교
varcomp_logit <- VarCorr(fit_3level_logit)
sigma_c_logit <- as.numeric(varcomp_logit$cluster)
sigma_s_logit <- as.numeric(varcomp_logit$subject)
icc_cluster_logit <- sigma_c_logit / (sigma_c_logit + sigma_s_logit + pi^2/3)

cat("\nCluster ICC 비교:\n")
cat("  Probit:", round(icc_cluster, 3), "\n")
cat("  Logit:", round(icc_cluster_logit, 3),
    "(분모 차이로 작아 보임)\n")
검증 — § 9.5.5 의 1.81 배 Scale

기대 결과:

  • Logit estimate ≈ 1.81 × Probit estimate.
  • ICC: Logit < Probit (분모 차이).

같은 임상 정보, 다른 척도:

  • 두 결론 동일 (응답 패턴, 처치 효과).
  • 척도 환산 후 같은 임상 의미.

선택 기준:

  • OR 해석: Logit.
  • Tetrachoric/polychoric: Probit.
  • 4 범주 ordinal 의 일반: 둘 다 가능.

5.4 Step 4: 절단점 추정의 시각화

library(ggplot2)


# 절단점과 fitted cumulative probabilities
thresholds <- fit_3level_ordinal$alpha
cat("\n추정된 절단점:\n")
print(round(thresholds, 3))

# 각 cluster + subject 의 fitted probabilities 시각화
# 절단점 + EB random effects 활용
ranef_cluster <- ranef(fit_3level_ordinal)$cluster
ranef_subject <- ranef(fit_3level_ordinal)$subject

# Caterpillar plot — cluster random effects
ranef_cluster_df <- data.frame(
  cluster = 1:nrow(ranef_cluster),
  estimate = ranef_cluster[, 1]
)
ranef_cluster_df <- ranef_cluster_df[order(ranef_cluster_df$estimate), ]
ranef_cluster_df$rank <- 1:nrow(ranef_cluster_df)

ggplot(ranef_cluster_df, aes(x = rank, y = estimate)) +
  geom_point(size = 3, color = "steelblue") +
  geom_hline(yintercept = 0, linetype = "dashed", color = "red") +
  labs(x = "Cluster Rank", y = "EB Estimate (gamma_i)",
       title = "3-Level Ordinal: Cluster Random Effects")

# 4 범주의 marginal probabilities (절단점 + sigma 보정)
sigma_total_probit <- sqrt(1 + sigma_c + sigma_s)
margin_pred <- function(z) {
  P_cum <- pnorm((thresholds - z) / sigma_total_probit)
  P_cum_full <- c(0, P_cum, 1)
  diff(P_cum_full)
}

# 다양한 z 에서 cell probabilities
z_range <- seq(-2, 2, by = 0.5)
prob_matrix <- sapply(z_range, margin_pred)
colnames(prob_matrix) <- z_range
rownames(prob_matrix) <- paste0("Y=", 1:4)

cat("\n4 범주의 marginal probabilities (다양한 z):\n")
print(round(prob_matrix, 3))
절단점과 Marginal Probabilities

절단점 추정값 검증:

  • 진짜 \(\gamma_2 = 0, \gamma_3 = 1.5\) 와 비교.
  • \(\gamma_1 = 0\) 또는 \(\gamma_1 = -1.5\) (시뮬레이션 vs identification).

Marginal probabilities 의 활용:

  • 임상 보고서: 평균 환자의 cell probabilities.
  • Predicted marginal patterns 와 관측 비교.
  • Subject-specific (random effects 포함) vs marginal (random effects 평균화).

ICC 가 큰 cluster effect 면:

  • Cluster random effects 추정 정확 (큰 cluster 일수록).
  • Caterpillar plot 으로 outlier cluster 식별.
  • 정책 결정 (cluster-level intervention).

3-level ordinal 의 정책 응용:

  • 학교 quality ranking (학업 등급의 cluster effect).
  • Hospital quality (환자 outcome 의 hospital effect).
  • 정책 개입 우선순위 결정.

6 관련 주제

선행 지식

후속 주제 (Ch.13 sub-posts)

  • § 13.2.4.2 — Nominal outcomes (식 13.30-13.35)
  • § 13.2.4.3 — Count outcomes (식 13.36-13.40)
  • § 13.3 — Ch.13 Summary
  • Ch.14 — 결측 데이터

관련 개념

  • Hedeker & Gibbons (1994) — 2-level ordinal probit/logistic
  • Raman & Hedeker (2005) — 3-level ordinal 정립
  • Liu & Hedeker (2006) — 3-level ordinal 응용
  • Magnus (1988) — Elimination matrix
  • McCullagh (1980) — Proportional odds 모형 원전
  • Bock (1975) — Threshold concept
  • Stroud & Sechrest (1966) — Gauss-Hermite quadrature
  • § 10.2.1 Partial Proportional Odds — 비례 가정 위반 처리

Subscribe

Enjoy this blog? Get notified of new posts by email: