Why Nonlinear Regression?
기초지금까지 우리가 배운 모든 것은 linear in the X's였습니다:
하지만 linear approximation이 항상 좋은 것은 아닙니다!
• Constant slope 가정: X가 1 단위 증가할 때 Y에 미치는 효과가 항상 동일
• 현실에서는 marginal effect가 변하는 경우가 많음
• Functional form이 잘못되면 estimator에 bias 발생
커피를 마시는 것으로 비유해보겠습니다:
• 첫 번째 커피 한 잔: 졸음이 확 깨고 집중력이 크게 향상됩니다 (큰 효과)
• 두 번째 커피 한 잔: 조금 더 각성되지만 첫 잔만큼은 아닙니다 (중간 효과)
• 다섯 번째 커피 한 잔: 오히려 심장이 두근거리고 집중이 안 됩니다 (작은/부정적 효과)
마찬가지로 학군의 소득과 시험 점수의 관계도:
• 가난한 학군 (\$10,000 → \$15,000): 기본 교재, 컴퓨터 구입 → 큰 점수 향상
• 중산층 학군 (\$30,000 → \$35,000): 추가 프로그램 → 중간 정도 향상
• 부유한 학군 (\$50,000 → \$55,000): 이미 충분한 자원 → 거의 효과 없음
실제 데이터를 보면:
TestScore vs STR (Student-Teacher Ratio):
$\widehat{TestScore} = 698.9 - 2.28 \times STR$
→ 거의 선형 관계처럼 보임 (maybe...)
TestScore vs Income:
→ 명백한 nonlinear relationship!
→ 선형 모델로 추정하면 저소득 지역에서는 효과를 과소평가, 고소득 지역에서는 과대평가
여기서 $f$는 어떤 nonlinear function이든 가능합니다. 하지만 중요한 가정들은 여전히 필요합니다:
| 가정 | 수식 | 의미 |
|---|---|---|
| Exogeneity | $E(u_i | X_{1i}, ..., X_{ki}) = 0$ | 오차항이 X들과 독립적 |
| i.i.d. | $(X_{1i}, ..., X_{ki}, Y_i)$ are i.i.d. | 관측치들이 독립적이고 동일 분포 |
| No outliers | Big outliers are rare | 극단값이 드물어야 함 |
| No multicollinearity | No perfect multicollinearity | 완벽한 선형관계 없음 |
핵심 원칙: The Expected Effect (After-Before Approach)
Population에서의 효과
X가 변할 때 Y의 expected change:
다른 변수들은 고정하고 $X_1$만 변화시킬 때의 효과
Sample에서의 추정
추정된 효과:
이것이 우리가 실제로 계산하는 값
Figure 8.1의 세 가지 경우를 시각화
Polynomial Regression Functions
중급이것의 가장 중요한 특징:
• Nonlinear in X, but linear in parameters (β's)
• 따라서 OLS로 추정 가능!
• 새로운 변수 $X^2, X^3$ 등을 만들어서 multiple regression
Model: $TestScore_i = \beta_0 + \beta_1 Income_i + \beta_2 Income_i^2 + u_i$
STATA 구현:
generate avginc2 = avginc*avginc /* Create squared term */
reg testscr avginc avginc2, robust /* Run regression with robust SE */
추정 결과:
가설 검정:
Null hypothesis: $H_0: \beta_2 = 0$ (선형 관계)
Alternative: $H_1: \beta_2 \neq 0$ (quadratic 관계)
Test statistic:
$t = \frac{-0.0423}{0.0048} = -8.85$
결론: |t| = 8.85 > 2.58 → Reject $H_0$ at 1% level!
→ Quadratic specification이 통계적으로 유의하게 더 적합
잘못된 해석: "Income이 1 증가하면 TestScore가 3.85 증가한다"
이것은 틀렸습니다! 왜냐하면:
• $X$가 변하면 $X^2$도 반드시 변합니다
• "$X^2$를 고정하고 $X$만 변화"는 불가능합니다
• 마치 "키는 그대로 두고 몸무게만 증가"와 같은 모순입니다
올바른 접근: Marginal effect를 계산해야 합니다 $$\frac{\partial TestScore}{\partial Income} = \beta_1 + 2\beta_2 \times Income = 3.85 + 2(-0.0423) \times Income$$ 이제 Income의 값에 따라 효과가 달라집니다!
Income이 특정 값에서 1 단위 증가할 때의 효과:
| Income 변화 | 계산 과정 | TestScore 변화 |
|---|---|---|
| 5 → 6 | $\hat{Y}_6 - \hat{Y}_5 = [607.3 + 3.85(6) - 0.0423(36)] - [607.3 + 3.85(5) - 0.0423(25)]$ | 3.4 points |
| 25 → 26 | $\hat{Y}_{26} - \hat{Y}_{25} = [607.3 + 3.85(26) - 0.0423(676)] - [607.3 + 3.85(25) - 0.0423(625)]$ | 1.7 points |
| 45 → 46 | $\hat{Y}_{46} - \hat{Y}_{45} = [607.3 + 3.85(46) - 0.0423(2116)] - [607.3 + 3.85(45) - 0.0423(2025)]$ | 0.0 points |
→ Diminishing returns가 명확히 보입니다!
Quadratic model에서 최대/최소점을 찾는 방법:
Step 1: First-order condition
Marginal effect = 0이 되는 점을 찾습니다:
Step 2: Solve for X*
Step 3: California 예제에 적용
$X^* = -\frac{3.85}{2(-0.0423)} = \frac{3.85}{0.0846} = 45.5$
→ 평균 소득이 \$45,500일 때 test score가 최대!
Step 4: Maximum인지 Minimum인지?
$\beta_2 < 0$ → ∩ 모양 (inverted U) → Maximum!
$\beta_2 > 0$ → ∪ 모양 → Minimum
Model: $TestScore_i = \beta_0 + \beta_1 Income_i + \beta_2 Income_i^2 + \beta_3 Income_i^3 + u_i$
STATA 구현:
gen avginc3 = avginc*avginc2 /* avginc^3 = avginc * avginc^2 */
reg testscr avginc avginc2 avginc3, robust
추정 결과:
Model selection tests:
Test 1: Quadratic vs Cubic
$H_0: \beta_3 = 0$ (Quadratic is adequate)
$t = \frac{0.00069}{0.00035} = 1.98$, p-value = 0.049
→ Barely reject at 5% level
Test 2: Linear vs Cubic
$H_0: \beta_2 = \beta_3 = 0$ (Linear is adequate)
$F = 37.69$, p-value < 0.001
→ Strongly reject! Nonlinearity is important
• 데이터 범위: Income ∈ [5, 45]
• Income = 65에서의 예측? 매우 위험!
• Polynomial은 특히 극단값에서 wild한 예측
• Higher-order polynomial일수록 더 위험
비유: 키 150-180cm 데이터로 만든 모델로 키 250cm 사람의 몸무게를 예측하는 것과 같습니다!
California Test Score 데이터에 적합한 세 가지 모델 비교
Logarithmic Transformations
중급로그의 기본 성질 (복습):
| 성질 | 수식 | 예시 |
|---|---|---|
| 역수의 로그 | $\ln(1/x) = -\ln(x)$ | $\ln(1/100) = -\ln(100) = -4.605$ |
| 곱의 로그 | $\ln(ax) = \ln(a) + \ln(x)$ | $\ln(2 \times 50) = \ln(2) + \ln(50)$ |
| 나눗셈의 로그 | $\ln(x/a) = \ln(x) - \ln(a)$ | $\ln(100/2) = \ln(100) - \ln(2)$ |
| 거듭제곱의 로그 | $\ln(x^a) = a\ln(x)$ | $\ln(10^3) = 3\ln(10) = 6.908$ |
핵심 근사 공식:
이것이 왜 중요한가? → Percentage interpretation이 가능!
근사의 정확도:
| $\Delta x$ | 정확한 값 | 근사값 | 오차 |
|---|---|---|---|
| 0.001 (0.1%) | 0.00001 | 0.00001 | 0% |
| 0.01 (1%) | 0.00995 | 0.01 | 0.5% |
| 0.1 (10%) | 0.0953 | 0.10 | 5% |
| 0.5 (50%) | 0.405 | 0.50 | 23%! |
→ 큰 변화에서는 근사가 부정확!
1. Percentage interpretation (비율 해석)
• 절대량보다 상대적 변화가 중요한 경우
• 예: 임금이 \$1 증가 → 최저임금 근로자에겐 큰 변화, CEO에겐 무의미
• 하지만 임금이 5% 증가 → 모든 소득 수준에서 비슷한 의미
2. Scale-free (단위 무관)
• 달러로 측정하든 원화로 측정하든 elasticity는 동일
• 국제 비교가 용이
3. Diminishing effects (체감 효과)
• 많은 경제 변수들은 diminishing returns를 보임
• 로그는 이를 자연스럽게 포착
세 가지 로그 모델의 해석 (암기 필수!)
Linear-Log Model
Specification: $Y_i = \beta_0 + \beta_1 \ln(X_i) + u_i$
Interpretation: 1% increase in X → $0.01\beta_1$ unit increase in Y
유도:
$Y + \Delta Y = \beta_0 + \beta_1 \ln(X + \Delta X)$
$Y = \beta_0 + \beta_1 \ln(X)$
빼면: $\Delta Y = \beta_1[\ln(X + \Delta X) - \ln(X)] \approx \beta_1 \frac{\Delta X}{X}$
적합한 상황: Diminishing returns (수확체감)
Log-Linear Model
Specification: $\ln(Y_i) = \beta_0 + \beta_1 X_i + u_i$
Interpretation: 1 unit increase in X → $(100 \times \beta_1)$% increase in Y
유도:
$\ln(Y + \Delta Y) = \beta_0 + \beta_1(X + \Delta X)$
$\ln(Y) = \beta_0 + \beta_1 X$
빼면: $\ln(Y + \Delta Y) - \ln(Y) \approx \frac{\Delta Y}{Y} = \beta_1 \Delta X$
적합한 상황: Constant growth rate
Log-Log Model
Specification: $\ln(Y_i) = \beta_0 + \beta_1 \ln(X_i) + u_i$
Interpretation: 1% increase in X → $\beta_1$% increase in Y (elasticity)
유도:
$\ln(Y + \Delta Y) = \beta_0 + \beta_1 \ln(X + \Delta X)$
$\ln(Y) = \beta_0 + \beta_1 \ln(X)$
빼면: $\frac{\Delta Y}{Y} \approx \beta_1 \frac{\Delta X}{X}$
따라서: $\beta_1 = \frac{\Delta Y/Y}{\Delta X/X}$ = elasticity!
적합한 상황: Constant elasticity relationships
STATA 구현:
gen lninc = ln(avginc)
reg testscr lninc, robust
추정 결과:
해석:
계수 해석: Income이 1% 증가 → TestScore가 0.3642점 증가
예시 1: Income이 \$10,000에서 \$11,000으로 (10% 증가)
→ TestScore 증가 = 0.3642 × 10 = 3.642점
예시 2: Income이 \$50,000에서 \$55,000으로 (10% 증가)
→ TestScore 증가 = 0.3642 × 10 = 3.642점 (동일!)
→ 절대 금액이 아닌 percentage change가 중요!
잘못된 예제 (Crime Example):
문제점: Simultaneous Causality!
• 인과관계의 방향이 반대일 수 있음
• 범죄가 많은 곳에 경찰을 더 배치
• OVB: 도시 규모, 빈곤율 등 누락
교훈: 통계적 관계 ≠ 인과관계!
올바른 예제 (TestScore):
해석: Income이 \$1,000 증가 → TestScore가 0.284% 증가
추정 결과:
Elasticity 해석:
Income elasticity of TestScore = 0.0554
의미: Income이 1% 증가 → TestScore가 0.0554% 증가
구체적 예시:
• Income 10% ↑ → TestScore 0.554% ↑
• TestScore = 650인 학교: 0.554% = 3.6점 증가
• TestScore = 700인 학교: 0.554% = 3.9점 증가
Elasticity의 장점:
- 단위에 무관 (unit-free)
- 국제 비교 가능
- 경제학적 의미가 명확
- 정책 효과 평가에 유용
• Log-linear model에서 SER = 0.2의 의미?
• Standard deviation of $\ln(Y)$ around the regression line
• 대략적으로: typical percentage prediction error ≈ 20%
• 주의: 정확한 해석은 더 복잡함 (bias correction 필요)
세 가지 로그 모델의 함수 형태 비교
Interaction Variables
고급일상생활 예시:
• 운동의 효과: 나이에 따라 다름 (젊을수록 효과가 큼)
• 광고의 효과: 제품 가격에 따라 다름 (고가품일수록 광고 효과가 큼)
• 교육의 임금 효과: 성별에 따라 다름 (성별 임금 격차)
경제학 예시:
• 학급 규모 감소 효과: 영어 학습자 비율에 따라 다름
• 경험의 임금 효과: 교육 수준에 따라 다름
Interaction 없이는 이런 현실을 포착할 수 없습니다!
Type 1: Binary × Binary Interactions
예: Gender × Marriage, Treatment × High-risk group
Type 2: Binary × Continuous Interactions
예: Gender × Experience, Treatment × Dosage
Type 3: Continuous × Continuous Interactions
예: Education × Tenure, Price × Advertising
Model: $\ln(Wage) = \beta_0 + \beta_1 Female + \beta_2 Married + \beta_3 (Female \times Married) + u$
추정 결과:
| Single | Married | Marriage Premium | |
|---|---|---|---|
| Male | $\beta_0 = 1.34$ | $\beta_0 + \beta_2 = 1.612$ | $\beta_2 = 0.272$ (27.2%) |
| Female | $\beta_0 + \beta_1 = 1.209$ | $\beta_0 + \beta_1 + \beta_2 + \beta_3 = 1.173$ | $\beta_2 + \beta_3 = -0.036$ (-3.6%) |
| Gender Gap | $\beta_1 = -0.131$ (13.1%) | $\beta_1 + \beta_3 = -0.439$ (43.9%) |
핵심 발견:
- 남성: 결혼 프리미엄 27.2%
- 여성: 결혼 패널티 3.6%
- 결혼이 성별 임금 격차를 13.1%에서 43.9%로 확대!
Model: $TestScore = \beta_0 + \beta_1 STR + \beta_2 HiEL + \beta_3 (STR \times HiEL) + u$
where $HiEL = 1$ if PctEL ≥ 10%
추정 결과:
두 개의 회귀선:
Low EL schools (HiEL = 0):
$\widehat{TestScore} = 682.2 - 0.97 \times STR$
→ STR 1 감소 시 TestScore 0.97점 상승
High EL schools (HiEL = 1):
$\widehat{TestScore} = (682.2 + 5.6) + (-0.97 - 1.28) \times STR$
$= 687.8 - 2.25 \times STR$
→ STR 1 감소 시 TestScore 2.25점 상승
경제학적 해석: 영어 학습자가 많은 학교에서 학급 규모 감소의 효과가 더 큽니다!
→ 개별 지도가 더 필요한 학생들에게 소규모 학급이 더 효과적
가설 검정 (Multicollinearity의 영향):
• $H_0: \beta_3 = 0$ → $t = -1.32$ → Fail to reject
• $H_0: \beta_2 = 0$ → $t = 0.29$ → Fail to reject
Joint F-test 결과:
• $H_0: \beta_2 = \beta_3 = 0$ → $F = 89.94$ → Reject!
이유: STR과 STR×HiEL은 높은 상관관계 → SE 증가 → t-stat 감소
Model: $Wage = \beta_0 + \beta_1 Educ + \beta_2 Tenure + \beta_3 (Educ \times Tenure) + u$
추정 결과:
구체적 계산:
• 신입사원 (Tenure = 0): 효과 = \$0.404/hour
• 5년차 (Tenure = 5): 효과 = 0.404 + 0.024(5) = \$0.524/hour
• 10년차 (Tenure = 10): 효과 = 0.404 + 0.024(10) = \$0.644/hour
경제학적 해석:
• 교육과 경험은 complementary
• 경력이 쌓일수록 교육의 가치가 증가
• 고학력자일수록 경험을 통해 더 많이 배움
Binary × Continuous interaction의 효과
Model Selection and Testing
고급모델 선택의 5가지 원칙:
- 경제 이론 (Economic Theory):
• 이론이 특정 함수 형태를 시사하는가?
• Diminishing returns? Constant elasticity?
• 변수 간 interaction이 예상되는가? - 데이터 탐색 (Data Exploration):
• Scatter plot 그리기 (가장 기본!)
• 패턴 확인: linear? curved? S-shaped?
• Outliers 확인 - 통계적 검정 (Statistical Tests):
• t-tests for individual coefficients
• F-tests for joint hypotheses
• Model selection criteria (AIC, BIC) - 경제적 의미 (Economic Significance):
• 추정된 효과가 합리적인가?
• 부호가 예상과 일치하는가?
• 크기가 현실적인가? - 예측력과 Parsimony:
• $R^2$, RMSE 비교
• Out-of-sample performance
• Parsimony principle: 단순한 모델 선호
체계적인 가설 검정 절차
Linear vs Quadratic
Model: $Y = \beta_0 + \beta_1 X + \beta_2 X^2 + u$
Test: $H_0: \beta_2 = 0$ (t-test)
Decision rule: |t| > critical value → Quadratic is better
Quadratic vs Cubic
Model: $Y = \beta_0 + \beta_1 X + \beta_2 X^2 + \beta_3 X^3 + u$
Test: $H_0: \beta_3 = 0$ (t-test)
Decision rule: |t| > critical value → Cubic is better
Linear vs Cubic (skip quadratic)
Test: $H_0: \beta_2 = \beta_3 = 0$ (F-test with q=2)
Decision rule: F > critical value → Cubic is better
Joint test of multiple restrictions
Testing Interaction Effects
Individual: t-test on interaction coefficient
Joint: F-test on main effects + interaction
Watch for multicollinearity!
| Model | Specification | RMSE | $R^2$ | 평가 |
|---|---|---|---|---|
| Linear | $Y = \beta_0 + \beta_1 X$ | 14.36 | 0.508 | Too simple |
| Quadratic | $Y = \beta_0 + \beta_1 X + \beta_2 X^2$ | 12.72 | 0.556 | Good improvement |
| Cubic | $Y = \beta_0 + ... + \beta_3 X^3$ | 12.71 | 0.558 | Minimal gain |
| Linear-log | $Y = \beta_0 + \beta_1 \ln(X)$ | 12.62 | 0.561 | Best! |
결론: Linear-log 모델을 선택
- 가장 낮은 RMSE (12.62)
- 경제학적으로 합리적 (diminishing returns)
- Parsimony: 단순하면서도 효과적
- Extrapolation 위험이 적음
더 복잡한 nonlinear function도 가능합니다:
이 모델의 특징:
- 항상 증가하지만 상한선 존재 (asymptote at $\beta_0$)
- S-shaped curve 가능
- Nonlinear in parameters! → OLS 불가능
• Iterative optimization (hill-climbing)
• Starting values 중요
• Convergence 보장 안됨
• 대부분의 경우 polynomial이나 log로 충분!
Practice Problems
실전Consider the quadratic model: $Y = \beta_0 + \beta_1 X + \beta_2 X^2 + u$
Given estimates: $\hat{\beta}_0 = 10$, $\hat{\beta}_1 = 5$, $\hat{\beta}_2 = -0.5$
(a) Find the value of X that maximizes Y.
(b) Calculate the marginal effect of X when X = 3.
(c) Calculate the effect of increasing X from 2 to 4.
(d) Is this a ∩-shape or ∪-shape parabola?
(e) What is the predicted value of Y when X = 5?
(a) Finding X* (maximum):
First-order condition:
$\frac{\partial Y}{\partial X} = \beta_1 + 2\beta_2 X = 0$
$5 + 2(-0.5)X = 0$
$5 - X = 0$
$X^* = 5$
(b) Marginal effect at X = 3:
$\frac{\partial Y}{\partial X}\bigg|_{X=3} = 5 + 2(-0.5)(3) = 5 - 3 = 2$
해석: X = 3에서 X가 1 단위 증가하면 Y는 약 2 단위 증가
(c) Effect from X = 2 to X = 4 (After-Before):
$Y(2) = 10 + 5(2) + (-0.5)(4) = 10 + 10 - 2 = 18$
$Y(4) = 10 + 5(4) + (-0.5)(16) = 10 + 20 - 8 = 22$
$\Delta Y = 22 - 18 = 4$
Note: Average marginal effect = 4/2 = 2 (X=3일 때와 일치!)
(d) Shape:
$\beta_2 = -0.5 < 0$ → ∩-shape (inverted U)
Second derivative: $\frac{\partial^2 Y}{\partial X^2} = 2\beta_2 = -1 < 0$ → Concave
(e) Predicted value at X = 5:
$\hat{Y}(5) = 10 + 5(5) + (-0.5)(25) = 10 + 25 - 12.5 = 22.5$
Note: X = 5는 최대점이므로 이것이 Y의 최댓값입니다!
You estimate: $\ln(Wage) = 2.3 + 0.08 \times Education + 0.05 \times Experience + u$
(a) Interpret both coefficients precisely.
(b) If someone increases education from 12 to 16 years, by what percentage does wage increase? (approximate and exact)
(c) What is the combined effect of 4 more years of education and 5 more years of experience?
(d) If the SER = 0.15, what does this mean?
(e) Calculate the 95% confidence interval for the education coefficient if SE = 0.01.
(a) Interpretation:
- Education: 1 year increase → 8% wage increase (log-linear model)
- Experience: 1 year increase → 5% wage increase
(b) Education from 12 to 16:
Approximate (작은 변화 근사):
$\Delta \ln(Wage) = 0.08 \times 4 = 0.32$ → 약 32% 증가
Exact (정확한 계산):
$\frac{Wage_{new}}{Wage_{old}} = e^{0.32} = 1.377$
정확한 증가율 = $(1.377 - 1) \times 100\% = 37.7\%$
큰 변화에서는 근사와 정확한 값의 차이가 큽니다!
(c) Combined effect:
$\Delta \ln(Wage) = 0.08(4) + 0.05(5) = 0.32 + 0.25 = 0.57$
Approximate: 57% increase
Exact: $e^{0.57} - 1 = 0.768$ → 76.8% increase
(d) SER = 0.15 meaning:
• Standard deviation of residuals in log scale
• Typical prediction error ≈ 15% of wage
• About 68% of observations within ±15% of predicted wage
(e) 95% CI for education coefficient:
CI = $0.08 \pm 1.96(0.01) = 0.08 \pm 0.0196 = [0.0604, 0.0996]$
해석: 95% 신뢰수준에서 교육 1년의 효과는 6.04%에서 9.96% 사이
Consider: $TestScore = \beta_0 + \beta_1 STR + \beta_2 PctEL + \beta_3 (STR \times PctEL) + u$
Estimates: $\hat{\beta}_0 = 686.3$, $\hat{\beta}_1 = -1.12$, $\hat{\beta}_2 = -0.67$, $\hat{\beta}_3 = 0.012$
SE: (11.8), (0.59), (0.37), (0.019)
(a) Write the regression equation for schools with PctEL = 0.
(b) Write the regression equation for schools with PctEL = 20.
(c) At what value of PctEL does STR have no effect?
(d) Test $H_0$: The effect of STR is the same regardless of PctEL (5% level).
(e) Interpret the economic meaning of the interaction term.
(f) Calculate the effect of reducing STR by 2 when PctEL = 15.
(a) When PctEL = 0:
$\widehat{TestScore} = 686.3 - 1.12 \times STR$
(b) When PctEL = 20:
Substitute PctEL = 20:
$\widehat{TestScore} = 686.3 - 1.12 \times STR - 0.67(20) + 0.012 \times STR \times 20$
$= 686.3 - 13.4 + (-1.12 + 0.24) \times STR$
$= 672.9 - 0.88 \times STR$
(c) No effect point:
Set marginal effect = 0:
$\frac{\partial TestScore}{\partial STR} = -1.12 + 0.012 \times PctEL = 0$
$PctEL^* = \frac{1.12}{0.012} = 93.3$
의미: PctEL이 93.3%일 때 STR은 TestScore에 영향 없음 (비현실적!)
(d) Hypothesis test:
$H_0: \beta_3 = 0$ (STR 효과가 PctEL에 무관)
$H_1: \beta_3 \neq 0$
$t = \frac{0.012}{0.019} = 0.63$
$|t| = 0.63 < 1.96$ → Fail to reject $H_0$ at 5% level
(e) Economic interpretation:
• Positive interaction coefficient ($\beta_3 > 0$)
• STR의 negative effect가 PctEL이 높을수록 작아짐
• 하지만 통계적으로 유의하지 않음
(f) Effect when PctEL = 15:
Marginal effect = $-1.12 + 0.012(15) = -1.12 + 0.18 = -0.94$
STR을 2 감소시키면: $\Delta TestScore = -(-0.94)(2) = 1.88$ points increase
Compare three models for the relationship between Y and X:
Model A: $Y = \beta_0 + \beta_1 X + u$, $R^2 = 0.45$, RMSE = 15.2
Model B: $Y = \beta_0 + \beta_1 X + \beta_2 X^2 + u$, $R^2 = 0.52$, RMSE = 14.1, $\hat{\beta}_2 = -0.03$ (SE = 0.01)
Model C: $Y = \beta_0 + \beta_1 \ln(X) + u$, $R^2 = 0.53$, RMSE = 14.0
(a) Test Model A vs Model B at 1% level.
(b) Can you test Model B vs Model C using a t-test? Why or why not?
(c) Which model would you choose and why?
(d) If X ranges from 10 to 50 in the data, discuss extrapolation concerns for each model.
(a) Test A vs B (Linear vs Quadratic):
$H_0: \beta_2 = 0$ (Model A is adequate)
$H_1: \beta_2 \neq 0$ (Model B is better)
$t = \frac{-0.03}{0.01} = -3.0$
$|t| = 3.0 > 2.58$ (1% critical value) → Reject $H_0$
결론: Quadratic이 Linear보다 유의하게 좋음
(b) Testing B vs C:
불가능합니다! 이유:
- Non-nested models (서로 포함관계가 아님)
- Model B: polynomial in X
- Model C: logarithm of X
- t-test는 nested models에서만 가능
대안: AIC, BIC, cross-validation 등 사용
(c) Model choice:
Model C (Linear-log)를 선택합니다.
이유:
- 가장 높은 $R^2$ (0.53)
- 가장 낮은 RMSE (14.0)
- Diminishing returns 해석 가능
- Extrapolation에서 더 안정적
- 경제학적 해석이 명확
(d) Extrapolation concerns:
데이터 범위: X ∈ [10, 50]
- Model A (Linear):
• X = 100에서도 같은 slope 가정
• 매우 비현실적일 가능성 - Model B (Quadratic):
• X > 50에서 급격히 감소할 수 있음
• 특히 위험! (polynomial의 특성) - Model C (Log):
• 증가율이 점진적으로 감소
• 가장 안전한 extrapolation
A study examines baseball player salaries:
$\ln(salary) = 10.34 - 0.198 \times black - 0.190 \times hispanic + 0.0125 \times (black \times percblack)$
$\quad\quad\quad\quad\quad\quad\quad + 0.0201 \times (hispanic \times perchisp) + \text{other factors}$
where percblack and perchisp are city population percentages.
(a) How do you 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 city black percentage do black and white players earn the same?
(d) Test whether race affects salary (consider multicollinearity).
(e) If you add player performance variables, what happens to race coefficients? Why?
(a) Interpretation of black coefficient:
In a city with 0% black population, black players earn 19.8% less than white players.
This is the baseline racial gap when there's no same-race population support.
(b) Salary difference when percblack = 10:
$\ln(salary)_{black} - \ln(salary)_{white} = -0.198 + 0.0125(10)$
$= -0.198 + 0.125 = -0.073$
Black players earn about 7.3% less than white players
(c) Equal salary point:
Set difference = 0:
$-0.198 + 0.0125 \times percblack^* = 0$
$percblack^* = \frac{0.198}{0.0125} = 15.84$
At 15.84% black population, salaries are equal
(d) Testing race effects:
Individual t-tests may not be significant due to multicollinearity
Must use joint F-test:
$H_0: \beta_{black} = \beta_{hispanic} = \beta_{black \times percblack} = \beta_{hispanic \times perchisp} = 0$
If F-stat is large → race matters for salary
(e) Adding performance variables:
Race coefficients would likely decrease (move toward zero)
Why? Omitted variable bias:
- Performance affects salary (positive)
- If minorities have lower average performance → positive OVB
- Adding performance controls reduces this bias
- Remaining coefficient = "pure" discrimination effect
예를 들어, $Y = \beta_0 + \beta_3(X_1 \times X_2) + u$ (main effects 없이)라고 하면:
• $X_2 = 0$일 때: 모든 $X_1$ 값에서 $Y = \beta_0$ (unrealistic!)
• $X_1 = 0$일 때: 모든 $X_2$ 값에서 $Y = \beta_0$ (unrealistic!)
Main effects를 포함하면:
• 각 변수의 독립적인 효과 포착
• Interaction은 추가적인 효과만 측정
• 더 flexible한 모델
실생활 비유: "커피와 설탕의 상호작용"을 측정할 때
• 커피만의 효과 (쓴맛)
• 설탕만의 효과 (단맛)
• 둘의 상호작용 (조화로운 맛)
모두 필요합니다!
Exam 2 대비 핵심 정리
종합Exam 2를 위한 필수 체크리스트
Polynomial Regression
• Still linear in parameters → OLS 사용 가능
• Marginal effect: $\frac{\partial Y}{\partial X} = \beta_1 + 2\beta_2X$ (quadratic)
• Maximum/minimum: $X^* = -\beta_1/(2\beta_2)$
• 함정: $\beta_1$을 단독으로 해석하면 안 됨!
• Always use After-Before method for effects
Logarithmic Models (암기 필수!)
• Linear-log: 1% ↑ X → $0.01\beta_1$ ↑ Y
• Log-linear: 1 unit ↑ X → $100\beta_1$% ↑ Y
• Log-log: 1% ↑ X → $\beta_1$% ↑ Y (elasticity)
• 근사는 작은 변화에서만 정확 (10% 이하)
• SER interpretation in log models
Interactions
• One variable's effect depends on another
• Always include main effects (hierarchical principle)
• Marginal effects become conditional
• Binary×Binary: 4 groups to compare
• Multicollinearity → joint F-test > individual t-tests
Model Selection
• Nested models: t-test or F-test
• Non-nested: compare $R^2$, RMSE, economic sense
• Parsimony principle: simpler is better
• Consider extrapolation dangers
• Economic interpretation matters!
Common Exam Mistakes to Avoid
• Interpreting $\beta_1$ alone in polynomial models
• Using log approximation for large changes (>10%)
• Forgetting main effects with interactions
• Extrapolating beyond data range
• Not showing work (partial credit!)
1. Polynomial 문제 (거의 확실히 출제)
- Marginal effect 계산
- Maximum/minimum 찾기
- 특정 구간에서의 효과 계산 (After-Before)
- Linear vs Quadratic vs Cubic 검정
2. Log 변환 문제 (반드시 출제)
- 세 가지 모델의 해석
- Approximate vs Exact calculation
- Elasticity 계산 및 해석
- SER in log models
3. Interaction 문제 (높은 확률)
- Conditional marginal effects
- 특정 값에서의 효과 계산
- Joint significance test
- 경제학적 해석
1. 공식 암기 확인:
✓ Polynomial marginal effect: $\beta_1 + 2\beta_2X$
✓ Maximum point: $X^* = -\beta_1/(2\beta_2)$
✓ 세 가지 log model 해석 (정확히!)
2. 계산 능력:
✓ After-Before method로 효과 계산
✓ Interaction이 있을 때 marginal effect
✓ Log 근사 vs 정확한 계산
3. 검정 절차:
✓ Individual t-test vs Joint F-test
✓ Nested vs Non-nested models
4. 해석 능력:
✓ 경제학적 의미 설명
✓ 그래프 해석
✓ Extrapolation 위험 인식
Remember: Show all your work for partial credit!
이 강의 자료를 완벽히 이해했다면 Exam 2에서 좋은 성적을 받을 수 있을 것입니다.
특히 Polynomial, Log transformations, Interactions는 반드시 출제되니
계산 과정과 해석 방법을 확실히 익혀두세요!