[G1-Sync] Manual knowledge update
This commit is contained in:
@@ -2,61 +2,171 @@
|
||||
id: wiki-2026-0508-structural-equation-modeling
|
||||
title: Structural Equation Modeling
|
||||
category: 10_Wiki/Topics
|
||||
status: needs_review
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [MATH-STAT-SEM-001]
|
||||
aliases: [SEM, Path-Analysis, CFA-SEM]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 1.0
|
||||
tags: [math, Statistics, sem, structural-equation-modeling, latent-variables, multivariate-Analysis, Causal-Inference]
|
||||
confidence_score: 0.88
|
||||
verification_status: applied
|
||||
tags: [statistics, sem, latent-variable, causal, psychometrics]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-04-26
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
|
||||
tech_stack:
|
||||
language: python-r
|
||||
framework: semopy-lavaan
|
||||
---
|
||||
|
||||
# Structural Equation Modeling (SEM, 구조 방정식 모델링)
|
||||
# Structural Equation Modeling
|
||||
|
||||
## 📌 한 줄 통찰 (The Karpathy Summary)
|
||||
> "측정 가능한 데이터 뒤에 숨겨진 추상적 개념(Latent Variables)들을 수면 위로 끌어올리고, 그들 사이의 복잡한 인과 고리를 단일 시스템의 수식으로 정의하라" — 직접 관찰되지 않는 잠재 변수와 측정 변수 간의 관계 및 잠재 변수들 사이의 인과 관계를 동시에 분석하는 다변량 통계 기법.
|
||||
## 매 한 줄
|
||||
> **"매 latent + 매 path 의 통합"**. SEM 의 measurement model (CFA: 매 observed → 매 latent) + structural model (매 latent 사이 의 path) 의 simultaneously fit. 1970s Jöreskog (LISREL) — 2026 에 psychology, marketing research, epidemiology 의 표준.
|
||||
|
||||
## 📖 구조화된 지식 (Synthesized Content)
|
||||
- **추출된 패턴:** "Latent Factor Discovery and Path-based Causality" — 설문 항목 같은 관측 지표들을 묶어 추상적 개념(요인)을 만들고, 이 개념들이 서로에게 미치는 영향력의 크기와 방향을 경로 분석(Path Analysis)을 통해 검증하는 패턴.
|
||||
- **핵심 구성 모델:**
|
||||
- **Measurement Model (측정 모델):** 관측 변수들이 잠재 변수를 얼마나 잘 설명하는지 분석 (확인적 요인 분석).
|
||||
- **Structural Model (구조 모델):** 잠재 변수들 간의 인과적 연결과 상관관계 분석.
|
||||
- **의의:** 심리학, 사회과학, 경영학 등 인간의 심리나 조직의 특성처럼 복잡하고 다층적인 인과 구조를 수학적으로 엄밀하게 증명해야 하는 분야의 표준 분석 도구.
|
||||
## 매 핵심
|
||||
|
||||
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
|
||||
- **과거 데이터와의 충돌:** 선형 관계 분석에만 국한되던 과거와 달리, 이제는 딥러닝과 결합하여 비선형적인 관계를 탐색하거나 베이지안 접근법을 통해 더 유연하게 인과 모델을 추정하는 '신경 구조 방정식 모델링'으로 영역이 확장되고 있음.
|
||||
- **정책 변화:** Antigravity 프로젝트는 에이전트의 답변 품질에 영향을 미치는 여러 잠재 요인(정확성, 친절함, 간결함 등)과 사용자의 만족도 사이의 복잡한 상관관계를 심층 분석하기 위해 구조 방정식 방법론을 지표 설계에 참고함.
|
||||
### 매 component
|
||||
- **Measurement model (CFA)**: 매 observed indicator → 매 latent factor (e.g., 4 items → "Anxiety").
|
||||
- **Structural model**: 매 latent 사이 의 directional path (e.g., Anxiety → Performance).
|
||||
- **Latent variable**: 매 unobserved construct — measurement error 의 separate.
|
||||
- **Indicator**: observed measurement — 매 reflective (factor causes indicator) vs formative.
|
||||
|
||||
## 🔗 지식 연결 (Graph)
|
||||
- [[Statistical-Hypothesis-Testing|Statistical-Hypothesis-Testing]], Cluster-Analysis-Techniques, [[Representation-Learning|Representation-Learning]], [[Probability-Theory-Foundations|Probability-Theory-Foundations]]
|
||||
- **Raw Source:** 10_Wiki/Topics/AI/Structural-Equation-Modeling.md
|
||||
### 매 estimation
|
||||
- **MLE** (default) — 매 multivariate normal assumption.
|
||||
- **WLSMV** — 매 ordinal/categorical data.
|
||||
- **Bayesian SEM** — 매 small sample, complex model.
|
||||
|
||||
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
|
||||
### 매 fit indices
|
||||
- **χ² / df** — 매 < 3 의 양호.
|
||||
- **CFI / TLI** — 매 ≥ 0.95 의 양호.
|
||||
- **RMSEA** — 매 ≤ 0.06 의 양호, ≤ 0.08 의 acceptable.
|
||||
- **SRMR** — 매 ≤ 0.08 의 양호.
|
||||
- 매 single index 의 X — 매 multiple 의 결합 의 평가.
|
||||
|
||||
**언제 이 지식을 쓰는가:**
|
||||
- *(TODO)*
|
||||
### 매 응용
|
||||
1. Psychology — Big Five, depression-anxiety pathway.
|
||||
2. Marketing — brand → satisfaction → loyalty.
|
||||
3. Education — SES → study time → achievement.
|
||||
4. Epidemiology — stress → cortisol → disease.
|
||||
|
||||
**언제 쓰면 안 되는가:**
|
||||
- *(TODO)*
|
||||
## 💻 패턴
|
||||
|
||||
## 🧪 검증 상태 (Validation)
|
||||
### 1. semopy (Python) — basic CFA
|
||||
```python
|
||||
import semopy
|
||||
desc = """
|
||||
# measurement
|
||||
Anxiety =~ q1 + q2 + q3 + q4
|
||||
Depression =~ d1 + d2 + d3
|
||||
# structural
|
||||
Depression ~ Anxiety
|
||||
"""
|
||||
model = semopy.Model(desc)
|
||||
res = model.fit(df)
|
||||
print(semopy.calc_stats(model))
|
||||
```
|
||||
|
||||
- **정보 상태:** needs_review
|
||||
- **출처 신뢰도:** A
|
||||
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
|
||||
### 2. lavaan (R) — gold standard
|
||||
```r
|
||||
library(lavaan)
|
||||
mod <- '
|
||||
# measurement
|
||||
visual =~ x1 + x2 + x3
|
||||
textual =~ x4 + x5 + x6
|
||||
speed =~ x7 + x8 + x9
|
||||
# structure
|
||||
textual ~ visual
|
||||
speed ~ textual
|
||||
'
|
||||
fit <- sem(mod, data=HolzingerSwineford1939)
|
||||
summary(fit, fit.measures=TRUE, standardized=TRUE)
|
||||
```
|
||||
|
||||
## 🧬 중복 검사 (Duplicate Check)
|
||||
### 3. Mediation analysis
|
||||
```r
|
||||
mod <- '
|
||||
Y ~ c*X + b*M
|
||||
M ~ a*X
|
||||
ab := a*b # indirect effect
|
||||
total := c + ab
|
||||
'
|
||||
fit <- sem(mod, data=df, se="bootstrap", bootstrap=5000)
|
||||
parameterEstimates(fit, boot.ci.type="bca.simple")
|
||||
```
|
||||
|
||||
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
|
||||
- **처리 방식:** UPDATE (자동 정규화)
|
||||
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
|
||||
### 4. Multi-group invariance
|
||||
```r
|
||||
fit_config <- cfa(mod, data=df, group="country")
|
||||
fit_metric <- cfa(mod, data=df, group="country", group.equal="loadings")
|
||||
anova(fit_config, fit_metric) # 매 fit 의 worsen 의 test
|
||||
```
|
||||
|
||||
## 🕓 변경 이력 (Changelog)
|
||||
### 5. Latent growth curve
|
||||
```r
|
||||
mod <- '
|
||||
i =~ 1*t1 + 1*t2 + 1*t3 + 1*t4
|
||||
s =~ 0*t1 + 1*t2 + 2*t3 + 3*t4
|
||||
i ~~ s
|
||||
'
|
||||
fit <- growth(mod, data=df)
|
||||
```
|
||||
|
||||
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|
||||
|------|-----------|-----------|--------|
|
||||
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
|
||||
### 6. Modification indices
|
||||
```r
|
||||
modindices(fit, sort=TRUE, maximum.number=10)
|
||||
# 매 model 의 어떤 path 의 추가 시 fit 의 향상 의 예측
|
||||
# 매 theory-driven X — 매 cherry-pick 의 위험
|
||||
```
|
||||
|
||||
### 7. Bootstrap CI for indirect effect
|
||||
```r
|
||||
fit <- sem(mod, data=df, se="bootstrap", bootstrap=5000)
|
||||
parameterEstimates(fit, boot.ci.type="bca.simple", standardized=TRUE)
|
||||
```
|
||||
|
||||
### 8. Bayesian SEM (blavaan)
|
||||
```r
|
||||
library(blavaan)
|
||||
fit <- bsem(mod, data=df, n.chains=4, burnin=2000, sample=4000)
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| Continuous indicators, large n | MLR (robust ML) |
|
||||
| Ordinal / Likert | WLSMV |
|
||||
| Small n (<200) | Bayesian (blavaan) |
|
||||
| Latent + multiple regression | SEM > separate regressions (errors-in-vars) |
|
||||
| Mediation | bootstrap CI for indirect |
|
||||
| Longitudinal | LGC / cross-lagged panel |
|
||||
| Complex / non-recursive | SEM (path-only OK) |
|
||||
|
||||
**기본값**: lavaan (R) 의 가장 mature → Python 만 시 semopy → fit indices 의 multiple report.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[Statistics]] · [[Multivariate-Analysis]]
|
||||
- 변형: [[Regression-Analysis-Foundations]] · [[Principal-Component-Analysis]]
|
||||
- 응용: [[Decision Theory]] · [[Knowledge-Structure]]
|
||||
- Adjacent: [[Standard-Deviation-and-Variance]] · [[Statistical-Power]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: model specification draft, fit-indices interpretation, mediation explanation, paper writing.
|
||||
**언제 X**: 매 estimation 자체 — lavaan/semopy 의 사용.
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **Modification indices 의 chase**: 매 fit 의 향상 의 위해 path 의 add → 매 capitalize on chance, theory 의 lost.
|
||||
- **Rejecting model on χ² alone**: 매 large n 의 χ² 의 always reject — 매 RMSEA, CFI 의 결합.
|
||||
- **Reflective vs formative confusion**: 매 wrong specification 의 estimate 의 bias.
|
||||
- **Causal claim from cross-sectional SEM**: 매 directional path 의 causal X — 매 longitudinal / experiment 의 필요.
|
||||
- **Underidentified model**: 매 df < 0 → 매 estimation impossible.
|
||||
- **n < 200 with many parameters**: 매 unstable — 매 Bayesian 의 권장.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (Kline *Principles and Practice of SEM*, lavaan docs, Hu & Bentler 1999 cutoffs).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — SEM components, fit, lavaan/semopy patterns. |
|
||||
|
||||
Reference in New Issue
Block a user