Bài tập KTL - Exercise

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 14

Bài 1

. reg wage educ exper nonwhite female married south

Source | SS df MS Number of obs = 526 (n)


-------------+------------------------------ F( 6, 519) = 41.18
SSE-Model | 2309.32588 6(k) 384.887647 Prob > F = 0.0000
SSR-Residual | 4851.08841 519 9.34699115 R-squared = 0.3225
-------------+------------------------------ Adj R-squared = 0.3147
SST-Total | 7160.41429 525 13.6388844 Root MSE = 3.0573

------------------------------------------------------------------------------
wage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
educ | .5694223 .0519968 10.95 0.000 .4672723 .6715723
exper | .0552699 .011024 5.01 0.000 .0336127 .076927
nonwhite | .0729731 .4437979 0.16 0.869 -.7988879 .9448342
female | -2.092037 .2717096 -7.70 0.000 -2.625823 -1.558251
married | .7150305 .2975101 2.40 0.017 .1305585 1.299503
south | -.6416218 .2830282 -2.27 0.024 -1.197644 -.0856001
_cons | -1.410051 .7743316 -1.82 0.069 -2.93126 .1111587
------------------------------------------------------------------------------

SRF:
wage = -1.41 + 0.569educ + 0.055exper+0.072nonwhite -
2.092female+0.715married-0.641south +u^

Wage^ = -1.41 + 0.569educ + 0.055exper+0.072nonwhite -


2.092female+0.715married-0.641south
• R-squared = 0.3225
• It means that the independent variables in the model can
explain 32.25% of the variation of wage.
• So, 67.75% (=100%-32.25%) of the variation of wage is
explained by other variables that are not included in
the model. By theory, they are included in u (error
term/ residual).
Bài 2

. reg wage educ exper nonwhite female married south, robust

Linear regression Number of obs = 526


F( 6, 519) = 26.91
Prob > F = 0.0000
R-squared = 0.3225
Root MSE = 3.0573

------------------------------------------------------------------------------
| Robust
wage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
educ | .5694223 .0657564 8.66 0.000 .4402409 .6986037
exper | .0552699 .0103954 5.32 0.000 .0348477 .075692
nonwhite | .0729731 .3861896 0.19 0.850 -.6857137 .83166
female | -2.092037 .2538627 -8.24 0.000 -2.590762 -1.593312
married | .7150305 .2672913 2.68 0.008 .1899247 1.240136
south | -.6416218 .2715594 -2.36 0.019 -1.175113 -.108131
_cons | -1.410051 .8691299 -1.62 0.105 -3.117496 .2973942
------------------------------------------------------------------------------
Bài 3
Source | SS df MS Number of obs = 1387
-------------+------------------------------ F( 5, 1381) =
Model | 28988.0176 5 5797.60351 Prob > F = 0.0000
Residual | 545486.724 1381 394.994007 R-squared =
-------------+------------------------------ Adj R-squared = 0.0470
Total | 574474.741 1386 414.48394 Root MSE = 19.874

------------------------------------------------------------------------------
bwght | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
cigs | -.5014951 .0915656 -5.48 0.000 -.6811179 -.3218723
parity | 1.79824 .603 2.98 0.003 .6153453 2.981135
male | 3.078625 1.068652 2.88 0.004 .9822692 5.174982
white | 6.36384 1.310043 4.86 0.000 3.793952 8.933729
motheduc | .2697001 .2325746 1.16 0.246 -.1865376 .7259379
_cons | 106.7333 3.461357 30.84 0.000 99.94326 113.5234
------------------------------------------------------------------------------
bwght int %8.0g birth weight, ounces
cigs byte %8.0g cigs smked per day while preg
parity byte %8.0g birth order of child
male byte %8.0g =1 if male child
white byte %8.0g =1 if white
motheduc byte %8.0g mother's yrs of educ

1. Viết hàm SRF


2. Tính và giải thích ý nghĩa của hệ số xác định R2
3. Kiểm định sự phù hợp của mô hình
4. Kiểm định và giải thích ý nghĩa của biến cigs; male; motheduc với 3
phương pháp: kiểm định t, p-value, khoảng tin cậy
Bài 4
Source | SS df MS Number of obs = 1260
-------------+------------------------------ F( 8, 1251) = 29.51
Model | 4341.73975 8 542.717468 Prob > F = 0.0000
Residual | 23005.6994 1251 18.3898477 R-squared = 0.1588
-------------+------------------------------ Adj R-squared = 0.1534
Total | 27347.4392 1259 21.7215561 Root MSE = 4.2883
------------------------------------------------------------------------------
wage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
looks | .6252181 .1790031 3.49 0.000 .2740387 .9763975
union | .5564871 .2739391 2.03 0.042 .0190562 1.093918
goodhlth | .1983287 .490779 0.40 0.686 -.764512 1.161169
black | -.3063812 .4700496 -0.65 0.515 -1.228554 .6157913
female | -2.398656 .2751384 -8.72 0.000 -2.93844 -1.858873
married | .3874926 .2869665 1.35 0.177 -.175496 .9504813
exper | .2726329 .0404318 6.74 0.000 .1933113 .3519546
expersq | -.0047333 .0008924 -5.30 0.000 -.006484 -.002982
_cons | 1.845306 .8706818 2.12 0.034 .1371483 3.553463
------------------------------------------------------------------------------
wage float %9.0g hourly wage
exper byte %8.0g years of workforce experience
looks byte %8.0g from 1 to 5
union byte %8.0g =1 if union member
goodhlth byte %8.0g =1 if good health
black byte %8.0g =1 if black
female byte %8.0g =1 if female
married byte %8.0g =1 if married

1. Write SRF
2. Calculate R-square and explain the meaning of R-squared
3. Test for the overall significance of the model
4. Test for the significance of each independent variable with 3 methods: critical
value, p-value and confidence interval
Bài 5
Source | SS df MS Number of obs = 1387
-------------+------------------------------ F( 6, 1380) = 12.77
Model | 30215.0262 6 5035.83771 Prob > F = 0.0000
Residual | 544259.715 1380 394.391098 R-squared = 0.0526
-------------+------------------------------ Adj R-squared = 0.0485
Total | 574474.741 1386 414.48394 Root MSE = 19.859

------------------------------------------------------------------------------
bwght | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
faminc | .0591903 .0335575 1.76 0.078 -.006639 .1250196
cigs | -.4864302 .0918935 -5.29 0.000 -.6666963 -.3061642
male | 3.176597 1.069279 2.97 0.003 1.079008 5.274186
parity | 1.805121 .6025522 3.00 0.003 .6231034 2.987138
white | 5.678583 1.365476 4.16 0.000 2.999949 8.357217
motheduc | .0793044 .2562425 0.31 0.757 -.4233625 .5819713
_cons | 107.921 3.523649 30.63 0.000 101.0087 114.8333

1. Write SRF
2. Calculate R-square and explain the meaning of R-squared
3. Test for the overall significance of the model
4. Test for the significance of 3 independent variables (faminc, cigs, male) with 3
methods: critical value, p-value and confidence interval; and explain the meaning
of varibables.

bwght int %8.0g birth weight, ounces


faminc family income, $
cigs byte %8.0g cigs smked per day while preg
parity byte %8.0g birth order of child
male byte %8.0g =1 if male child
white byte %8.0g =1 if white
motheduc byte %8.0g mother's yrs of educ

Bài 6
Source | SS df MS Number of obs = 88
-------------+------------------------------ F( 3, 84) =
Model | 309231.224 3 103077.075 Prob > F = 0.0000
Residual | 608623.281 84 7245.51526 R-squared =
-------------+------------------------------ Adj R-squared = 0.3132
Total | 917854.506 87 10550.0518 Root MSE = 85.121

------------------------------------------------------------------------------
price | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
bdrms | 57.68736 11.49826
lotsize | .0028554 .0009058
colonial | -2.202985 20.66589
_cons | 63.47836 39.90354

storage display value


variable name type format label variable label
-----------------------------------------------------------------
price float %9.0g house price, $1000s
bdrms byte %9.0g number of bdrms
lotsize float %9.0g size of lot in square feet
colonial byte %9.0g =1 if home is colonial style

1. Write SRF
2. Calculate R-square and explain the meaning of R-squared
3. Test for the overall significance of the model
4. Test for the significance of each independent variable with 3 methods: critical
value, p-value and confidence interval; and explain the meaning of variables.
Intepreting the meaning of independent variables
Bdrms (reject Ho)
- Number of bedrooms have statistically significant effect on the house price. And the
effect is positive (because ^β >0 ¿.
bdrms

- Given the sample we have, when number of bedrooms increase by 1 room, the
average price of house increases by 57.68736 thousand USD, holding other
factors fixed.

Lotsize (reject Ho)


- size of lot in square feet has statistically significant effect on the house price. And
the effect is positive (because ^β >0).
lotsize

- Given the sample we have, when size of lot increases by 1 square feet, the average
price of house increases by .0028554 thousand USD, holding other factors fixed.

Colonial (Not reject Ho)


- Having colonial style or not does not have statistically significant effect on the
house price.
Bài 7

Source | SS df MS Number of obs = 141


-------------+------------------------------ F( 5, 135) = 3.38
Model | 2.15692562 5 .431385123 Prob > F = 0.0066
Residual | 17.2491738 135 .127771658 R-squared = 0.1111
-------------+------------------------------ Adj R-squared = 0.0782
Total | 19.4060994 140 .138614996 Root MSE = .35745

------------------------------------------------------------------------------
colGPA | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
soph | .3056211 .2102452 1.45 0.148 -.1101791 .7214214
male | -.0030009 .0624554 -0.05 0.962 -.1265185 .1205166
campus | -.1272217 .0828543 -1.54 0.127 -.291082 .0366386
clubs | .1072495 .0625 1.72 0.088 -.0163563 .2308552
skipped | -.0922866 .0290847 -3.17 0.002 -.1498072 -.034766
_cons | 3.108133 .0662338 46.93 0.000 2.977143 3.239123
------------------------------------------------------------------------------
1. Write SRF
2. Calculate R-square and explain the meaning of R-squared
3. Test for the overall significance of the model
4. Test for the significance of each independent variable with 3 methods: critical
value, p-value and confidence interval

colGPA: College GPA


Soph =1 if sophomore
Male = 1 if male
Campus = 1 if living in campus
Clubs = 1 if joining a club
Skipped: numbers of classes skipped
Bài 8
Source | SS df MS Number of obs = 173
-------------+------------------------------ F( 2, 170) = 25.47
Model | 11170.8751 2 5585.43753 Prob > F = 0.0000
Residual | 37286.3735 170 219.331609 R-squared = 0.2305
-------------+------------------------------ Adj R-squared = 0.2215
Total | 48457.2486 172 281.728189 Root MSE = 14.81

------------------------------------------------------------------------------
voteA | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
democA | 9.192198 2.267415 4.05 0.000 4.716283 13.66811
expendA | .0242475 .004022 6.03 0.000 .016308 .0321869
_cons | 37.87049 2.129706 17.78 0.000 33.66642 42.07457

democA byte %3.2f =1 if A is democrat


voteA byte %5.2f percent vote for A
expendA float %8.2f camp. expends. by A, $1000s

1. Write SRF
2. Calculate R-square and explain the meaning of R-squared
3. Test for the overall significance of the model
4. Test for the significance of each independent variable with 2 methods: critical
value, p-value and confidence interval; and explain the meaning of varibables.
Democrat
Reject Ho
- Being democrat has statistically significant effect on voteA
- The estimated results show that being democrate will increase voteA by 9.19%
compared with not being democrat, holding other factors fixed.

ExpendA
Reject Ho
- Expenditure on compaign of A has statistically significant effect on voteA
- The estimated results show that when expenditure on compaign of A increase 1 unit,
voteA will increase by 0.024 unit.
Bài 9

Source | SS df MS Number of obs = 88


-------------+------------------------------ F( 3, 84) =
(SSE)Model | 309231.224 3 103077.075 Prob > F = 0.0000
(SSR)Residual | 608623.281 84 7245.51526 R-squared =
-------------+------------------------------ Adj R-squared = 0.3132
(SST)Total | 917854.506 87 10550.0518 Root MSE = 85.121

------------------------------------------------------------------------------
price | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
bdrms | 57.68736 11.49826
lotsize | .0028554 .0009058
colonial | -2.202985 20.66589
_cons | 63.47836 39.90354

storage display value


variable name type format label variable label
-----------------------------------------------------------------
price float %9.0g house price, $1000s
bdrms byte %9.0g number of bdrms
lotsize float %9.0g size of lot in
square feet
colonial byte %9.0g =1 if home is
colonial style

1. Write SRF
2. Calculate R-square and explain the meaning of R-squared
3. Test for the overall significance of the model
4. Test for the significance of each independent variable with 2 methods: critical
value and confidence interval.
Một số ví dụ câu hỏi trắc nghiệm:

1. Your data produce the regression result: Y^ i = 8 + 5 X i . If the x values were scaled by multiplying
them by 0.5, the new intercept and slope estimates will be:
a. 4 and 2.5
b. 8 and 2.5
c. 8 and 10
d. 16 and 10

2. Consider the following estimated model:


Y^ i = -24.5 + 12 X 2 i −¿ 8 X 3 i . We observe that Y i = 125, X 2 i = 13 and X 3 i = 5. What is the value of

the residual of this observation?


a. 33.5
b. -15.5
c. -46.5
d. 69.5

3. Studying inflation in the United States from 1970 to 2006 is an example of using
a. randomized controlled experiments.
b. time series data.
c. panel data.
d. cross-sectional data.
4. Which of the following models allows the marginal effect of X on Y to change?
a. Y i = β 1 + β 2 X i + ui
b. Ln(Y i) = β 1 + β 2 X i + β 3 Z i + ui
c. Y i = β 1 + β 2 X i + β 3 Z i + β 4 Z 2i + ui
d. None of the above.

You might also like