11 OLS 2018 7 13 1 / 45
1. 2. 3. 2 / 45
n 2 ((y 1, x 1 ), (y 2, x 2 ),, (y n, x n )) linear regression model y i = β 0 + β 1 x i + u i, E(u i x i ) = 0, E(u i u j x i ) = 0 (i j), V(u i x i ) = σ 2, i = 1, 2,, n 3 / 45
y i explained variable e.g., dependent variable x i explanation variable e.g., independent variable β 0, β 1 regression coefficient β0 constant term u i error term disturbance term x i stochastic 4 / 45
1 simple regression model E(u i x i ) = 0 E(y i x i ) = β 0 + β 1 x i. x i y i conditional mean E(y i x i ) y i x i regress β 0 β 1 5 / 45
y O x 6 / 45
y u 5 u 7 u 2 u 3 u 4 u 6 u 1 β 0 β 1 O x 7 / 45
n ei 2 = i=1 y i = ˆβ 0 + ˆβ 1 x i + e i n ) 2 (y i ˆβ 0 ˆβ 1 x i i=1 ˆβ 0 ˆβ 1 e i residual ui n ei 2 i Ordinary Least Squares, OLS 8 / 45
OLS OLS OLS estimator OLS OLS estimate OLS ˆβ 0 = ȳ ˆβ 1 x, ni=1 (x i x) (y i ȳ) ˆβ 1 = ni=1 (x i x) 2. ȳ = 1 n x = 1 n n y i. i=1 n x i. i=1 9 / 45
multiple regression model k y i = β 0 + β 1 x i1 + β 2 x i2 + + β k x ik + u i, i = 1, 2,, n. 10 / 45
y 1 = β 0 + β 1 x 11 + β 2 x 12 + + β k x 1k + u 1, y 2 = β 0 + β 1 x 21 + β 2 x 22 + + β k x 2k + u 2,. y n = β 0 + β 1 x n1 + β 2 x n2 + + β k x nk + u n. y 1 y 2. y n = 1 x 11 x 12 x 1k 1 x 21 x 22 x 2k....... 1 x n1 x n2 x nk β 0 β 1 β 2. β n + u 1 u 2.. u n 11 / 45
y 1 1 x 11 x 12 x 1k β 0 y = y 2., X = 1 x 21 x 22 x 2k β 1......., β = β 2, y n 1 x n1 x n2 x nk. β n u 1 u = u 2. u n y = X β + u, E(u X) = 0, V(u X) = σ 2 I n. 12 / 45
n ei 2 = e e = i=1 y = X ˆβ + e, ( ) ( ) y X ˆβ y X ˆβ, OLS ˆβ = (X X) 1 X y. e = e 1 e 2.. e n 13 / 45
OLS E(u X) = 0. σ 2 0 0 0 σ 2 0 V(u X) =..... = σ 2 I. n. 0 0 σ 2 u X N ( 0, σ 2 I n ). 14 / 45
c i = β 0 + β 1 y i + u i (1) ci : y i : c i = β 0 + β 1 y i + β 2 m i + u i (2) mi : 15 / 45
1 1. Stata 2. File Log Begin... 2018microdata1 lecture20180713.smcl 3. File Open 4. consumption2009.dta 16 / 45
5. Statistics Linear models and related Linear regression 6. Model Dependent variable: expenditure_th expenditure_th 7. Independent variable: income_th income_th 17 / 45
8. Reporting Set table formats 9. Coef/SE/CI Decimal format 2 decimals 2 10. p-value Decimal format 3 decimals p 3 11. Test statistic Decimal format 2 decimals t 2 12. Format settings for coefficient tables OK 13. regress - Linear regression OK 18 / 45
Coef.: Std. Err.: t: 0 t t P> t : p Number of obs: R-squared: Adj R-squared: 19 / 45
R-squared ni=1 R 2 (ŷ i ȳ) 2 ni=1 = ni=1 (y i ȳ) 2 = 1 ei 2 ni=1 (y i ȳ) 2. k ŷ i = ˆβ 0 + ˆβ 1 x i1 + ˆβ 2 x i2 + + ˆβ k x ik. 0 R 2 1. R 2 = 0 : R 2 = 1 : R 2 = 0 R 2 = 1 20 / 45
R 2 R 2 R 2 adjusted R-squared ( R 2 = 1 1 R 2) n 1 n k 1. R 2 R 2 21 / 45
standard error j OLS ˆβ j ( ) [ ] e s.e. ˆβ j = e n k 1 (X X) 1. j,j i V(u i X) 22 / 45
V(u i X) heteroskedasticity robust standard error Stata White regress - Linear regression SE/Robust Standard error type: Robust Bias correction n/n-k Stata White 23 / 45
u i Stata R 2 R 2 24 / 45
β j j = 0, 1, 2,, k H 0 : β j = 0 vs H 1 : β j 0 25 / 45
H 0 0 0 0 H 0 0 0 0 26 / 45
p p 0.1 10% H 0 p 0.05 5% H 0 p 0.01 1% H 0 27 / 45
t β j = 0 H 0 t t = ˆβ j ( ) t(n k 1). s.e. ˆβ j t 2 H 0 % H 0 t p 28 / 45
2 1. Statistics Linear models and related Linear regression 2. SE/Robust Standard error type: Robust White 3. OK 29 / 45
0.45 1% H0 78.68 1% H0 0 R 2 = 0.3132. 31% R 2 pp.16, 28 30 / 45
3 1. Statistics Linear models and related Linear regression 2. Model Independent variable: deposit_th income_th deposit_th Back space 3. SE/Robust Standard error type: Default standard errors 4. OK 31 / 45
4 1. Statistics Linear models and related Linear regression 2. SE/Robust Standard error type: Robust White 3. OK 32 / 45
0.43 1% H0 1 0.02 H0 5% H0 80.43 1% H0 0 33 / 45
R 2 = 0.3179. R 2 32% White t 34 / 45
t p R 2 R 2 Note *** ** * 1% 5% 10% 35 / 45
Note Note 2 4 t p t 2 p R 2 R 2 3 36 / 45
5 1. Word results20180713.docx 2018microdata1 2. 7 6 3. 4. OK 1 5. 1 37 / 45
6. 2 2 2 3 t 2 5 2 6 t 7. 2 2 2 7 8. 3 1 4 1 5 1 6 1 9. 3 1 6 1 38 / 45
10. 1 1 2 1 11. 1 2 1 4 1 12. 1 5 1 7 2 39 / 45
13. Stata income_th Word 1 Edit Copy income_th const coef. t t Number of obs Adj R-squared 6 2 40 / 45
14. t p P> t 0.01 *** 0.05 ** 0.10 * 15. 3 2 6 3 16. 3 4 5 4 41 / 45
17. Stata income_th deposit_th Word 2 Edit Copy deposit_th 6 6 18. t p 0.01 *** 0.05 ** 0.10 * 42 / 45
19. 3 5 6 6 20. 3 7 5 7 43 / 45
21. Word 1 *** ** 1% 5% 2 3 92 2018microdata1 1 10% 44 / 45
6 1. File Log Close 2. Stata lecture20180713.smcl 2018microdata1 3. lecture20180713.smcl 45 / 45