1 들어가며 — § 10.4 와 같은 데이터, 다른 framework
§ 10.4 (MHRP partial PO, 10-6) 에서 비례 오즈 가정이 강하게 거부되어 partial proportional odds 모형으로 분석했다. § 11.2 는 같은 데이터를 nominal multinomial mixed-effects 로 재분석 — 비례 가정 자체를 버리고 모든 contrast 의 효과를 자유롭게 추정.
| 항목 | § 10.4 Ordinal partial PO (10-6) | § 11.2 Nominal multinomial (본 sub-post) |
|---|---|---|
| Framework | Cumulative logit (순서 가정) | Reference cell logit (순서 무관) |
| 비례 위반 처리 | \(u'\alpha_c\) (식 10.7) | 모든 covariate 의 contrast 별 자유 효과 |
| Random effects | 단일 \(\sigma_v\) | \(C-1\) 개 \(\sigma_c\) (contrast 별) |
| ICC | 0.39 (단일) | 0.19 (community), 0.62 (independent) |
| 추가 분석 | — | Helmert contrast 표기 |
“§ 11.2 = MHRP 데이터의 nominal 분석. 두 reference-cell contrast (community vs street, independent vs street) 의 그룹 차이가 명백히 다름 (Figure 11.1-11.2) — multinomial 의 자연 표현. Table 11.1 의 normal vs uniform random effects 가 매우 비슷한 결과 → 분포 가정에 robust. 두 contrast 의 ICC 가 0.19 vs 0.62 로 3 배 차이 → separate variance terms 의 강한 유의 (\(\chi^2_1 = 49.2\)) — independent housing 결정에 환자 이질성 매우 큼. Helmert contrast 분석 (Table 11.2) 으로 가장 직관적 해석: section 8 효과의 진짜 자리는 community vs independent 의 선택. 첫 Helmert (non-street vs street) 에서 section 8 효과 없음, 둘째 Helmert (independent vs community) 에서 강한 효과. § 10.4 partial PO 와 같은 결론을 더 풍부한 framework 로.”
2 § 11.2 — Reference Cell 분석
2.1 데이터와 contrast 설정
데이터는 § 10.4 (10-6) 와 동일 — McKinney Homeless Research Project, 361 클라이언트, 4 시점, 3 범주 응답.
3 범주 응답:
- Street/shelters (1): 가장 unstable.
- Community housing (2): 중간.
- Independent housing (3): 가장 stable.
Reference category: street — 가장 base 상태, 가장 흔한 시작점.
두 reference-cell contrast:
- 첫 contrast: community vs street (\(c = 2\) vs \(c = 1\)).
- 둘째 contrast: independent vs street (\(c = 3\) vs \(c = 1\)).
Street 를 reference 로 선택한 이유:
- 임상적 base: 노숙 (가장 unstable) 이 자연스러운 시작점. 모든 클라이언트가 baseline 에서 street 비율 가장 높음.
- 해석 명확: 다른 두 범주의 효과가 “street 에서 빠져나가는 정도”.
- Section 8 의 임상적 가치: section 8 의 효과가 “street → community” 와 “street → independent” 의 두 contrast 로 명확 분리.
§ 10.4 의 ordinal 분석과의 차이:
- Ordinal: cumulative comparison (street vs others, street + community vs independent).
- Nominal reference cell: pairwise comparison (community vs street, independent vs street).
두 framework 가 같은 데이터를 다른 각도에서 봄 — 비교 결과가 다음 Helmert 분석에서 통합.
2.2 Figure 11.1-11.2 — 두 Logit 의 시각화
Figure 11.1 (Community vs Street):
- Non-section 8 (control): Baseline 에 음수, 시간 따라 빠르게 양수로 증가 (community 비율 ↑).
- Section 8: Baseline 부터 양수 가까움, 그러나 시간에 따라 control 만큼 증가 안 함.
- 12 month 에서 두 그룹 차이 가장 큼 — control 이 community 로 더 많이 이동.
Figure 11.2 (Independent vs Street):
- Non-section 8: Baseline 에 매우 음수, 시간 따라 천천히 증가.
- Section 8: Baseline 부터 더 빠르게 증가, 6 month 에 큰 점프, 이후 plateau.
- 6 month 에서 두 그룹 차이 가장 큼 — section 8 가 빠르게 independent.
두 logit 의 그룹 차이 패턴이 다름:
- Community vs Street: control 이 더 호전 (community 로 진행).
- Independent vs Street: section 8 가 훨씬 더 호전 (independent 로 직접).
이것이 § 10.4 partial PO 분석에서 본 section 8 효과의 비대칭 의 시각적 표현. Nominal framework 에서는 두 contrast 의 효과가 별도로 보여 비대칭이 자연스럽게 드러남.
→ Ordinal cumulative 보다 nominal reference cell 이 비대칭을 보기 더 쉬움. 같은 임상 사실의 다른 시각.
2.3 Table 11.1 — Normal vs Uniform Random Effects
두 모형:
- Normal prior: 표준 가정 (\(\theta \sim \mathcal{N}(0, 1)\)).
- Uniform prior: \(\theta\) 가 균등 분포 — 정규 가정 위반 시 robustness 검증.
§ 9.6.3 에서 본 Hedeker MIXOR 의 random effects 분포 옵션 활용.
Community vs Street (첫 contrast):
| 모수 | Normal Estimate | Normal SE | Uniform Estimate | Uniform SE |
|---|---|---|---|---|
| Intercept | -0.452 | 0.192 | -0.473 | 0.184 |
| t1 (6 month) | 1.942 | 0.312 | 1.850 | 0.309 |
| t2 (12 month) | 2.820 | 0.466 | 2.686 | 0.457 |
| t3 (24 month) | 2.259 | 0.378 | 2.143 | 0.375 |
| Section 8 | 0.521 | 0.268 | 0.471 | 0.258 |
| Section 8 × t1 | -0.135 | 0.490 | -0.220 | 0.484 |
| Section 8 × t2 | -1.917 | 0.611 | -1.938 | 0.600 |
| Section 8 × t3 | -0.952 | 0.535 | -0.987 | 0.527 |
| Subject SD | 0.871 | 0.138 | 0.153 | 0.031 |
Independent vs Street (둘째 contrast):
| 모수 | Normal Estimate | Normal SE | Uniform Estimate | Uniform SE |
|---|---|---|---|---|
| Intercept | -2.675 | 0.367 | -2.727 | 0.351 |
| t1 (6 month) | 2.682 | 0.425 | 2.540 | 0.422 |
| t2 (12 month) | 4.088 | 0.559 | 3.916 | 0.551 |
| t3 (24 month) | 4.099 | 0.469 | 3.973 | 0.462 |
| Section 8 | 0.781 | 0.491 | 0.675 | 0.460 |
| Section 8 × t1 | 2.003 | 0.614 | 2.016 | 0.605 |
| Section 8 × t2 | 0.548 | 0.694 | 0.645 | 0.676 |
| Section 8 × t3 | 0.304 | 0.615 | 0.334 | 0.600 |
| Subject SD | 2.334 | 0.196 | 0.490 | 0.040 |
\(-2 \log L\): Normal = 2218.73, Uniform = 2224.74.
Bold: \(p < 0.05\), italic: \(0.05 < p < 0.10\).
결론 1 — 회귀 계수가 매우 비슷:
- Community vs Street: t1 (1.942 vs 1.850), t2 (2.820 vs 2.686), Section 8 × t2 (-1.917 vs -1.938) — 차이 작음.
- Independent vs Street: 모두 비슷.
- → 분포 가정에 robust. 정규 가정이 적절히 표현되지 않더라도 회귀 계수 추정은 비슷.
결론 2 — Random effects 분산 추정은 다름:
- Community vs Street: Normal SD 0.871 vs Uniform SD 0.153 — 매우 큰 차이.
- Independent vs Street: Normal SD 2.334 vs Uniform SD 0.490 — 큰 차이.
이유: Uniform 분포의 분산은 \((b-a)^2/12\) — 정규 분산 1 보다 훨씬 작음. Random effects 의 척도가 분포에 따라 다름.
ICC 척도 환산 필요:
- Normal: \(r = \widehat\sigma^2 / (\widehat\sigma^2 + \pi^2/3)\).
- Uniform: \(r = \widehat\sigma^2 / (\widehat\sigma^2 + \pi^2/3)\) — 같은 공식 (logistic level-1 분산 동일).
- 그러나 분포의 잠재 분산 척도가 달라 ICC 직접 비교 어려움.
\(-2 \log L\) 비교: Normal = 2218.73, Uniform = 2224.74. Normal 이 약간 더 좋음 (deviance 작음). 두 모형 모두 적합한 fit, 큰 차이 없음.
실무 권고 — 분포 robustness 검증 결과:
- 회귀 계수 결론은 분포에 robust → 정규 가정 사용 안전.
- 분산 척도가 다른 것은 인지하되, 정규가 표준.
- Skewed 또는 multi-modal 분포가 의심되면 비모수 분포 고려 (Hedeker MIXOR 의 옵션).
2.4 임상적 해석 — Section 8 효과의 비대칭
Community vs Street (첫 contrast) — Section 8 × t:
- t1: -0.135 (비유의).
- t2: -1.917 (강하게 유의, 음수).
- t3: -0.952 (marginally).
해석: section 8 가 12 month 에서 community 로 가는 비율이 control 보다 적음 (음수 효과).
Independent vs Street (둘째 contrast) — Section 8 × t:
- t1: 2.003 (강하게 유의, 양수).
- t2: 0.548 (비유의).
- t3: 0.304 (비유의).
해석: section 8 가 6 month 에서 independent 로 가는 비율이 control 보다 빠름 (양수 효과).
종합 해석:
- 6 month: Section 8 가 빠르게 independent 로 (큰 양수 효과). Control 은 community 로 (점진).
- 12 month: Control 이 community 로 catch up (양수 효과). Section 8 는 이미 independent 에 정착 (community 효과 음수).
- 24 month: 효과가 약화 — 두 그룹의 분포가 안정.
§ 10.4 partial PO 와의 일치:
- § 10.4 의 결론: section 8 효과는 independent housing 진행에만 (모든 시점), non-street 진행에는 효과 없음.
- § 11.2 의 결론: section 8 가 6 month 에 빠르게 independent, control 은 12 month 에 community 로 catch up.
같은 임상 사실의 두 표현. Nominal 이 더 풍부한 정보 — 시점별 어떤 contrast 에 효과 가장 큰지 분리.
정책 함의:
- Section 8 의 핵심 가치: 빠른 independent housing 진행 (community 단계 우회).
- Control 그룹은 결국 community 까지는 진행하지만 independent 까지 못 감.
- → Section 8 가 단기에는 큰 차이, 장기에는 차이 약화 (control 의 catch up).
2.5 ICC 의 Contrast 별 분리
식 (11.7) 의 ICC (각 contrast 별):
\[ \widehat r_1 = \frac{0.871^2}{0.871^2 + \pi^2/3} = \frac{0.759}{0.759 + 3.290} = 0.19 \quad (\text{community vs street}) \]
\[ \widehat r_2 = \frac{2.334^2}{2.334^2 + \pi^2/3} = \frac{5.448}{5.448 + 3.290} = 0.62 \quad (\text{independent vs street}) \]
→ 두 contrast 의 ICC 가 매우 다름 (0.19 vs 0.62, 3 배 이상 차이).
ICC 의 임상적 해석:
- Community vs Street (\(r_1 = 0.19\)): 환자 이질성 작음. 누구나 community 로 가는 결정에는 환자 차이가 미미. 일반적 정책 (housing assistance) 으로 충분.
- Independent vs Street (\(r_2 = 0.62\)): 환자 이질성 매우 큼. Independent housing 에 갈 환자와 못 갈 환자의 차이가 명확. 환자 segmentation 효과적.
정책 함의:
- Section 8 같은 voucher 를 모두에게 균등하게 줄 필요 없음.
- Independent 에 갈 잠재력 있는 환자에게 우선 배분 이 비용 효과적.
- 그 잠재력은 baseline 에서 부분적으로 식별 가능 (Empirical Bayes 추정).
§ 10.4 ordinal 의 단일 ICC vs § 11.2 nominal 의 두 ICC:
- Ordinal: 단일 ICC = 0.39 (평균값).
- Nominal: 0.19 + 0.62 (두 contrast 별).
- → Ordinal 모형이 두 contrast 의 차이를 평균화. Nominal 모형이 임상적으로 더 가치 있는 정보.
LR 검정 — Separate vs Common variance:
- \(H_0: \sigma_1 = \sigma_2\) (두 contrast 의 random effect SD 같음).
- \(\chi^2_1 = 49.2\), p < .001 — separate variance 강하게 유의.
이 결과가 nominal 모형의 핵심 정보. Ordinal 의 단일 SD 가정으로는 절대 못 얻음.
실무 권고:
- Nominal 적합 후 항상 contrast 별 ICC 비교.
- 큰 차이 → 환자 segmentation 정책 검토.
- 비슷한 ICC → ordinal 모형으로 단순화 가능 (모수 절약).
2.6 Random Effects 의 Group Homogeneity Check
§ 10.2.2 의 Hedeker et al. (2006) 그룹별 분산 모형 (10-2) 와 평행. MHRP 두 그룹 (control vs section 8) 의 random effect SD 비교:
| Contrast | Control SD | SE | Section 8 SD | SE |
|---|---|---|---|---|
| Community vs Street | 0.771 | 0.182 | 0.966 | 0.214 |
| Independent vs Street | 2.228 | 0.299 | 2.432 | 0.266 |
\(-2 \log L\): 그룹별 = 2218.43, 동질 = 2218.73. 차이 0.30 — homogeneity 적합.
두 그룹 (control, section 8) 의 random effect SD 가 거의 같음:
- Community vs Street: 0.771 vs 0.966 — 비슷.
- Independent vs Street: 2.228 vs 2.432 — 비슷.
해석: section 8 가 평균 효과는 다르게 만들지만, 환자 간 변동의 크기는 두 그룹에서 비슷. 즉 section 8 가 모든 환자에게 비슷하게 작용 (특정 환자 sub-group 에 집중되지 않음).
정책 함의: section 8 효과가 robust — 다양한 환자에게 비슷한 효과. Targeted 배분 (특정 환자만) 보다는 broad 배분이 효과적.
3 Helmert Contrast 분석
3.1 모형 정의
3 범주에 대한 Helmert contrast matrix:
\[ D = \begin{bmatrix} -2/3 & 1/3 & 1/3 \\ 0 & -1/2 & 1/2 \end{bmatrix} \]
의미:
- 첫 Helmert: street vs (community + independent) — “street vs non-street”.
- 둘째 Helmert: community vs independent — “non-street 안에서 community vs independent 선택”.
각 row 합 = 0 (zero-sum), scale = 1 (contrast coefficient 차이).
Reference cell (street) 분석은 두 비교 (community vs street, independent vs street) 가 모두 street 와의 비교 — street 에 dominated.
Helmert 는 다른 분리:
- 첫 Helmert (non-street vs street): “노숙 탈출의 일반 효과”. Section 8 가 그냥 노숙에서 빠져나가는 데 기여하는가?
- 둘째 Helmert (independent vs community): “노숙 탈출 후 어디로 가는가”. 일단 노숙 탈출하면 community 와 independent 중 어디로 가는가?
이 분리가 정책 설계에 더 직접적 — section 8 가 노숙 탈출을 도와주는 program 인지, 아니면 노숙 탈출 후 stable 한 housing 으로 가게 도와주는 program 인지 구분.
3.2 Table 11.2 — Helmert 결과
Independent + Community vs Street (첫 Helmert):
| 모수 | Estimate | SE |
|---|---|---|
| Intercept | -1.564 | 0.244 |
| t1 (6 month) | 2.312 | 0.322 |
| t2 (12 month) | 3.454 | 0.484 |
| t3 (24 month) | 3.179 | 0.387 |
| Section 8 | 0.651 | 0.334 |
| Section 8 × t1 | 0.934 | 0.495 |
| Section 8 × t2 | -0.684 | 0.601 |
| Section 8 × t3 | -0.324 | 0.517 |
| Subject SD | 1.602 | 0.148 |
Independent vs Community (둘째 Helmert):
| 모수 | Estimate | SE |
|---|---|---|
| Intercept | -2.224 | 0.326 |
| t1 (6 month) | 0.741 | 0.375 |
| t2 (12 month) | 1.268 | 0.352 |
| t3 (24 month) | 1.839 | 0.358 |
| Section 8 | 0.260 | 0.425 |
| Section 8 × t1 | 2.138 | 0.505 |
| Section 8 × t2 | 2.465 | 0.512 |
| Section 8 × t3 | 1.256 | 0.509 |
| Subject SD | 1.463 | 0.166 |
\(-2 \log L = 2218.73\).
Bold: \(p < 0.05\), italic: \(0.05 < p < 0.10\).
첫 Helmert (non-street vs street) — Section 8 효과:
- Section 8 main: marginally (0.651, p ≈ 0.05).
- Section 8 × t1, t2, t3: 모두 비유의 (0.934, -0.684, -0.324).
- → Section 8 가 단순히 노숙 탈출에는 효과 없음.
둘째 Helmert (independent vs community) — Section 8 효과:
- Section 8 × t1: 2.138 (강하게 유의).
- Section 8 × t2: 2.465 (강하게 유의).
- Section 8 × t3: 1.256 (유의).
- → Section 8 가 community 보다 independent 로 가는 데 매우 강한 효과 (모든 시점).
가장 직관적 해석:
“Section 8 의 진짜 가치는 노숙 탈출 후 어디로 가는가 의 결정에 있다 — community 가 아닌 independent housing 으로.”
이 결론이 reference cell 분석에서는 명확히 보이지 않음 — community vs street 와 independent vs street 의 두 비교가 street 와의 비교로 dominated. Helmert 가 두 단계 (탈출 + 진행 방향) 로 분리해 명확화.
저자의 결론 인용:
“In many ways, the Helmert contrasts, with their intuitive interpretations, represent the best choice for the analysis of these data.”
→ Helmert contrast 가 본 데이터에 가장 적합한 분석.
3.3 Helmert ICC 의 의미
- 첫 Helmert (non-street): SD = 1.602.
- 둘째 Helmert (independent vs community): SD = 1.463.
ICC:
- \(r_1 = 1.602^2 / (1.602^2 + \pi^2/3) = 0.44\).
- \(r_2 = 1.463^2 / (1.463^2 + \pi^2/3) = 0.39\).
두 Helmert ICC (0.44 vs 0.39) 가 비슷:
- 두 단계 (탈출 + 진행) 모두에 환자 이질성이 비슷한 정도로 영향.
- → 두 contrast 의 분산이 비슷하다는 점이 reference cell 의 ICC 차이 (0.19 vs 0.62) 와 다름.
Reference cell vs Helmert 의 ICC 비교:
| 모형 | 첫 contrast ICC | 둘째 contrast ICC |
|---|---|---|
| Reference cell (street) | 0.19 (community vs street) | 0.62 (independent vs street) |
| Helmert | 0.44 (non-street vs street) | 0.39 (indep vs community) |
같은 데이터에 다른 contrast — 분산 분해가 다른 방식으로 나타남.
Reference cell 의 큰 차이 (0.19 vs 0.62) 의 의미:
- Community vs street 는 환자 무관 (대부분이 community 로 가능).
- Independent vs street 는 환자 차이 큼 (independent 갈 환자 vs 못 갈 환자).
Helmert 의 비슷한 ICC (0.44 vs 0.39) 의 의미:
- 노숙 탈출 자체에 환자 차이 보통.
- 노숙 탈출 후 어디로 가는지에도 환자 차이 보통.
- → 두 단계 모두 환자 segmentation 가치 있음.
임상적 정책 결정 — 어느 contrast 를 보고 정책 설계할지:
- 단순 binary 결정 (집 있음 vs 노숙) → Helmert 첫.
- Independent housing 강조 → Helmert 둘째 또는 reference cell 둘째.
4 § 10.4 (Ordinal Partial PO) vs § 11.2 (Nominal Multinomial) 종합 비교
| 항목 | § 10.4 Partial PO (10-6) | § 11.2 Nominal (본 sub-post) |
|---|---|---|
| Framework | Cumulative logit | Reference cell + Helmert |
| 위반 처리 | \(\alpha_c\) (location 변동) | 모든 \(\beta_c\) 자유 |
| Section 8 효과 | independent 진행 ↑, community 진행 무관 | 동일 (다른 표현) |
| ICC | 0.39 (단일) | 0.19, 0.62 (contrast 별 분리) |
| Section 8 × time | 6, 12 month 강함 (NPO Independent) | 6 month 강함 (Reference Indep), 모든 시점 강함 (Helmert 둘째) |
| 최선 분석 | Partial PO 모형 | Helmert contrast 모형 |
| -2 log L | 2222.25 (NPO) | 2218.73 (Helmert) |
공통 결론:
- Section 8 가 노숙 환자에게 효과적.
- 효과의 본질은 “community 단계를 건너뛰고 independent housing 으로 직접 진행”.
- 비대칭 효과 — community 진행에는 효과 없음, independent 진행에는 강한 효과.
Nominal 의 추가 가치:
- Random effects 분산의 contrast 별 분리: Reference cell 의 0.19 vs 0.62 가 ordinal 의 단일 0.39 에서 못 보이는 정보.
- Helmert contrast 의 직관성: 두 단계 (탈출 + 진행) 의 자연스러운 분리.
- 모형 적합도: Nominal Helmert (-2 log L = 2218.73) 가 ordinal NPO (2222.25) 보다 약간 더 좋음.
Ordinal 의 보존 가치:
- 모수 절약 (비례 가정 부분 활용).
- 응답이 본질적으로 순서가 있을 때 자연.
- 임상적 해석이 단순 (cumulative odds).
최선의 분석 권고:
- 응답 순서 명확 + 비례 가정 만족 → Standard ordinal PO.
- 응답 순서 명확 + 비례 위반 일부 → Partial PO.
- 응답 순서 약 + 비례 강하게 위반 → Nominal multinomial.
- 응답 비순서 → Nominal multinomial 필수.
MHRP 데이터의 경우:
- 응답이 약한 순서 (street < community < independent) — Helmert 가 두 단계로 분리하기 좋음.
- 비례 강하게 위반 → nominal multinomial 가 적절.
- → Nominal Helmert 가 최선의 선택.
5 응용 분야
| 분야 | Nominal multinomial 우선 | Helmert contrast 활용 |
|---|---|---|
| 노숙자 정책 (MHRP) | 본 시연 | street → non-street → independent 의 두 단계 |
| 의료 이용 | 진료 형태 (no/outpatient/inpatient) | no care vs care, outpatient vs inpatient |
| 약물 사용 패턴 | 비사용/가끔/규칙적/매일 | 사용 vs 비사용, 빈도 단계 |
| 직업 진로 | 학생/취업/대학원/실업 | 활동 vs 실업, 활동 종류 |
| 가족 구조 | 미혼/결혼/이혼/사별 | 결혼 경험 vs 미혼, 현재 상태 |
→ “응답이 단계적 진행 패턴을 가질 때” Helmert contrast 가 자연.
6 코드 예시
6.1 Step 1: Reference Cell Multinomial 적합 (R mclogit)
library(mclogit)
# MHRP-like 데이터 (10-6 의 시뮬레이션 함수 활용)
# (시뮬레이션 코드는 10-6 참조 — 여기서는 적합만 시연)
# Random intercept multinomial — reference category = "1" (street)
df$y <- factor(df$y, levels = c(1, 2, 3),
labels = c("street", "community", "independent"))
fit_ref <- mblogit(y ~ factor(time) + section8 + section8:factor(time),
random = ~1 | subject,
data = df, baseline = "street")
summary(fit_ref)
# 두 contrast 별 회귀 계수
# - community vs street: 첫 set
# - independent vs street: 둘째 setmclogit::mblogit 의 출력
각 contrast (reference 제외) 별 별도 회귀 계수:
- “community vs street”: 모든 covariate 계수.
- “independent vs street”: 모든 covariate 계수.
논문 표 11.1 의 두 panel 과 정확히 대응.
baseline = "street" 로 reference 설정. 다른 reference 면 결과 변함 (모수 회전, 적합도 동일).
6.2 Step 2: Random Effects 분포 비교 (Normal vs Uniform)
# R 의 mclogit 은 normal 만 지원
# Bayesian 우회 — brms 로 분포 변경
library(brms)
# Normal random intercept (default)
fit_normal <- brm(y ~ factor(time) + section8 + section8:factor(time)
+ (1 | subject),
data = df, family = categorical("logit"),
chains = 2, cores = 2, iter = 2000, refresh = 0)
# Uniform random intercept (truncated)
# Stan 의 prior 변경 — uniform(-3, 3) 같은 형태
prior_uniform <- prior(uniform(-3, 3), class = "sd")
fit_uniform <- brm(y ~ factor(time) + section8 + section8:factor(time)
+ (1 | subject),
data = df, family = categorical("logit"),
prior = prior_uniform,
chains = 2, cores = 2, iter = 2000, refresh = 0)
# 결과 비교
summary(fit_normal)
summary(fit_uniform)brms 의 prior 옵션:
normal(0, 5): 약한 정규 prior (default 와 비슷).uniform(0, 3): 균등 prior (random effects SD 의 truncated uniform).cauchy(0, 1): 두꺼운 꼬리 (outlier robust).student_t(3, 0, 1): 정규 vs 두꺼운 꼬리 사이.
Frequentist 대안:
- Hedeker
MIXNO: 정규 vs uniform 직접 옵션 (논문의 분석). - SAS
PROC NLMIXED: random effects 분포 직접 코딩.
실무 권고:
- 정규 가정 robustness 검증 시 다른 분포 적합 → 회귀 계수가 비슷하면 정규 사용.
- 회귀 계수가 크게 다르면 분포 의심 → outlier 또는 multi-modal 검토.
6.3 Step 3: ICC 의 Contrast 별 계산
# Random effects 분산 추출
sigma_c1 <- attr(VarCorr(fit_ref), "sd")[1] # community vs street
sigma_c2 <- attr(VarCorr(fit_ref), "sd")[2] # independent vs street
icc_c1 <- sigma_c1^2 / (sigma_c1^2 + pi^2 / 3)
icc_c2 <- sigma_c2^2 / (sigma_c2^2 + pi^2 / 3)
cat("Contrast 별 ICC:\n")
cat(" Community vs Street: r1 =", round(icc_c1, 3), "(논문: 0.19)\n")
cat(" Independent vs Street: r2 =", round(icc_c2, 3), "(논문: 0.62)\n")
# LR test: separate vs common variance
fit_common <- mblogit(y ~ factor(time) + section8 + section8:factor(time),
random = ~1 | subject,
data = df, baseline = "street",
common.random = TRUE) # 공통 SD 가정
lr_stat <- 2 * (logLik(fit_ref) - logLik(fit_common))
cat("\nLR test (separate vs common variance):\n")
cat(" chi^2 =", round(lr_stat, 2), "(논문: 49.2)\n")
cat(" df = 1, p =", format.pval(1 - pchisq(lr_stat, 1), digits = 3), "\n")두 ICC 의 차이가 크면 (\(r_2 / r_1 > 2\)):
- 두 contrast 가 매우 다른 환자 이질성 패턴.
- 환자 segmentation 정책 효과적 (특정 contrast 에서).
- Ordinal 모형으로 단순화 어려움.
두 ICC 가 비슷하면 (\(r_2 / r_1 \approx 1\)):
- 두 contrast 의 환자 이질성 비슷.
- Ordinal 모형으로 단순화 가능 (모수 절약).
MHRP 의 경우 ICC 비율 0.62 / 0.19 ≈ 3.3 — 매우 다름. → Nominal 모형 유지가 정당.
6.4 Step 4: Helmert Contrast 의 직접 적용
# Helmert contrast matrix (3 범주)
D_helmert_3 <- rbind(
c(-2/3, 1/3, 1/3), # 첫 Helmert: street vs non-street
c(0, -1/2, 1/2) # 둘째 Helmert: community vs independent
)
print(D_helmert_3)
# R 의 contrasts() 활용
df$y_helmert <- factor(df$y, ordered = FALSE)
contrasts(df$y_helmert) <- t(D_helmert_3)
print(contrasts(df$y_helmert))
# Helmert 적합
fit_helmert <- mblogit(y_helmert ~ factor(time) + section8 + section8:factor(time),
random = ~1 | subject,
data = df)
summary(fit_helmert)R 의 contrasts() 가 column-wise contrast 사용 — 위 코드에서 t(D_helmert_3) 로 transpose.
각 column 이 한 contrast:
- 첫 column: 범주 1 (street) 에 -2/3, 범주 2 (community) 에 1/3, 범주 3 (independent) 에 1/3.
- 둘째 column: 범주 2 에 -1/2, 범주 3 에 1/2.
적합 결과의 회귀 계수:
- “y_helmert1”: 첫 Helmert (street vs non-street) 의 회귀 계수.
- “y_helmert2”: 둘째 Helmert (community vs independent) 의 회귀 계수.
논문 표 11.2 와 비교:
- Section 8 × time (첫 Helmert): 모두 비유의 → “단순 노숙 탈출에는 section 8 효과 없음”.
- Section 8 × time (둘째 Helmert): 모두 유의 → “노숙 탈출 후 independent 로 가는 데 강한 효과”.
결과의 명료성 — Reference cell 의 두 contrast (community vs street, independent vs street) 가 street 와의 비교로 묶였던 것을, Helmert 가 “탈출 + 진행” 두 단계로 분리.
최선의 임상 해석을 위해 Helmert contrast 적극 활용 권고.
7 관련 주제
선행 지식
- Ch.11 Overview — Nominal GLMM 의 큰 그림
- § 11.1 ~ 11.1.2 — Multinomial 모형의 수학적 깊이 + Helmert contrast
- § 10.4 MHRP partial PO — 같은 데이터의 ordinal 분석 (직접 비교)
- § 10.2.2 Scaling terms — 그룹별 분산 모형 (§ 11.2 의 group homogeneity check 와 평행)
- § 9.6.3 Random effects 분포 — Normal vs uniform 옵션의 토대
후속 주제 (Ch.11 sub-posts)
- § 11.3 — Competing Risk Survival Models
- § 11.3.1: Waiting for Organ Transplantation (장기 이식 대기 — 다른 응용 사례)
- § 11.4 — Ch.11 Summary
관련 개념
- McKinney Homeless Research Project (MHRP) — Hough et al. (1997), Hurlburt et al. (1996)
- Section 8 housing certificate program (HUD)
- Bock (1972, 1975) — Helmert contrast 의 multinomial 적용
- Hedeker (1999, 2003) — MIXNO 소프트웨어 + general contrast formulation
- Hedeker et al. (2006) — 그룹별 random effects 분산 (10-2 의 §10.2.2)
- Snijders & Bosker (1999) — Random effects LR 검정의 boundary 문제
- § 9.7 NIMH 분석 — 같은 데이터의 다른 chapter 분석 (이항)