Polynomial Regression
중요도: 높음예를 들어, 공부 시간과 시험 점수의 관계를 생각해보세요. 처음에는 공부할수록 점수가 빠르게 오르지만, 어느 순간부터는 추가 공부의 효과가 줄어듭니다. 10시간에서 11시간으로 늘리는 것보다 1시간에서 2시간으로 늘리는 것이 더 효과적이죠!
이런 diminishing returns (수확체감)이나 increasing returns (수확체증)을 포착하려면 곡선이 필요합니다.
1. Linear (1차)
가장 단순한 형태. 직선 관계를 가정합니다.
2. Quadratic (2차)
U자형 또는 역U자형 곡선. 하나의 turning point를 가집니다.
3. Cubic (3차)
S자형 곡선 가능. 최대 두 개의 turning points를 가질 수 있습니다.
어떤 모델을 선택해야 할까? 가설 검정!
Linear vs Quadratic
Null hypothesis: $H_0: \beta_2 = 0$
Alternative: $H_1: \beta_2 \neq 0$
Test: t-test on $\beta_2$
Reject → Quadratic가 더 적합
Quadratic vs Cubic
Null hypothesis: $H_0: \beta_3 = 0$
Alternative: $H_1: \beta_3 \neq 0$
Test: t-test on $\beta_3$
Reject → Cubic이 더 적합
Linear vs Cubic (Quadratic 건너뛰기)
Null hypothesis: $H_0: \beta_2 = \beta_3 = 0$
Alternative: $H_1: \beta_2 \neq 0$ or $\beta_3 \neq 0$
Test: F-test (joint significance)
Reject → Cubic이 더 적합
Quadratic regression에서 최대값 또는 최소값이 되는 X의 값을 찾는 것은 시험 단골 문제입니다!
Step 1: 도함수 구하기
Step 2: 0으로 놓고 풀기
Step 3: X* 구하기
해석:
- $\beta_2 > 0$: U자형 (최소값)
- $\beta_2 < 0$: 역U자형 (최대값)
Logarithmic Transformations
중요도: 높음예시: 월급이 $100 증가한다고 생각해보세요.
• 최저임금 근로자 (월 $2,000): 5% 인상 → 큰 변화!
• 고소득자 (월 $10,000): 1% 인상 → 작은 변화
절대적 변화보다 상대적 변화(%)가 더 의미있을 때 log를 사용합니다!
세 가지 Log Model 완벽 정리
Linear-Log Model
Specification: $Y = \beta_0 + \beta_1 \ln(X) + u$
Interpretation:
예시: Income과 TestScore
$\hat{\beta}_1 = 36.42$ → Income 1% ↑ → TestScore 0.36점 ↑
Log-Linear Model
Specification: $\ln(Y) = \beta_0 + \beta_1 X + u$
Interpretation:
예시: Education과 Wage
$\hat{\beta}_1 = 0.08$ → Education 1년 ↑ → Wage 8% ↑
Log-Log Model (Elasticity)
Specification: $\ln(Y) = \beta_0 + \beta_1 \ln(X) + u$
Interpretation:
특징: $\beta_1$ = elasticity!
단위 무관 (unit-free) → 국제 비교에 유용
• 1% 변화: 매우 정확
• 10% 변화: 대략적으로 정확
• 50% 변화: 부정확 (exact calculation 필요)
어떤 모델인지 헷갈린다면, Y와 X의 형태를 보세요!
- Linear-Log: From log(%) To linear(units)
- Log-Linear: From linear(units) To log(%)
- Log-Log: From log(%) To log(%)
Interaction Variables
중요도: 매우 높음실생활 예시:
• 커피와 설탕: 커피를 좋아하는 사람에게는 설탕이 만족도를 높이지만, 커피를 싫어하는 사람에게는 설탕을 넣어도 소용없죠.
• 교육과 경험: 고학력자일수록 경험의 가치가 더 클 수 있습니다.
• 운동과 식단: 운동의 효과는 식단 관리를 함께 하느냐에 따라 달라집니다.
세 가지 Interaction Types
Binary × Binary (Dummy × Dummy)
목적: 4개 그룹 비교
Model: $Y = \beta_0 + \beta_1 D_1 + \beta_2 D_2 + \beta_3 (D_1 \times D_2) + u$
예시: Female × Married in wage regression
| Single | Married | |
|---|---|---|
| Male | $\beta_0$ | $\beta_0 + \beta_2$ |
| Female | $\beta_0 + \beta_1$ | $\beta_0 + \beta_1 + \beta_2 + \beta_3$ |
Binary × Continuous (Dummy × X)
목적: 그룹별로 다른 slope
Model: $Y = \beta_0 + \beta_1 D + \beta_2 X + \beta_3 (D \times X) + u$
예시: Female × Education
• Males: $Y = \beta_0 + \beta_2 X$
• Females: $Y = (\beta_0 + \beta_1) + (\beta_2 + \beta_3) X$
→ Intercept와 Slope 모두 다름!
Continuous × Continuous (X₁ × X₂)
목적: 한 변수의 효과가 다른 변수 수준에 따라 변함
Model: $Y = \beta_0 + \beta_1 X_1 + \beta_2 X_2 + \beta_3 (X_1 \times X_2) + u$
Marginal Effects:
• $\frac{\partial Y}{\partial X_1} = \beta_1 + \beta_3 X_2$
• $\frac{\partial Y}{\partial X_2} = \beta_2 + \beta_3 X_1$
→ 더 이상 "holding constant" 불필요!
• Interaction이 있으면 main effects도 반드시 포함!
• 계수 해석 시 직접 효과와 interaction 효과 모두 고려
• Multicollinearity로 인해 individual t-test보다 F-test가 더 신뢰할 만함
Assessing Regression Studies
중요도: 높음1. Internal Validity (내적 타당성)
"우리가 연구한 모집단에 대한 추론이 타당한가?"
- 목표 1: Unbiased & consistent $\hat{\beta}$
- 목표 2: Accurate standard errors
2. External Validity (외적 타당성)
"다른 상황/모집단에도 적용 가능한가?"
- 다른 시간대
- 다른 지역
- 다른 집단
Threats to Internal Validity (Endogeneity)
LSA #1 violation: $E(u|X) \neq 0$ → $X$ is endogenous → $\hat{\beta}$ is biased!
Omitted Variable Bias
Problem: Important variable이 빠짐
Solution: Multiple regression, Panel data FE
예시: Ability in education-wage regression
Wrong Functional Form
Problem: Linear model for nonlinear relationship
Solution: Polynomials, Logs, Interactions
예시: Income-TestScore는 실제로 nonlinear
Sample Selection Bias
Problem: Non-random sample
Solution: Heckman correction, IV
예시: Wage regression에서 unemployed 제외
Simultaneous Causality
Problem: X→Y and Y→X
Solution: IV, Natural experiments
예시: Police ↔ Crime
Measurement Error
Problem: Data collection errors
Solution: Better data, IV
예시: Self-reported income
1. Heteroskedasticity
문제: $Var(u|X)$ is not constant
해결: Robust standard errors
STATA: reg y x, robust
2. Autocorrelation (Serial Correlation)
문제: $Corr(u_t, u_{t-1}) \neq 0$
해결: HAC standard errors
STATA: xtreg y x, fe vce(cluster id)
Panel Data Methods
중요도: 매우 높음예시: 주별 교통사고 사망률과 맥주세의 관계
• Cross-section: 문화, 지형 등이 omitted → bias!
• Panel data: 시간에 따라 변하지 않는 주별 특성 제거 가능
마치 "같은 사람의 before-after"를 비교하는 것과 같습니다!
Panel data = Cross-section (i) × Time-series (t)
Where:
- $Z_i$: Entity-specific, time-invariant (주의 문화)
- $S_t$: Time-specific, entity-invariant (전국적 정책)
Fixed Effects Methods
Entity Fixed Effects (Within Estimator)
제거하는 것: $Z_i$ (time-invariant omitted variables)
방법 1: Entity demeaning
방법 2: (n-1) entity dummies
STATA: xtreg y x, fe
Time Fixed Effects
제거하는 것: $S_t$ (entity-invariant omitted variables)
방법: (T-1) time dummies
STATA: reg y x i.year
Two-way Fixed Effects
제거하는 것: Both $Z_i$ and $S_t$
STATA: xtreg y x i.year, fe vce(cluster id)
→ 가장 conservative하고 믿을 만한 추정!
1982년과 1988년 데이터만 있다고 가정:
First-difference approach:
$(Y_{88} - Y_{82}) = \beta_1 (X_{88} - X_{82}) + (u_{88} - u_{82})$
$Z_i$가 사라짐! (∵ $Z_{i,88} = Z_{i,82}$)
이것이 fixed effects의 핵심 아이디어입니다!
Binary Dependent Variables
중요도: 매우 높음Linear model의 문제점:
• 예측값이 1보다 클 수 있음 (120% 확률?)
• 예측값이 0보다 작을 수 있음 (-20% 확률?)
Probit/Logit은 S자 곡선으로 확률을 0과 1 사이로 제한합니다!
중요: $\hat{Y} = \Pr(Y=1|X)$ (예측값 = 확률)
1. Linear Probability Model (LPM)
• 장점: 해석이 쉬움 ($\beta_1$ = percentage point change)
• 단점: 확률이 [0,1] 벗어날 수 있음
2. Probit Model
where $\Phi$ = standard normal CDF
3. Logit Model
• 계수의 부호(+/-)와 유의성만 직접 해석 가능
• 크기는 직접 해석 불가 → marginal effect 계산 필요
• 특정 X 값에서 계산해야 함 (보통 평균값 사용)
Y = Deny (1 if denied, 0 if approved)
Key X = Black (1 if Black, 0 otherwise)
Control = P/I ratio (payment to income)
LPM Results:
$\widehat{Deny} = 0.091 + 0.177 \times Black + 0.559 \times PIratio$
→ Black applicants: 17.7 percentage points higher denial rate
Probit: Marginal Effect 계산
평균 P/I ratio = 0.33에서:
• Black=1: $\Pr(Deny) = \Phi(-2.26 + 0.71 + 2.97 \times 0.33) = 0.233$
• Black=0: $\Pr(Deny) = \Phi(-2.26 + 2.97 \times 0.33) = 0.075$
→ Difference = 15.8 percentage points
Measures of Fit
Pseudo R²
Log-likelihood 기반 (0~1)
해석: OLS R²와 유사하지만 직접 비교는 불가
Fraction Correctly Predicted
예측 정확도 (보통 0.5 cutoff 사용)
| Actual Y=0 | Actual Y=1 | |
|---|---|---|
| Predict 0 | ✓ Correct | ✗ Type II |
| Predict 1 | ✗ Type I | ✓ Correct |
Practice Problems - Exam Style
실전 연습Consider the model: $Y = \beta_0 + \beta_1 X + \beta_2 X^2 + u$
Estimates: $\hat{\beta}_0 = 20$, $\hat{\beta}_1 = 8$, $\hat{\beta}_2 = -0.5$
(a) What type of curve is this? (U-shape or inverted U-shape?)
(b) Find the value of X that maximizes/minimizes Y.
(c) Calculate the marginal effect of X when X = 5.
(d) Test if the quadratic term is needed at 5% level if SE($\hat{\beta}_2$) = 0.2
(a) Curve type:
Since $\beta_2 = -0.5 < 0$, this is an inverted U-shape (maximum point exists)
(b) Finding X*:
Take derivative and set to zero:
$\frac{dY}{dX} = \beta_1 + 2\beta_2 X = 8 + 2(-0.5)X = 8 - X = 0$
$X^* = 8$
(c) Marginal effect at X = 5:
$\frac{dY}{dX}\bigg|_{X=5} = 8 - 1(5) = 3$
해석: X = 5에서 X가 1 단위 증가하면 Y는 약 3 단위 증가
(d) Testing quadratic term:
$H_0: \beta_2 = 0$ vs $H_1: \beta_2 \neq 0$
$t = \frac{-0.5 - 0}{0.2} = -2.5$
$|t| = 2.5 > 1.96$ → Reject $H_0$ at 5% level
결론: Quadratic term이 필요함
Three wage regressions are estimated:
Model A: $Wage = 10 + 2.5 \times Educ$
Model B: $\ln(Wage) = 2.3 + 0.09 \times Educ$
Model C: $\ln(Wage) = 1.5 + 0.8 \times \ln(Educ)$
(a) Interpret the coefficient on education in each model.
(b) For Model B, what is the exact wage increase for 4 more years of education?
(c) Which model assumes constant elasticity?
(a) Interpretations:
- Model A (Linear-Linear): 1 year ↑ education → $2.50 ↑ wage
- Model B (Log-Linear): 1 year ↑ education → 9% ↑ wage
- Model C (Log-Log): 1% ↑ education → 0.8% ↑ wage (elasticity = 0.8)
(b) Exact calculation for Model B:
4 more years: $\Delta \ln(Wage) = 0.09 \times 4 = 0.36$
Exact percentage increase: $e^{0.36} - 1 = 1.433 - 1 = 0.433 = 43.3\%$
(Approximation would give 36%, 실제는 43.3%!)
(c) Constant elasticity:
Model C (Log-Log model)는 constant elasticity를 가정합니다.
Elasticity = 0.8로 education level에 관계없이 일정
Wage regression with interaction:
$\ln(Wage) = 1.2 + 0.10 \times Educ + 0.05 \times Exper - 0.20 \times Female - 0.02 \times (Female \times Educ)$
(a) Write separate wage equations for males and females.
(b) Calculate the return to education for each gender.
(c) At what education level do male and female wages become equal (holding experience constant)?
(d) Test if education has the same effect for both genders (SE of interaction = 0.008).
(a) Separate equations:
Males (Female = 0):
$\ln(Wage) = 1.2 + 0.10 \times Educ + 0.05 \times Exper$
Females (Female = 1):
$\ln(Wage) = (1.2 - 0.20) + (0.10 - 0.02) \times Educ + 0.05 \times Exper$
$= 1.0 + 0.08 \times Educ + 0.05 \times Exper$
(b) Return to education:
- Males: 10% per year
- Females: 8% per year
- Gender gap: 2 percentage points
(c) Equal wages point:
Set male = female equation:
$1.2 + 0.10 \times Educ = 1.0 + 0.08 \times Educ$
$0.2 = -0.02 \times Educ$
$Educ = 10$ years
(d) Test equal effects:
$H_0: \beta_{Female \times Educ} = 0$
$t = -0.02/0.008 = -2.5$
$|t| = 2.5 > 1.96$ → Reject at 5% level
결론: Education의 효과가 성별에 따라 유의하게 다름
Airfare regression using route-level panel data (1997-2000):
Pooled OLS: $\ln(fare) = 5.40 - 0.49 \times concen$
Fixed Effects: $\ln(fare) = 5.03 + 0.10 \times concen$
where concen = market concentration (higher = less competition)
(a) Interpret both coefficients.
(b) Why are the results so different?
(c) Which estimate is more credible and why?
(d) What types of omitted variables does FE control for?
(a) Interpretations:
- Pooled OLS: 1 percentage point ↑ concentration → 49% ↓ fare
- Fixed Effects: 1 percentage point ↑ concentration → 10% ↑ fare
(b) 차이의 원인:
Pooled OLS는 omitted variable bias를 가지고 있습니다!
• 경쟁이 적은 노선 = 보통 수요가 적은 노선
• 수요가 적으면 → 가격도 낮음
• Route characteristics가 omitted → negative bias
(c) 더 신뢰할 만한 추정:
Fixed Effects가 더 credible!
• 같은 노선 내에서의 변화만 이용
• Time-invariant route characteristics 제거
• 경제 이론과도 일치 (독점 → 높은 가격)
(d) FE가 control하는 변수들:
- Route distance (시간에 따라 변하지 않음)
- Airport quality
- Business vs tourist routes
- Geographic factors
Employment study with alcohol dependency:
LPM: $Employed = 0.78 - 0.12 \times AlcDep + 0.027 \times Educ$
Probit coefficients: $\hat{\beta}_0 = -0.31$, $\hat{\beta}_{AlcDep} = -0.40$, $\hat{\beta}_{Educ} = 0.096$
For someone with 12 years of education:
(a) Using LPM, what is the effect of alcohol dependency?
(b) Using Probit, calculate probabilities for AlcDep = 0 and AlcDep = 1.
(c) What is the marginal effect in the Probit model?
(d) Why might the effects differ between models?
(a) LPM effect:
직접 계수 해석: -0.12 = 12 percentage points lower employment probability
(b) Probit probabilities:
For Educ = 12:
• AlcDep = 0: $z = -0.31 + 0 + 0.096(12) = 0.842$
$\Pr(Emp) = \Phi(0.842) = 0.80$
• AlcDep = 1: $z = -0.31 - 0.40 + 0.096(12) = 0.442$
$\Pr(Emp) = \Phi(0.442) = 0.67$
(c) Probit marginal effect:
$0.67 - 0.80 = -0.13$ = 13 percentage points
(d) 차이의 이유:
- LPM: Constant marginal effect (항상 -12%p)
- Probit: Marginal effect는 X 값에 따라 달라짐
- Average에서는 비슷하지만 (12 vs 13%p), extremes에서는 차이 큼
✓ 세 가지 log model 해석을 완벽히 암기했나요?
✓ Interaction이 있을 때 separate equations 쓸 수 있나요?
✓ Panel data FE가 무엇을 제거하는지 이해했나요?
✓ Probit에서 marginal effect 계산할 수 있나요?
Remember:
• 계산 과정을 모두 보여주세요 (partial credit!)
• 해석할 때 단위를 명시하세요
• 가설 검정은 5 단계로 (H₀, H₁, test stat, decision, conclusion)