Problem Set 3 Overview & Exam 2 Preview
시작하기이 Problem Set은 Exam 2의 핵심 개념들을 모두 다룹니다:
- Problem 1: 기본 Multiple Regression의 해석 (주택 가격)
- Problem 2: Nonlinear Regression의 모든 것 (Log, Polynomial, Interactions)
- Problem 3: Causal Inference와 Selection Bias (401k 효과)
Exam 2 출제 범위 (Chapters 8-11)
Nonlinear Regression Functions
• Polynomial regression (quadratic, cubic)
• Logarithmic transformations (3 types)
• Interaction terms (binary × binary, binary × continuous, continuous × continuous)
Assessing Studies Based on Multiple Regression
• Internal validity threats
• External validity
• Model specification and selection
Regression with Panel Data
• Fixed effects regression
• Time fixed effects
• Difference-in-differences
Regression with a Binary Dependent Variable
• Linear Probability Model (LPM)
• Probit and Logit models
• Marginal effects calculation
Problem 1: Housing Price Analysis
중급Use the data in hprice1.dta to estimate the following model:
where price = the (selling) price of the house (in 1000 dollars), sqrft = size of house (square feet) and bdrms = number of bedrooms in the house.
시나리오 1: 3개의 침실이 있는 1,000 sqft 집
→ 각 침실이 매우 작음 (약 200 sqft)
→ 거실, 부엌이 비좁음
→ 낮은 가격
시나리오 2: 3개의 침실이 있는 3,000 sqft 집
→ 각 침실이 넓음 (약 400 sqft)
→ 넓은 거실, 고급 주방
→ 높은 가격
같은 침실 개수라도 전체 면적에 따라 가치가 완전히 달라집니다! 마치 "3명이 탈 수 있는 차"라고 해도 경차와 SUV의 가격이 다른 것과 같습니다.
문제: What is the estimated increase in price for a house with an additional 1400-square-foot bedroom added?
해결 방법:
이 문제는 두 가지 효과를 동시에 고려해야 합니다:
실제 계산 예시:
만약 추정 결과가 $\hat{\beta}_1 = 0.128$ (per sqft), $\hat{\beta}_2 = 15.2$ (per bedroom)라면:
- 면적 효과: $0.128 \times 1400 = 179.2$ thousand dollars
- 침실 효과: $15.2 \times 1 = 15.2$ thousand dollars
- 총 효과: $179.2 + 15.2 = 194.4$ thousand dollars
왜 두 개가 필요할까요?
$R^2 = 1 - \frac{SSR}{TSS}$
• 모델이 설명하는 variation의 비율
• 변수를 추가하면 항상 증가 (또는 동일)
• 마치 시험에서 모든 보기를 다 선택하면 맞출 확률이 올라가는 것과 같음!
$\bar{R}^2 = 1 - \frac{SSR/(n-k-1)}{TSS/(n-1)}$
• 자유도(degrees of freedom)로 조정
• 쓸모없는 변수를 추가하면 감소할 수 있음
• 마치 추측에 페널티를 주는 시험과 같음!
실생활 비유: 축구팀에 선수를 추가한다고 생각해보세요.
- $R^2$: 선수가 많을수록 무조건 좋다! (11명 → 20명)
- $\bar{R}^2$: 실력 없는 선수를 추가하면 오히려 팀워크가 망가진다!
문제: Does the residual suggest that the buyer underpaid or overpaid for the house?
양수 residual (+):
• 실제 가격 > 예측 가격
• 구매자가 overpaid (비싸게 샀다)
• 예: 감정적 가치, 급한 거래, 경쟁 입찰
음수 residual (-):
• 실제 가격 < 예측 가격
• 구매자가 underpaid (싸게 샀다)
• 예: 급매물, 숨겨진 하자, 협상력
실제 예시:
만약 첫 번째 집의 residual = -45.5라면:
- 구매자는 예상보다 $45,500 싸게 구매
- 가능한 이유: 급매물, 외관 문제, 소음 등
- 또는 모델이 놓친 negative factors가 있을 수 있음
• Quadratic term 추가: $price = \beta_0 + \beta_1 sqrft + \beta_2 sqrft^2 + \beta_3 bdrms + u$
• Log transformation: $\ln(price) = \beta_0 + \beta_1 \ln(sqrft) + \beta_2 bdrms + u$
• Interaction term: $price = \beta_0 + \beta_1 sqrft + \beta_2 bdrms + \beta_3 (sqrft \times bdrms) + u$
Problem 2: PISA Scores and GDP - Nonlinear Mastery
고급이 문제는 국가의 경제 수준(GDP)과 교육 성과(PISA scores) 사이의 관계를 분석합니다. 핵심은 이 관계가 비선형이라는 점입니다!
가난한 나라 (GDP $10,000 → $20,000):
• 기본 교육 인프라 구축 (학교 건물, 교과서, 전기)
• 교사 급여 인상으로 우수 인재 유치
• 급식 제공으로 출석률 상승
→ PISA 점수 대폭 상승! (예: 400 → 480)
부유한 나라 (GDP $50,000 → $60,000):
• 이미 최신 시설과 우수한 교사 보유
• 추가 투자는 marginal improvements만
• 학생당 노트북 1대 → 2대? 효과 미미
→ PISA 점수 소폭 상승 (예: 520 → 525)
마치 목마른 사람의 첫 번째 물 한 잔과 열 번째 물 한 잔의 차이와 같습니다!
두 모델의 차이점:
Linear Model:
• GDP가 $1,000 증가 → PISA가 $\beta_1$점 증가
• 문제점: 모든 나라에서 동일한 효과 가정
• Bangladesh와 Switzerland에서 $1,000의 가치가 같을까?
Log Model:
• GDP가 1% 증가 → PISA가 $0.01\beta_1$점 증가
• 장점: percentage change가 중요!
• $10,000 → $11,000 (10% 증가) = $50,000 → $55,000 (10% 증가)
Model Selection 전략:
Quadratic Model:
Cubic Model:
어떻게 선택할까?
- Statistical test: $H_0: \beta_3 = 0$ (t-test)
- Model fit: $R^2$, adjusted $R^2$, AIC, BIC 비교
- Economic sense: Cubic이 경제학적으로 의미있나?
- Parsimony: 단순한 모델이 더 나을 수도!
실제 해석:
만약 cubic term이 유의하지 않다면 (p-value > 0.05):
- Quadratic으로 충분히 관계를 설명 가능
- 과적합(overfitting)을 피할 수 있음
- 해석이 더 간단하고 명확
Model with Regional Interactions:
동아시아 (한국, 일본, 싱가포르):
• 교육을 최우선 가치로 여김
• GDP 증가 → 사교육 투자 폭증
• $\delta_{Asia} > 0$ (GDP 효과 증폭)
일부 석유 부국:
• 자원 의존 경제
• GDP 높아도 교육 투자 상대적으로 적음
• $\delta_{Oil} < 0$ (GDP 효과 감소)
북유럽:
• 이미 최적화된 교육 시스템
• 추가 GDP의 교육 효과 제한적
• $\delta_{Nordic} ≈ 0$ (표준 효과)
해석 예시:
Asia 지역에서 GDP 10% 증가의 효과:
$\frac{\partial PISA}{\partial \ln(GDP)} = \beta_1 + \delta_{Asia}$
예: $\beta_1 = 30$, $\delta_{Asia} = 15$
→ Asia에서는 GDP 10% 증가 → PISA 4.5점 상승
→ 다른 지역에서는 GDP 10% 증가 → PISA 3.0점 상승
F-test for Joint Significance
Regional indicators joint test
$H_0: \gamma_1 = \gamma_2 = ... = \gamma_J = 0$
모든 지역 더미가 동시에 0인지 검정
Log GDP overall significance
$H_0: \beta_1 = 0$ and $\delta_1 = \delta_2 = ... = \delta_J = 0$
GDP 관련 모든 항목이 0인지 검정 (6개 제약)
STATA commands
* Regional indicators joint test
test africa asia latam mideast
* Log GDP overall significance
test loggdp africa_loggdp asia_loggdp latam_loggdp mideast_loggdp
Problem 3: 401(k) and Causal Inference
고급정부 보조 저축 계좌(401k)가 실제로 사람들의 저축을 증가시키는가? 얼마나?
이 문제는 인과관계 추론의 핵심 난제를 다룹니다!
Selection Bias의 가능성:
• 미래를 계획하는 성향이 강한 사람들이 401(k)에 가입
• 이들은 401(k) 없어도 많이 저축했을 것
• 금융 지식이 많은 사람들이 401(k) 활용
마치 "헬스장 회원이 더 건강하다"고 해서 헬스장이 건강을 만드는 것은 아닌 것과 같습니다!
건강에 관심 있는 사람이 헬스장에 가는 것일 수도 있죠.
Model:
이 회귀분석의 문제점들:
1. Omitted Variable Bias
- 소득: 고소득자가 401(k)도 가입하고 저축도 많이 함
- 교육: 교육 수준 높을수록 금융 지식 많음
- 나이: 나이 많을수록 은퇴 준비
- 고용 안정성: 안정적 직장 → 401(k) 제공 + 저축 여력
2. Selection Bias
401(k) 가입은 random이 아닙니다!
- 저축 성향이 높은 사람이 자발적으로 가입
- 재무 계획을 세우는 사람이 가입
- 위험 회피 성향이 높은 사람이 가입
Model:
Eligible인데 가입 안 한 사람들:
• 저축할 여유가 없음 (living paycheck to paycheck)
• 401(k)의 혜택을 모름 (금융 문맹)
• 당장의 소비가 더 급함
• 평균적으로 자산이 적음
Not eligible인 사람들:
• 자영업자, 프리랜서 (often 고소득)
• 다른 방법으로 저축 (IRA, 부동산, 주식)
• 401(k) 없어도 저축 능력 있음
• 평균적으로 자산이 많을 수 있음!
마치 "수영장 이용권이 있는 사람이 수영을 못한다"와 비슷합니다. 정작 수영 잘하는 사람은 바다에서 수영하죠!
Extended Model:
각 통제변수의 역할:
1. IRA participation (pira):
• 다른 은퇴 저축 수단 통제
• 저축 성향의 proxy
2. Age and Age²:
• Life-cycle savings pattern
• 젊을 때: 저축 적음 (학자금 대출, 주택 구입)
• 중년: 저축 최대 (peak earning years)
• 은퇴 직전: 저축 감소 시작
3. Income and Income²:
• 저축 능력의 핵심 결정 요인
• Quadratic: 고소득에서 저축률 체감
4. Demographics (male, marr, fsize):
• 성별 임금 격차
• 결혼 → 미래 계획 증가
• 가족 크기 → 저축 여력 감소
예상되는 변화:
$\beta_1$이 작아질 것입니다! 왜? 이전에는 401(k) 효과에 포함되어 있던 소득, 나이, 저축 성향 등의 효과가 분리되기 때문입니다.
Full Interaction Model:
해석의 핵심:
| 성별 | 401(k) 효과 | 계산 | 의미 |
|---|---|---|---|
| 여성 | $\beta_1$ | Base effect | 여성의 401(k) 효과 |
| 남성 | $\beta_1 + \beta_3$ | Base + Interaction | 남성의 401(k) 효과 |
세 가지 핵심 가설 검정:
1. 여성에게 401(k) 효과가 있는가?
$H_0: \beta_1 = 0$ vs $H_1: \beta_1 \neq 0$
Standard t-test 사용
2. 남성에게 401(k) 효과가 있는가?
$H_0: \beta_1 + \beta_3 = 0$ vs $H_1: \beta_1 + \beta_3 \neq 0$
Linear combination test 필요!
lincom _b[p401k] + _b[p401k_male]
3. 성별 간 401(k) 효과 차이가 있는가?
$H_0: \beta_3 = 0$ vs $H_1: \beta_3 \neq 0$
Interaction term의 t-test
1. 임금 격차:
• 여성의 평균 임금이 낮음 → 401(k) matching의 절대 금액 작음
• 같은 % matching도 달러로는 차이
2. 경력 단절:
• 여성은 출산/육아로 경력 단절 가능성
• 401(k)의 장기 복리 효과 감소
3. 투자 성향:
• 연구에 따르면 여성이 더 보수적 투자
• 401(k) 내 자산 배분 차이
4. 수명 차이:
• 여성이 더 오래 삶 → 은퇴 자금 더 필요
• 401(k)의 중요성 인식 차이
• Unobserved heterogeneity: 저축 성향, 위험 회피도, 금융 지식
• General equilibrium effects: 모든 사람이 401(k)에 가입하면?
• Crowd-out effect: 401(k)가 다른 저축을 대체하는가?
• Long-term effects: 은퇴 후 실제 소비는?
Exam 2 핵심 개념 총정리
필수Chapter 8: Nonlinear Regression Functions
Polynomial Regression
Quadratic: $Y = \beta_0 + \beta_1 X + \beta_2 X^2 + u$
• Marginal effect: $\frac{\partial Y}{\partial X} = \beta_1 + 2\beta_2 X$ (X에 따라 변함!)
• Maximum/Minimum at: $X^* = -\frac{\beta_1}{2\beta_2}$
• $\beta_2 < 0$ → ∩-shape (diminishing returns)
• $\beta_2 > 0$ → ∪-shape (increasing returns)
예: 공부 시간과 성적 (처음엔 급상승, 나중엔 완만)
Logarithmic Transformations
Linear-log: $Y = \beta_0 + \beta_1 \ln(X) + u$
→ X가 1% 증가 → Y가 $0.01\beta_1$ 단위 증가
예: GDP 1% 증가 → PISA 0.3점 증가
Log-linear: $\ln(Y) = \beta_0 + \beta_1 X + u$
→ X가 1 단위 증가 → Y가 $(100\beta_1)$% 증가
예: 교육 1년 증가 → 임금 8% 증가
Log-log: $\ln(Y) = \beta_0 + \beta_1 \ln(X) + u$
→ X가 1% 증가 → Y가 $\beta_1$% 증가 (elasticity!)
예: 가격 1% 상승 → 수요 0.5% 감소
Interaction Terms
Binary × Binary: $(Male \times Married)$
• 기혼 남성의 추가 효과
Binary × Continuous: $(Female \times Education)$
• 여성의 교육 수익률 차이
Continuous × Continuous: $(Experience \times Education)$
• 교육과 경험의 시너지 효과
Chapter 10: Panel Data
Fixed Effects Model
• $\alpha_i$: Individual-specific, time-invariant
• 장점: Unobserved heterogeneity 제거
• 단점: Time-invariant variables (성별, 인종) 추정 불가
예: 같은 사람의 임금 변화 추적 (능력은 고정)
Difference-in-Differences
핵심 가정: Parallel trends
추정: $(Y_{T,after} - Y_{T,before}) - (Y_{C,after} - Y_{C,before})$
| Before | After | Difference | |
|---|---|---|---|
| Treatment | $Y_{T,0}$ | $Y_{T,1}$ | $\Delta Y_T$ |
| Control | $Y_{C,0}$ | $Y_{C,1}$ | $\Delta Y_C$ |
| DiD | $\Delta Y_T - \Delta Y_C$ | ||
Chapter 11: Binary Dependent Variables
Linear Probability Model
$Y_i = \beta_0 + \beta_1 X_i + u_i$ where $Y \in \{0,1\}$
• 장점: OLS 사용 가능, 해석 간단
• 단점: 예측값이 [0,1] 벗어날 수 있음
• Heteroskedasticity 문제 → robust SE 사용!
Probit & Logit Models
Probit: $P(Y=1|X) = \Phi(\beta_0 + \beta_1 X)$
Logit: $P(Y=1|X) = \frac{1}{1+e^{-(\beta_0 + \beta_1 X)}}$
• Marginal effects 계산 필수!
• After-Before method 사용
예시 계산 (Probit):
$P(Y=1|X=12, D=1) - P(Y=1|X=12, D=0)$
$= \Phi(0.38) - \Phi(0.77) = 0.648 - 0.779 = -0.131$
실전 연습 문제
시험 대비Consider the model: $\ln(wage) = \beta_0 + \beta_1 educ + \beta_2 exper + \beta_3 exper^2 + \beta_4 female + \beta_5 (female \times educ) + u$
Given estimates: $\hat{\beta}_1 = 0.10$, $\hat{\beta}_2 = 0.05$, $\hat{\beta}_3 = -0.001$, $\hat{\beta}_4 = -0.30$, $\hat{\beta}_5 = -0.02$
(a) What is the return to education for males?
(b) What is the return to education for females?
(c) At what experience level is wage maximized?
(d) Calculate the wage difference between males and females with 16 years of education.
(a) Return to education for males:
Males: female = 0, so return = $\beta_1 = 0.10$ = 10% per year
(b) Return to education for females:
Females: female = 1, so return = $\beta_1 + \beta_5 = 0.10 + (-0.02) = 0.08$ = 8% per year
(c) Experience maximizing wage:
$\frac{\partial \ln(wage)}{\partial exper} = \beta_2 + 2\beta_3 \times exper = 0$
$0.05 + 2(-0.001) \times exper = 0$
$exper^* = \frac{0.05}{0.002} = 25$ years
(d) Gender wage gap at educ = 16:
$\ln(wage_M) - \ln(wage_F) = -\beta_4 - \beta_5 \times 16$
$= -(-0.30) - (-0.02)(16) = 0.30 + 0.32 = 0.62$
Males earn approximately 62% more than females with same education!
A city is evaluating its living wage policy using difference-in-differences. The treatment city implemented the policy in 2020.
Employment rates:
• Treatment city: 2019 = 0.75, 2021 = 0.78
• Control city: 2019 = 0.74, 2021 = 0.76
(a) Calculate the DiD estimate.
(b) What is the key identifying assumption?
(c) How would you test this assumption?
(a) DiD Calculation:
Treatment difference: $0.78 - 0.75 = 0.03$
Control difference: $0.76 - 0.74 = 0.02$
DiD estimate: $0.03 - 0.02 = 0.01$
→ Living wage policy increased employment by 1 percentage point
(b) Key assumption:
Parallel trends: Without the policy, treatment and control cities would have had the same change in employment
(c) Testing the assumption:
- Plot pre-treatment trends (2015-2019)
- Test for differential pre-trends
- Include city-specific time trends
- Placebo test: pretend treatment in 2018
You estimate a probit model for college attendance:
$P(college = 1) = \Phi(\beta_0 + \beta_1 income + \beta_2 SAT)$
Estimates: $\hat{\beta}_0 = -2.0$, $\hat{\beta}_1 = 0.02$, $\hat{\beta}_2 = 0.002$
(a) Calculate the probability of attending college for a student with family income = $50k and SAT = 1200.
(b) What is the marginal effect of income at these values?
(c) By how much does probability increase if SAT increases from 1200 to 1300?
(a) Probability calculation:
$z = -2.0 + 0.02(50) + 0.002(1200) = -2.0 + 1.0 + 2.4 = 1.4$
$P(college = 1) = \Phi(1.4) = 0.919$
(b) Marginal effect of income:
$ME = \phi(1.4) \times 0.02 = 0.150 \times 0.02 = 0.003$
→ $1k increase in income → 0.3 percentage point increase in probability
(c) Effect of SAT increase:
New z-score: $z' = -2.0 + 0.02(50) + 0.002(1300) = 1.6$
$P(college = 1|SAT=1300) = \Phi(1.6) = 0.945$
Change: $0.945 - 0.919 = 0.026$
→ 100 point SAT increase → 2.6 percentage point increase
✓ Polynomial에서 marginal effect 계산 (변수에 따라 달라짐!)
✓ Log model 해석 (%, unit, elasticity 구분)
✓ Interaction 해석 (conditional effects)
✓ Fixed effects의 장단점
✓ DiD의 parallel trends assumption
✓ Probit/Logit marginal effects (After-Before method)
✓ Model selection (statistical + economic criteria)
Show all your work for partial credit!
마지막 당부
• 부분 점수를 받을 수 있습니다
• 계산 과정을 명확히 보여주세요
• 수식 설정 → 대입 → 계산 → 해석
2. Economic interpretation
• 숫자의 의미를 설명하세요
• "10% 증가"인지 "10 단위 증가"인지 명확히
• 현실적으로 합리적인가?
3. Check your answers
• Quadratic에서 maximum이 음수? → 뭔가 잘못됨
• Probability > 1? → 계산 오류
• Elasticity > 10? → 비현실적
4. Time management
• 쉬운 문제부터 해결
• 각 문제에 배점 비례 시간 할당
• 마지막 10분은 검토용
Good luck on your exam! You've got this! 💪