1 Youden Square
Latin Square 의 incomplete 버전. 행이 BIB 블록, 열이 어떤 일관된 패턴을 가짐.
\(v\) 처치, \(b = v\) 블록 (행), \(k\) cells/블록, \(r = k\) 열.
2 예시 — \(v = 7, k = 3\)
Col1 Col2 Col3
Row1: 1 2 4
Row2: 2 3 5
Row3: 3 4 6
Row4: 4 5 7
Row5: 5 6 1
Row6: 6 7 2
Row7: 7 1 3
각 행 (블록) 에 3 처치, 각 열에 모든 7 처치 정확히 1 번. BIB + 직교 열 통제.
표준 BIB 는 행 (블록) 만 통제. Youden square 는 행 + 열 둘 다 통제.
이는 시간 효과 (열 = 시점) 와 환자 효과 (행 = 환자) 를 모두 통제하는 임상 crossover 의 표준 형태.
3 분석
\[ Y_{ijl} = \mu + \tau_l + \beta_i + \gamma_j + \varepsilon_{ijl} \]
- \(\beta_i\): 행 (블록).
- \(\gamma_j\): 열.
- \(\tau_l\): 처치.
ANOVA: 처치 (BIB-adjusted), 행, 열, error.
| Source | \(df\) |
|---|---|
| Row (block) | \(b-1\) |
| Column | \(k-1\) |
| Treatment (adjusted) | \(v-1\) |
| Error | \(bk - b - k - v + 2\) |
| Total | \(bk - 1\) |
4 Lattice Design
처치 수 \(v = k^2\) 일 때의 incomplete block design.
- Square lattice: \(v = k^2\), blocks 의 group 으로 정렬.
- Triple lattice: 3 replicate 의 균형.
- Rectangular lattice: \(v = k(k+1)\).
5 \(v = 9 = 3^2\) Square Lattice
3×3 격자에 처치 1~9 배치:
1 2 3
4 5 6
7 8 9
블록 = 행 또는 열:
5.1 Replicate 1 (행 블록)
- Block 1: {1, 2, 3}
- Block 2: {4, 5, 6}
- Block 3: {7, 8, 9}
5.2 Replicate 2 (열 블록)
- Block 4: {1, 4, 7}
- Block 5: {2, 5, 8}
- Block 6: {3, 6, 9}
각 처치가 두 replicate 에 등장. 임의의 두 처치는 같은 행 또는 같은 열에 등장.
5.3 Triple Lattice (Replicate 3)
대각선 방향: - Block 7: {1, 5, 9} - Block 8: {2, 6, 7} - Block 9: {3, 4, 8}
3 replicate 모두 결합 → 모든 처치 쌍이 정확히 1 번 같이 등장 → BIB!
6 \(v = 16\) Square Lattice
\(4 \times 4\) 격자:
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
Replicate 1 (행): {1,2,3,4}, {5,6,7,8}, … Replicate 2 (열): {1,5,9,13}, {2,6,10,14}, … Replicate 3 (대각): {1,6,11,16}, {2,7,12,13}, … Replicate 4 (다른 대각): …
총 4 replicate, 모든 처치 쌍이 정확히 한 번 같이.
이는 PG(2, 4) 의 통계적 응용 — 21 처치, 21 블록의 변형.
7 가설 데이터 — Youden Square
7 약물, 7 환자 (행), 3 시점 (열).
시점1 시점2 시점3
환자1: A B D
환자2: B C E
환자3: C D F
환자4: D E G
환자5: E F A
환자6: F G B
환자7: G A C
분석: - 처치 효과 (BIB-adjusted). - 환자 효과 (행 random). - 시점 효과 (열 fixed).
Mixed model 로 자동 처리.
8 Python 코드
import numpy as np
import pandas as pd
import statsmodels.api as sm
from statsmodels.formula.api import ols, mixedlm
# Youden square — 7 처치, 7 행, 3 열
youden_pattern = [
[1, 2, 4], [2, 3, 5], [3, 4, 6], [4, 5, 7],
[5, 6, 1], [6, 7, 2], [7, 1, 3]
]
np.random.seed(2026)
treat_eff = {1: 5, 2: 8, 3: 3, 4: 10, 5: 6, 6: 4, 7: 7}
period_eff = {0: 0, 1: -2, 2: -4}
records = []
for r_idx, row in enumerate(youden_pattern):
row_eff = np.random.normal(0, 4)
for c_idx, t in enumerate(row):
y = (50 + treat_eff[t] + row_eff + period_eff[c_idx]
+ np.random.normal(0, 2))
records.append({"row": r_idx, "col": c_idx,
"treatment": t, "Y": y})
data = pd.DataFrame(records)
# Youden ANOVA
model = ols("Y ~ C(treatment) + C(row) + C(col)", data=data).fit()
print("=== Youden Square ANOVA ===")
print(sm.stats.anova_lm(model, typ=2).round(3))
# Mixed model (행 random)
md = mixedlm("Y ~ C(treatment) + C(col)", data=data, groups=data["row"]).fit()
print("\n=== Mixed Model ===")
print(md.summary().tables[1])
# Square Lattice — 9 처치, 3 replicate
print("\n=== Square Lattice (9 처치, 3 replicate) ===")
square_lattice = [
[1, 2, 3], [4, 5, 6], [7, 8, 9], # Rep 1 (행)
[1, 4, 7], [2, 5, 8], [3, 6, 9], # Rep 2 (열)
[1, 5, 9], [2, 6, 7], [3, 4, 8], # Rep 3 (대각)
]
# 검증: 모든 처치 쌍이 같이 등장하는 횟수
from itertools import combinations
from collections import Counter
pairs = []
for block in square_lattice:
for pair in combinations(block, 2):
pairs.append(tuple(sorted(pair)))
counter = Counter(pairs)
print(f"Pair counts: all = 1? {all(v == 1 for v in counter.values())}")9 가정과 한계
- 처치 수의 제약: \(v = k^2\) 또는 \(k(k+1)\).
- Replicate 수: 균형 위해 보통 2~5 replicates.
- 분석: BIB analysis 의 변형.
- Youden 의 행 random: 환자 random effect.
10 응용
10.1 1. Youden — 임상 Crossover
각 환자 (행) 가 일부 약물 (처치) 을 다른 시점 (열) 에 시험. 시점 효과 통제 + 환자 random.
10.2 2. Square Lattice — 농학
대규모 품종 시험. 각 plot 에 일부 품종만. 여러 replicate 로 균형.
10.3 3. 산업 — 다공정 평가
\(v = k^2\) 공정 조합. \(k\) 크기의 batch 로 분할.
10.4 4. ML — 모델 평가
\(v = 9\) 모델, 3 GPU 동시 평가. lattice design 으로 균형.
11 ML 매핑
ML 모델 비교에서 9 모델, 3 GPU 동시:
Replicate 1 (round 1): GPU에 모델 {1,2,3}, {4,5,6}, {7,8,9} 분배.
Replicate 2 (round 2): GPU에 {1,4,7}, {2,5,8}, {3,6,9}.
Replicate 3 (round 3): GPU에 {1,5,9}, {2,6,7}, {3,4,8}.
3 round 에 모든 모델 쌍이 정확히 한 번 같이 평가. 균형 systematic comparison.
12 본 시리즈
G-MON5-0 개관
G-MON5-1 BIB 도입
G-MON5-2 BIB Construction
G-MON5-3 BIB Analysis
G-MON5-4 Youden + Lattice ← 현재 글
G-MON5-5 PBIB
G-MON5-6 Recovery + Optimality
13 관련 주제
선행 지식
후속 주제
14 더 읽을 거리
- Youden, W. J. (1937). “Use of incomplete block replications in estimating tobacco-mosaic virus.” Contributions of the Boyce Thompson Institute 9: 41-48 — Youden 원조.
- Yates, F. (1936). “A new method of arranging variety trials involving a large number of varieties.” Journal of Agricultural Science 26: 424-455 — Lattice 원조.
- Cochran, W. G., Cox, G. M. (1957). “Experimental Designs” (2nd ed). Wiley.
- Pearce, S. C. (1983). “The Agricultural Field Experiment.” Wiley.