The Big Picture: How Good is Your Regression?
기초생각해보세요. Class size와 test score의 관계를 분석했다고 합시다. California에서 negative relationship을 발견했어요.
하지만 정말로 class size가 원인일까요? 아니면 다른 숨겨진 요인이 있을까요?
• 부유한 학군은 작은 class size + 더 좋은 교사?
• 작은 class는 문제아를 위한 특수반?
• Massachusetts에서도 같은 결과가 나올까?
이런 질문들이 바로 Internal Validity와 External Validity의 핵심입니다!
Causal Effect Estimation
X가 Y에 미치는 인과적 효과를 알고 싶다
예: 금연이 건강에 미치는 효과
Forecasting
미래의 Y값을 예측하고 싶다
예: 내일의 주가 예측
Description
데이터의 패턴을 요약하고 싶다
예: 소득과 소비의 관계
• Causal inference: Unbiasedness가 가장 중요 (OVB 피하기)
• Forecasting: $\bar{R}^2$가 중요, OVB는 문제없음!
• Description: 해석의 명확성이 중요
Internal and External Validity
중급1. Internal Validity (내적 타당성)
The statistical inferences about causal effects are valid for the population being studied.
→ 우리가 연구하는 이 집단에서 인과관계 추론이 맞는가?
2. External Validity (외적 타당성)
The statistical inferences can be generalized from the population and setting studied to other populations and settings.
→ 우리의 결과를 다른 집단에도 적용할 수 있는가?
Internal Validity 체크:
"California 학교에서 class size가 정말로 test score에 영향을 미치는가?"
- OVB는 없는가? (부모 소득, 영어 학습자 비율 등)
- Functional form은 올바른가? (linear? quadratic?)
- 측정 오차는 없는가?
External Validity 체크:
"California 결과를 다른 곳에 적용할 수 있는가?"
- Massachusetts: 비슷한 교육 시스템 → 아마 OK
- Korea: 다른 문화, 교육 시스템 → 조심!
- 1960년대: 시대가 다름 → 매우 조심!
비유: 고장난 체온계로 측정한 결과를 전 세계에 적용한다고 생각해보세요.
• Internal validity = 체온계가 정확한가?
• External validity = 이 체온계를 다른 병원에서도 쓸 수 있나?
체온계가 고장났다면 (no internal validity), 어디서 쓰든 의미없죠!
그래프 해석: External Validity의 증거
1. 패턴의 일관성:
- 두 주 모두에서 control variables 추가시 STR 계수가 작아짐 (빨간색 → 녹색)
- California: -2.28 → -0.73 (68% 감소)
- Massachusetts: -1.72 → -0.64 (63% 감소)
2. OVB의 존재:
- Simple regression은 부유한 학군의 작은 class size를 포착
- Controls (income, %EL 등) 추가로 진짜 효과 분리
- 여전히 negative & significant → class size 효과는 real!
3. External Validity 결론:
✓ 서로 다른 주에서 비슷한 패턴 → 결과를 일반화할 수 있음!
Threat #1: Omitted Variable Bias (OVB)
중급우리가 추정한 모델: 범죄율 = β₀ + β₁×아이스크림판매 + u
Omitted variable: 기온 (Temperature)
OVB 발생 조건 체크:
✓ 조건 1: 기온 → 범죄율 (더울 때 사람들이 밖에 많이 나옴)
✓ 조건 2: 기온 ↔ 아이스크림 (더울 때 아이스크림 많이 팜)
두 조건 모두 만족 → Spurious correlation!
Case 1: 교육 → 임금 (능력이 omitted)
- ✓ 조건 1: 능력 → 임금 (똑똑한 사람이 더 많이 벎)
- ✓ 조건 2: 능력 ↔ 교육 (똑똑한 사람이 대학 더 감)
- → OVB 발생! 교육의 효과 과대추정
Case 2: 운동 → 체중감소 (나이가 omitted?)
- ✓ 조건 1: 나이 → 체중 (나이들수록 살찌기 쉬움)
- ✗ 조건 2: 나이 ↔ 운동량? (명확하지 않음)
- → OVB 없을 수도! 조건 2가 약하면 bias 작음
Case 3: 스마트폰 사용 → 우울증 (수면시간이 omitted)
- ✓ 조건 1: 수면부족 → 우울증
- ✓ 조건 2: 수면시간 ↔ 스마트폰 (밤늦게 폰 보느라...)
- → OVB 발생! 스마트폰의 직접 효과 과대추정
NO! 항상 두 조건을 체크하세요:
1. Omitted → Y? (인과관계 있나?)
2. Omitted ↔ X? (상관관계 있나?)
하나만 만족하면 OVB 없음! 과도한 걱정 금물
OVB 판단 3단계
Step 1: 빠진 변수 Z를 찾아라
Step 2: Z → Y 관계가 있나? (없으면 STOP, no OVB)
Step 3: Z ↔ X 관계가 있나? (없으면 STOP, no OVB)
둘 다 YES? → OVB 발생! → 해결책 찾기
OVB를 해결하는 4가지 방법
Include the omitted variable
가능하다면 빠진 변수를 측정해서 포함시키기
예: 부모 소득 데이터를 구해서 regression에 추가
Panel Data
같은 개체를 여러 시점에 관찰 → time-invariant omitted variables 제거
예: 학교의 "문화"는 시간에 따라 변하지 않음
Instrumental Variables (IV)
X와는 관련있지만 u와는 무관한 도구변수 사용
Chapter 12에서 자세히 배웁니다
Randomized Controlled Experiment
X를 무작위 배정 → $E(u|X) = 0$ 자동으로 만족!
예: 학생을 무작위로 큰/작은 class에 배정
California (Table 8.3):
Simple regression: TestScore = 698.9 - 2.28×STR (R² = 0.05) With controls: TestScore = 700.2 - 0.73×STR + ... (R² = 0.77)
Massachusetts (Table 9.2):
Simple regression: TestScore = 739.6 - 1.72×STR (R² = 0.06) With controls: TestScore = 744.0 - 0.64×STR + ... (R² = 0.68)
관찰:
- Control 추가시 STR 계수가 작아짐 → OVB의 증거!
- 두 주에서 비슷한 패턴 → External validity 지지
- 하지만 여전히 significant → 효과가 real일 가능성
Other Threats to Internal Validity
고급Linear model을 썼는데 실제 관계가 nonlinear라면?
예시: Income과 TestScore
- Linear: 모든 income level에서 같은 효과
- Reality: Diminishing returns (수확체감)
해결책:
- Polynomials, logarithms, interactions 사용
- Binary dependent variable → Probit/Logit (Ch. 11)
측정 모델: $Y_i = \beta_0 + \beta_1 \tilde{X}_i + \tilde{u}_i$ ($\tilde{X}$ = measured value)
이때 새로운 error term: $\tilde{u}_i = \beta_1(X_i - \tilde{X}_i) + u_i$
문제: $\tilde{X}_i$와 $\tilde{u}_i$가 correlated! → $\hat{\beta}_1$ is biased!
현실 예시:
- 설문조사: "작년 소득이 얼마였나요?" (기억 오류)
- 자기보고: "일주일에 술을 얼마나 마시나요?" (과소보고)
- STR: district 평균 vs 실제 학생이 경험한 class size
Sample selection process가:
- 데이터 가용성에 영향을 미치고
- dependent variable과 관련이 있을 때
1. Mutual Fund Performance
살아남은 펀드만 분석 → Survivorship bias!
- 실패한 펀드는 데이터에서 사라짐
- Active management가 과대평가됨
2. Returns to Education
취업자만 분석 → 교육 수익률 bias
- 실업자는 임금 데이터 없음
- 고학력 실업자 제외 → 수익률 과대평가
X → Y 뿐만 아니라 Y → X도 존재할 때!
큰 $u_i$ → 큰 $Y_i$ → 큰 $X_i$ (if $\gamma_1 > 0$)
따라서 $\text{corr}(X_i, u_i) \neq 0$ → $\hat{\beta}_1$ is biased!
• Low test scores → 정치적 압력 → 더 많은 자원 투입 → Lower STR
• 결과: STR과 negative error term이 correlated!
• True effect를 underestimate할 가능성
그래프 해석: 각 Threat이 추정치에 미치는 영향
1. Positive Bias (빨간색 막대):
- OVB: 예) 능력↑ → 교육↑ & 임금↑ → 교육 효과 과대추정
- Sample Selection: 예) 성공한 mutual fund만 분석 → 수익률 과대추정
- Wrong Form: 예) Nonlinear를 linear로 → 평균 효과만 포착
2. Negative Bias (파란색 막대):
- Measurement Error: Classical errors-in-variables → attenuation bias (0쪽으로)
- Simultaneity: 예) 나쁜 성적 → 더 많은 자원 → STR 효과 과소추정
3. 중요한 통찰:
• Bias의 방향과 크기는 specific context에 따라 다름
• 여러 threats가 동시에 존재할 수 있음 (상쇄 or 증폭)
• 해결책이 있다! Panel data는 time-invariant OVB 제거
Panel Data: A Powerful Solution
중급비유: 한 학생의 성적을 한 번만 보는 것 vs 4년간 매 학기 보는 것
• Cross-section: 2025년 모든 학생의 성적 (한 시점)
• Time series: 한 학생의 2022-2025 성적 (여러 시점)
• Panel: 모든 학생의 2022-2025 매 학기 성적 (둘 다!)
핵심 아이디어: 시간에 따라 변하지 않는 개체의 특성이 있다면, 시간에 따른 변화를 봄으로써 그 특성의 영향을 제거할 수 있습니다!
Double subscript로 표현:
- $i$ = entity (개체: 주, 학교, 사람, 회사)
- $t$ = time period (시점: 년, 분기, 월)
- $n$ = number of entities
- $T$ = number of time periods
예: 48개 주 × 7년 = 336 observations
놀라운 Cross-sectional 결과:
1982: FatalityRate = 2.01 + 0.15×BeerTax (not significant) 1988: FatalityRate = 1.86 + 0.44×BeerTax (t = 3.43***)
높은 맥주세 → 더 많은 교통사고?! 😱
Omitted variables ($Z_i$):
• 인구 밀도 (density)
• 음주 문화 (culture)
• 도로 품질 (road quality)
• 자동차 나이 (car age)
높은 세금 지역 = 도시 지역 = 높은 교통 밀도 = 더 많은 사고!
Panel Data의 핵심 아이디어
If an omitted variable does not change over time,
then any changes in Y over time cannot be caused by the omitted variable!
시간에 따라 변하지 않는 변수는 시간에 따른 변화를 설명할 수 없다!
Panel Data with Two Time Periods
고급모델:
여기서 $Z_i$는 시간에 따라 변하지 않는 주(state)의 특성
The Magic of Differencing:
1988년:
$\text{FatalityRate}_{i,1988} = \beta_0 + \beta_1 \text{BeerTax}_{i,1988} + \beta_2 Z_i + u_{i,1988}$
1982년:
$\text{FatalityRate}_{i,1982} = \beta_0 + \beta_1 \text{BeerTax}_{i,1982} + \beta_2 Z_i + u_{i,1982}$
차이 (1988 - 1982):
$\Delta \text{FatalityRate}_i = \beta_1 \Delta \text{BeerTax}_i + \Delta u_i$
🎉 $Z_i$ disappeared! No more OVB from time-invariant factors! 🎉
Cross-sectional regressions:
1982: FatalityRate = 2.01 + 0.15×BeerTax (양의 관계) 1988: FatalityRate = 1.86 + 0.44×BeerTax (양의 관계)
Difference regression:
ΔFatalityRate = -0.072 - 1.04×ΔBeerTax (음의 관계!)
해석:
- 맥주세 $1 증가 → 교통사고 사망률 1.04 감소 (per 10,000)
- 평균 사망률이 2이므로, 거의 50% 감소!
- Time-invariant OVB 제거 후 진짜 효과가 드러남
철수의 성적 = 노력 + 타고난 지능 + 오차
영희의 성적 = 노력 + 타고난 지능 + 오차
철수와 영희를 비교하면 "타고난 지능"의 차이가 섞여있어요.
하지만!
철수의 2학기 성적 - 철수의 1학기 성적 = (노력의 변화) + (오차의 변화)
"타고난 지능"은 변하지 않으므로 사라집니다! 순수하게 노력의 변화가 성적 변화에 미친 영향만 볼 수 있죠.
그래프 해석: Panel Data의 극적인 효과
1. Cross-sectional Results (양의 관계 - 잘못된 결론):
- 1982 (빨간선): 기울기 = +0.15 (not significant)
- 1988 (주황선): 기울기 = +0.44 (highly significant***)
- 해석: "맥주세가 높을수록 교통사고가 많다?!" 😱
2. 숨겨진 OVB의 정체:
• 도시 주: 높은 인구밀도 + 높은 세금 + 많은 사고
• 시골 주: 낮은 인구밀도 + 낮은 세금 + 적은 사고
→ 세금과 사고의 spurious positive correlation!
3. Panel Data Results (음의 관계 - 진짜 효과):
- Differenced (녹색선): 기울기 = -1.04 (highly significant***)
- 같은 주 내에서 세금 변화 → 사고율 변화
- Time-invariant factors (인구밀도, 문화 등) 자동 제거!
4. 경제적 의미:
맥주세 $1 증가 → 교통사고 사망률 1.04 감소 (per 10,000)
• 평균 사망률이 2이므로 약 50% 감소 효과!
• 진짜 인과관계: 세금↑ → 음주↓ → 음주운전↓ → 사고↓
🎯 Panel Data가 없었다면 완전히 반대의 정책을 만들 뻔했습니다!
Practice Problems
실전Consider the wage equation with race interactions:
$\ln(\widehat{salary}) = 10.34 - 0.198 \cdot black - 0.190 \cdot hispan + 0.0125 \cdot black \times percblck + 0.0201 \cdot hispan \times perchisp + \text{other factors}$
(a) Interpret the coefficient on $black$.
(b) What is the salary difference between black and white players in a city with 10% black population?
(c) At what percentage of black population does the racial gap disappear?
(a) Interpretation:
If a Black player is in a city with 0% black population, they earn 19.8% less than a comparable white player. 이는 black과 white regression line의 y-intercept 차이입니다.
(b) 10% black population에서의 차이:
$\ln(salary)$ difference = $-0.198 + 0.0125(10) = -0.073$
→ Black players earn about 7.3% less than whites
(c) Racial gap이 0이 되는 지점:
Set $-0.198 + 0.0125 \times percblck = 0$
$percblck = 0.198/0.0125 = 15.84\%$
→ 15.84% black population에서 racial gap disappears!
Identify the threat to internal validity in each scenario:
(a) Chelsea notes that you need a job to get a wage.
(b) Dwaine notes that if you have a high wage, you can pay for more schooling.
(c) STR is measured at the district level, but students may experience different class sizes.
(d) The wage model omits ability, which affects both education and wages.
(a) Sample selection bias
실업자는 임금 데이터가 없음 → non-random sample
(b) Simultaneous causality bias
Education → Wage 뿐만 아니라 Wage → Education도 가능
(c) Errors-in-variables bias
District average STR ≠ 실제 학생이 경험한 class size
(d) Omitted variable bias
Ability는 education과 wage 둘 다에 영향 → classic OVB
Consider the airline fare regression from the exam:
$\log(fare_{it}) = \vartheta_t + \beta_1 concen_{it} + \beta_2 \log(dist_i) + \beta_3[\log(dist_i)]^2 + \alpha_i + u_{it}$
Simple OLS: $\hat{\beta}_1 = -0.492$ (higher concentration → lower fares?!)
Fixed Effects: $\hat{\beta}_1 = +0.103$ (higher concentration → higher fares)
(a) Why are the results so different?
(b) Do any of the models control for distance? Why?
(c) What does the fixed effect $\alpha_i$ capture?
(a) OVB in simple OLS:
Route characteristics ($\alpha_i$)가 omitted:
- Popular routes: high competition (low concentration) + high demand (high fares)
- 이로 인해 concentration과 fare가 spuriously negative
- Fixed effects로 route characteristics 통제 후 true positive relationship 발견
(b) Distance control:
Fixed effects model은 자동으로 distance를 control합니다!
이유: $dist_i$는 route-specific이지만 time-invariant
→ $\alpha_i$에 흡수됨
(c) $\alpha_i$ captures:
- Route popularity (business vs leisure)
- Airport quality/convenience
- Geographic factors
- Any time-invariant route characteristics
"America's Most Wanted" TV show의 효과를 연구한다고 합시다.
• Y = length of spell (체포까지 걸린 시간)
• X = appearance on TV show (175/1200 fugitives)
Internal validity threats를 평가하세요:
(a) 어떤 omitted variables가 있을까요?
(b) Sample selection bias 가능성은?
(c) Simultaneous causality 문제는?
(d) 이 연구 결과를 다른 TV show에 적용할 수 있나요? (External validity)
(a) Omitted variables:
- Crime severity: 더 심각한 범죄 → TV 출연 가능성↑ + 더 적극적 수사
- Fugitive characteristics: 위험도, 도주 능력, 범죄 경력
- Law enforcement resources: 지역별 경찰력 차이
- Media coverage beyond the show: 다른 미디어 노출
- Reward amount: 현상금 액수
(b) Sample selection bias:
- • Only "wanted" fugitives in sample (이미 도망친 사람들)
- • 즉시 잡힌 범죄자는 데이터에서 제외
- • Show producers가 "newsworthy" fugitives 선택
- • 결과: 평균적인 범죄자보다 잡기 어려운 사람들만 분석
(c) Simultaneous causality:
Forward causation: TV show → 시민 제보↑ → 체포 확률↑ ✓
Reverse causation: 오래 도망 → "interesting case" → TV 선택 ✗
→ 오래 도망친 fugitives가 overrepresented → bias!
(d) External validity 제한:
| 요인 | External Validity 영향 |
|---|---|
| Show 인기도 | 다른 show는 시청률 다름 |
| 방송 시간 | 토요일 9pm의 특수성 |
| 국가/문화 | 시민 협조 문화 차이 |
| 기술 발전 | Social media 시대는 다름 |
💡 Key Insight: 이 연구는 모든 5가지 threats를 갖고 있습니다! 좋은 연구 설계는 이런 문제들을 사전에 고려해야 합니다.
Regression 결과를 얻었다고 끝이 아닙니다. 항상 물어보세요:
1. Internal validity: 이 결과를 인과관계로 해석할 수 있나?
→ 5가지 threats 체크!
2. External validity: 다른 상황에도 적용 가능한가?
→ Population과 setting 고려!
3. Panel data의 힘: Time-invariant OVB를 제거할 수 있나?
→ 같은 개체의 시간 변화 활용!
좋은 econometrician은 항상 회의적이어야 합니다! 🤔
핵심 요약
Exam 2를 위한 필수 개념
Internal vs External Validity
• Internal: 이 집단에서 인과관계가 valid한가?
• External: 다른 집단에도 generalize 가능한가?
• Internal validity 없이는 external validity 무의미!
Five Threats to Internal Validity
• OVB: 두 조건 모두 만족해야 발생
• Wrong functional form: Nonlinear methods로 해결
• Errors-in-variables: $\tilde{X}$와 $\tilde{u}$ correlated
• Sample selection: Non-random sample
• Simultaneous causality: X↔Y
Panel Data Magic
• Key idea: Time-invariant factors can't explain time variation
• Two periods: Simple differencing eliminates $Z_i$
• Notation: $Y_{it}$ where $i$ = entity, $t$ = time
• Beer tax example: Cross-section (+) → Panel (−)!
Solutions to Threats
• OVB: Include variable, panel data, IV, RCT
• Wrong form: Try polynomials, logs, interactions
• Measurement error: Better data, IV
• Selection: Better sampling, model selection
• Simultaneity: RCT, IV, structural model
📊 Chart 1: External Validity (CA vs MA)
• 두 주 모두 control 추가시 계수 60%+ 감소 → OVB 존재
• 패턴이 유사 → External validity 지지
• 여전히 negative & significant → 진짜 효과
📊 Chart 2: Five Threats Impact
• True effect = 0.5 (녹색 점선)
• OVB와 Selection → 과대추정 (빨간 막대)
• Measurement error → 과소추정 (파란 막대)
• 여러 threats 동시 존재 가능 → 복잡한 bias
📊 Chart 3: Panel Data Magic
• Cross-section: (+) 관계 → "세금↑ = 사고↑" (말도 안됨!)
• Panel/Difference: (−) 관계 → "세금↑ = 사고↓" (makes sense!)
• 극적인 반전: +0.44 → −1.04
• 교훈: Wrong method = Wrong policy!
"그래프는 숫자가 말하는 이야기를 보여줍니다.
항상 패턴, 이상치, 그리고 숨겨진 의미를 찾으세요!"
✓ 5가지 threats 구별하고 해결책 제시하기
✓ California vs Massachusetts 비교 이해
✓ Panel data differencing 계산 연습
✓ Beer tax example의 dramatic reversal 이해
✓ Interaction terms in race/salary 해석
✓ 각 threat의 수식적 표현 암기
✓ "Always question your regression!"