Sunteți pe pagina 1din 9

Q1_(20 points)

(i) For a binary response y, let y be the proportion of ones in the sample (which is equal to
the sample average of the yi). Let q 0 be the percent correctly predicted for the outcome
y = 0 and let q1 be the percent correctly predicted for the outcome y=1. If p is the overall
percent correctly predicted, show that p is a weighted average of q0 and q1 :
p (1 y)q 0 yq1 . Hint: use the fact that y = n1/n , and 1 y = n0/n.


1 = (1 ) 100
1

0 + 1
= ( ) 100

0 1
= ( ) 100 + ( ) 100

0 0 1 1
= ( ) ( ) 100 + ( ) ( ) 100
0 1

= (1 )0 + 1

(ii) In a sample of 300, suppose that y =.70, so that there are 210 outcomes with yi = 1 and
90 with yi = 0. Suppose that the percent correctly predicted when y = 0 is 80, and the
percent correctly predicted when y = 1 is 40. Find the overall percent correctly predicted.

= 0 + 1 = 300

1 = 210 0 = 90

= .70 (1 ) = 1 .70 = .30

0
0 = ( ) 100 = 80
0

1
1 = ( ) 100 = 40
1

Given = (1 )0 + 1

= (1 )0 + 1

=.30(80)+.70(40)
= 24 + 28 = 52
Q2_ (20 points) Let gGDPt denote the annual percentage change in gross domestic product and
let intt denote a short-term interest rate. Suppose the gGDPt is related to interest rates by
gGDPt=0+0intt+1intt-
1+ut
where ut is uncorrelated with intt and intt-1, and all other past values of interest rates. Suppose
that the Federal Reserve follows the policy rule:
intt=0+1(gGDPt-1 3)+vt
where 1>0. (When last years GDP growth is above 3%, the Fed increases interest rates to
prevent an overheated economy.) If vt is uncorrelated with all past values of intt and ut, argue
that intt must be correlated with ut-1. (Hint: Lag the first equation for one time period and
substitute for gGDPt-1 in the second equation.) Which Gauss_Markov assumption does this
violate?

The Gauss-Markov assumption of strict exogeneity is being violated. Under the strict
exogeneity assumption, it is assumed that t must not only be uncorrelated with intt,
but also be uncorrelated with intt+1

Q3.

I. If the error follow Ar(2) or Ma(1), then standard error will be wrong. B/6 any strange
transformation will not be able to eliminate the serial correlation in Ut. The regression
estimates of the residuals having a single log can be expected to constantly calculated
correlation coefficient. On the other hand the variables which are transformed Ut-Put-1
are expected to have one correlation which is represented by P.
II. Remove the first observation then Cochrane Or crest estimates can be used. Which is
traditionally more robust for serial correlation.

= (1 )0 + 1 1 +
+
III. If the assumption of homoskedesticity is dropped than the error term will have
heteroskedesticity and also serial correlation but since newey west techniques solves
both of the problems at the same time before the assumption drop will not make any
difference.

Q4

a.
reg ecobuy regprc ecoprc faminc educ
Source | SS df MS Number of obs = 660
-------------+---------------------------------- F(4, 655) = 18.87
Model | 15.9986885 4 3.99967213 Prob > F = 0.0000
Residual | 138.813433 655 .211928905 R-squared =
0.1033
-------------+---------------------------------- Adj R-squared =
0.0979
Total | 154.812121 659 .234919759 Root MSE =
.46036
-----------------------------------------------------------------------------
-
ecobuy | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------
-
regprc | .7191028 .1319044 5.45 0.000 .4600963 .9781093
ecoprc | -.8075349 .1095927 -7.37 0.000 -1.02273 -.5923395
faminc | .0007103 .0005256 1.35 0.177 -.0003218 .0017424
educ | .0231783 .0083217 2.79 0.006 .0068378 .0395188
_cons | .4915496 .1409839 3.49 0.001 .2147148 .7683844
-----------------------------------------------------------------------------
-
The coefficient for ednit uc, 0.0231783, means that when regressed with the price of regular
apples, price of eco apples, and family income, for each additional year of education of the head
of the household, they are 2.3% more likely to buy eco apples.

b.

. predict p
(option xb assumed; fitted values)
. gen pecobuy=.
(660 missing values generated)
. replace pecobuy = 0 if p<0.5
(164 real changes made)
. replace pecobuy = 1 if p>=.5
(496 real changes made)
. gen pdiff = ecobuy-pecobuy
. bysort pdiff: sum pdiff
-----------------------------------------------------------------------------
-----------------------------------------
-> pdiff = -1
Variable | Obs Mean Std. Dev. Min Max
-------------+---------------------------------------------------------
pdiff | 152 -1 0 -1 -1
-----------------------------------------------------------------------------
-----------------------------------------
-> pdiff = 0
Variable | Obs Mean Std. Dev. Min Max
-------------+---------------------------------------------------------
pdiff | 440 0 0 0 0
-----------------------------------------------------------------------------
-----------------------------------------
-> pdiff = 1
Variable | Obs Mean Std. Dev. Min Max
-------------+---------------------------------------------------------
pdiff | 68 1 0 1 1

. display 440/(152 + 440 + 68)


.66666667
Model correctly predicts true outcome for ecobuy 67 percent of the time.

C.

. reg ecobuy regprc ecoprc faminc educ


Source | SS df MS Number of obs = 660
-------------+---------------------------------- F(4, 655) = 18.87
Model | 15.9986885 4 3.99967213 Prob > F = 0.0000
Residual | 138.813433 655 .211928905 R-squared =
0.1033
-------------+---------------------------------- Adj R-squared =
0.0979
Total | 154.812121 659 .234919759 Root MSE =
.46036
-----------------------------------------------------------------------------
-
ecobuy | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------
-
regprc | .7191028 .1319044 5.45 0.000 .4600963 .9781093
ecoprc | -.8075349 .1095927 -7.37 0.000 -1.02273 -.5923395
faminc | .0007103 .0005256 1.35 0.177 -.0003218 .0017424
educ | .0231783 .0083217 2.79 0.006 .0068378 .0395188
_cons | .4915496 .1409839 3.49 0.001 .2147148 .7683844
-----------------------------------------------------------------------------
-
. sort inseason
. by inseason: reg ecobuy regprc ecoprc faminc educ
-----------------------------------------------------------------------------
-----------------------------------------
-> inseason = 0
Source | SS df MS Number of obs = 438
-------------+---------------------------------- F(4, 433) = 12.69
Model | 11.0638104 4 2.76595261 Prob > F = 0.0000
Residual | 94.4087923 433 .218034162 R-squared =
0.1049
-------------+---------------------------------- Adj R-squared =
0.0966
Total | 105.472603 437 .24135607 Root MSE =
.46694
-----------------------------------------------------------------------------
-
ecobuy | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------
-
regprc | .7056992 .1620498 4.35 0.000 .3871973 1.024201
ecoprc | -.770603 .135215 -5.70 0.000 -1.036362 -.5048436
faminc | .000673 .0006301 1.07 0.286 -.0005655 .0019115
educ | .0318281 .0104014 3.06 0.002 .0113845 .0522716
_cons | .3198203 .1759456 1.82 0.070 -.0259932 .6656339
-----------------------------------------------------------------------------
-
-----------------------------------------------------------------------------
-----------------------------------------
-> inseason = 1
Source | SS df MS Number of obs = 222
-------------+---------------------------------- F(4, 217) = 6.37
Model | 5.07286573 4 1.26821643 Prob > F = 0.0001
Residual | 43.2199271 217 .199170171 R-squared =
0.1050
-------------+---------------------------------- Adj R-squared =
0.0885
Total | 48.2927928 221 .218519424 Root MSE =
.44628
-----------------------------------------------------------------------------
-
ecobuy | Coef. Std. Err. t P>|t| [95% Conf.
Interval]
-------------+---------------------------------------------------------------
-
regprc | .7506017 .2270641 3.31 0.001 .3030683 1.198135
ecoprc | -.8726983 .1869119 -4.67 0.000 -1.241094 -.504303
faminc | .0006958 .0009651 0.72 0.472 -.0012063 .0025979
educ | .0050164 .013895 0.36 0.718 -.0223701 .0324028
_cons | .8416836 .2349942 3.58 0.000 .3785202 1.304847
-----------------------------------------------------------------------------
-
. . display [138.813433-
(94.4087923+43.2199271)/5]/[(94.4087923+43.2199271)/(660-10)]
525.59523
Therefore, we reject Ho, and inseason is significant.

Q5
a.
. xtset year
panel variable: year (balanced)
. plot gdp1 year
2.7e+06 +
| *
|
|
|
|
| *
|
g |
d | *
p |
1 |
| *
| *
|
| *
| *
| *
| * *
| *
728011 + *
+----------------------------------------------------------------+
1995 year 2006
. generate lgdp1 = log(gdp1)
. plot lgdp1 year
14.8088 +
| *
|
|
| *
|
|
| *
l |
g | *
d | *
p |
1 | *
| *
|
| *
| *
| *
| *
|
13.4981 + *
+----------------------------------------------------------------+
1995 year 2006
Both plots seem to have a strong time trend, therefore we will de-trend

. reg gdp1 year


Source | SS df MS Number of obs = 684
-------------+---------------------------------- F(1, 682) = 6327.79
Model | 1.9928e+14 1 1.9928e+14 Prob > F = 0.0000
Residual | 2.1478e+13 682 3.1492e+10 R-squared = 0.9027
-------------+---------------------------------- Adj R-squared = 0.9026
Total | 2.2075e+14 683 3.2321e+11 Root MSE = 1.8e+05
------------------------------------------------------------------------------
gdp1 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
year | 156358.4 1965.599 79.55 0.000 152499 160217.7
_cons | -3.11e+08 3932187 -79.19 0.000 -3.19e+08 -3.04e+08
------------------------------------------------------------------------------
. predict p, residual
. plot p year
420299 +
| *
|
|
|
|
R |
e |
s |
i | *
d | *
u |
a | * *
l |
s |
| *
| *
| *
| *
| *
-210625 + * *
+----------------------------------------------------------------+
1995 year 2006

. reg gdp1 year


Source | SS df MS Number of obs = 684
-------------+---------------------------------- F(1, 682) = 6327.79
Model | 1.9928e+14 1 1.9928e+14 Prob > F = 0.0000
Residual | 2.1478e+13 682 3.1492e+10 R-squared = 0.9027
-------------+---------------------------------- Adj R-squared = 0.9026
Total | 2.2075e+14 683 3.2321e+11 Root MSE = 1.8e+05
------------------------------------------------------------------------------
gdp1 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
year | 156358.4 1965.599 79.55 0.000 152499 160217.7
_cons | -3.11e+08 3932187 -79.19 0.000 -3.19e+08 -3.04e+08
------------------------------------------------------------------------------

. reg lgdp1 year


Source | SS df MS Number of obs = 684
-------------+---------------------------------- F(1, 682) = 32803.31
Model | 96.4148284 1 96.4148284 Prob > F = 0.0000
Residual | 2.0045207 682 .00293918 R-squared = 0.9796
-------------+---------------------------------- Adj R-squared = 0.9796
Total | 98.4193491 683 .144098608 Root MSE = .05421
------------------------------------------------------------------------------
lgdp1 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
year | .1087593 .0006005 181.12 0.000 .1075803 .1099384
_cons | -203.481 1.201287 -169.39 0.000 -205.8397 -201.1224
------------------------------------------------------------------------------
. predict lp, residual
. plot lp year
.1186 +
| *
|
|
|
|
R |
e | *
s | *
i |
d |
u | *
a |
l | * *
s | *
| *
| *
| *
|
|
-.07837 + * *
+----------------------------------------------------------------+
1995 year 2006

No more upward trend.

B.

generate lx_tot = log(x_tot)


(8 missing values generated)
. generate lgdp2 = log(gdp2)
. generate ldist=log(dist)
. reg lx_tot lgdp2 ldist
Source | SS df MS Number of obs = 676
-------------+---------------------------------- F(2, 673) = 689.80
Model | 4034.16325 2 2017.08163 Prob > F = 0.0000
Residual | 1967.96855 673 2.92417317 R-squared = 0.6721
-------------+---------------------------------- Adj R-squared = 0.6711
Total | 6002.1318 675 8.89204711 Root MSE = 1.71
------------------------------------------------------------------------------
lx_tot | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
lgdp2 | 1.340624 .0369175 36.31 0.000 1.268137 1.413112
ldist | -.6806087 .1220113 -5.58 0.000 -.9201774 -.44104
_cons | 2.922422 1.193382 2.45 0.015 .5792215 5.265622
------------------------------------------------------------------------------
Coefficient of ldist, -0.68, means that for every increase in one unit of the log of distance, the log
of total exports to that country decreases by -0.68

C.
Ran regression on reg lx_tot lgdp2 ldist, then did
predict e, resid
(8 missing values generated)

. reg e, L.e
But i received an error on this line. It said missing time variable, even though i did xtset year
at the beginning.