You are on page 1of 3

ECON2280- Tutorial 4_2019 fall Saturday October 5 16:13:47 2019 Page 1

___ ____ ____ ____ ____(R)


/__ / ____/ / ____/
___/ / /___/ / /___/
Statistics/Data Analysis
User: J. zhao
Project: ECON2280- Tutorial 4_2019 fall{space -8}

name: <unnamed>
log: D:\1_HKU Teaching\2019-2020\Sem 1\ECON2280\Tutorial\T4\ECON2280_T4.smcl
log type: smcl
opened on: 5 Oct 2019, 16:12:03
1 . insheet using "D:\1_HKU Teaching\2019-2020\Sem 1\ECON2280\Tutorial\T4\c1.csv"
(3 vars, 8 obs)

2 . reg y x1 x2
Source SS df MS Number of obs = 8
F( 2, 5) = 13.55
Model 50.2334154 2 25.1167077 Prob > F = 0.0096
Residual 9.26658463 5 1.85331693 R-squared = 0.8443
Adj R-squared = 0.7820
Total 59.5 7 8.5 Root MSE = 1.3614

y Coef. Std. Err. t P>|t| [95% Conf. Interval]

x1 1.793612 .4267835 4.20 0.008 .6965299 2.890694


x2 6.412776 3.364366 1.91 0.115 -2.235602 15.06115
_cons 5.479115 2.455794 2.23 0.076 -.8337037 11.79193

3 . reg x1 x2

Source SS df MS Number of obs = 8


F( 1, 6) = 0.41
Model .699999911 1 .699999911 Prob > F = 0.5443
Residual 10.1750001 6 1.69583335 R-squared = 0.0644
Adj R-squared = -0.0916
Total 10.875 7 1.55357143 Root MSE = 1.3022

x1 Coef. Std. Err. t P>|t| [95% Conf. Interval]

x2 2 3.112953 0.64 0.544 -5.617122 9.617121


_cons 3.775 1.772949 2.13 0.077 -.5632498 8.11325

4 . predict u_hat2, residual


5 . reg y u_hat2

Source SS df MS Number of obs = 8


F( 1, 6) = 7.34
Model 32.7334158 1 32.7334158 Prob > F = 0.0352
Residual 26.7665842 6 4.46109737 R-squared = 0.5501
Adj R-squared = 0.4752
Total 59.5 7 8.5 Root MSE = 2.1121

y Coef. Std. Err. t P>|t| [95% Conf. Interval]

u_hat2 1.793612 .6621458 2.71 0.035 .1733994 3.413824


_cons 17.75 .7467511 23.77 0.000 15.92277 19.57723
ECON2280- Tutorial 4_2019 fall Saturday October 5 16:13:51 2019 Page 2
6 . clear

7 . use "D:\1_HKU Teaching\2019-2020\Sem 1\ECON2280\Data Sets- STATA\discrim.dta", clear


8 . sum prpblck income
Variable Obs Mean Std. Dev. Min Max

prpblck 409 .1134864 .1824165 0 .9816579


income 409 47053.78 13179.29 15919 136529

9 . reg psoda prpblck income


Source SS df MS Number of obs = 401
F( 2, 398) = 13.66
Model .202552215 2 .101276107 Prob > F = 0.0000
Residual 2.95146493 398 .007415741 R-squared = 0.0642
Adj R-squared = 0.0595
Total 3.15401715 400 .007885043 Root MSE = .08611

psoda Coef. Std. Err. t P>|t| [95% Conf. Interval]

prpblck .1149882 .0260006 4.42 0.000 .0638724 .1661039


income 1.60e-06 3.62e-07 4.43 0.000 8.91e-07 2.31e-06
_cons .9563196 .018992 50.35 0.000 .9189824 .9936568

10 . reg psoda prpblck

Source SS df MS Number of obs = 401


F( 1, 399) = 7.34
Model .057010466 1 .057010466 Prob > F = 0.0070
Residual 3.09700668 399 .007761922 R-squared = 0.0181
Adj R-squared = 0.0156
Total 3.15401715 400 .007885043 Root MSE = .0881

psoda Coef. Std. Err. t P>|t| [95% Conf. Interval]

prpblck .0649269 .023957 2.71 0.007 .0178292 .1120245


_cons 1.037399 .0051905 199.87 0.000 1.027195 1.047603

11 . corr prpblck income


(obs=409)
prpblck income

prpblck 1.0000
income -0.4335 1.0000

12 . reg lpsoda prpblck lincome


Source SS df MS Number of obs = 401
F( 2, 398) = 14.54
Model .196020672 2 .098010336 Prob > F = 0.0000
Residual 2.68272938 398 .006740526 R-squared = 0.0681
Adj R-squared = 0.0634
Total 2.87875005 400 .007196875 Root MSE = .0821
ECON2280- Tutorial 4_2019 fall Saturday October 5 16:13:51 2019 Page 3

lpsoda Coef. Std. Err. t P>|t| [95% Conf. Interval]


prpblck .1215803 .0257457 4.72 0.000 .0709657 .1721948
lincome .0765114 .0165969 4.61 0.000 .0438829 .1091399
_cons -.793768 .1794337 -4.42 0.000 -1.146524 -.4410117

13 . reg lpsoda prpblck lincome prppov


Source SS df MS Number of obs = 401
F( 3, 397) = 12.60
Model .250340622 3 .083446874 Prob > F = 0.0000
Residual 2.62840943 397 .006620679 R-squared = 0.0870
Adj R-squared = 0.0801
Total 2.87875005 400 .007196875 Root MSE = .08137

lpsoda Coef. Std. Err. t P>|t| [95% Conf. Interval]

prpblck .0728072 .0306756 2.37 0.018 .0125003 .1331141


lincome .1369553 .0267554 5.12 0.000 .0843552 .1895553
prppov .38036 .1327903 2.86 0.004 .1192999 .6414201
_cons -1.463333 .2937111 -4.98 0.000 -2.040756 -.8859092

14 . corr lincom prppov


(obs=409)

lincome prppov

lincome 1.0000
prppov -0.8385 1.0000

15 . log close
name: <unnamed>
log: D:\1_HKU Teaching\2019-2020\Sem 1\ECON2280\Tutorial\T4\ECON2280_T4.smcl
log type: smcl
closed on: 5 Oct 2019, 16:12:46

You might also like