Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

232 ANSWERS CHAPTER 6 6.7.a. The data can be ..., Study notes of Descriptive statistics

The theoretical odds ratios and the odds ratios in the sample can be computed as follows. vector(5) tx. ' stores the 5 values of x vector(5) tratio_b. ' ...

Typology: Study notes

2021/2022

Uploaded on 09/27/2022

hugger
hugger 🇺🇸

4.7

(11)

922 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
232 ANSWERS CHAPTER 6
6.7.a. The data can be generated in EViews by means of the following program.
create exer6_7 u 1 200 create workfile
genr x = @trend(0) generate series x, ystar and y
genr ystar = -10 + 0.1*x + nrnd
genr y = (ystar >= 0)
b. The theoretical odds ratios and the odds ratios in the sample can be computed as follows.
vector(5) tx stores the 5 values of x
vector(5) tratio_b theoretical odds ratios
vector(5) ratio_b odds ratios in sample
tx.fill 60, 80, 100, 120, 140
for !i = 1 to 5 compute odds ratios
tratio_b(!i) = @cnorm(-10+0.1*tx(!i))/(1-@cnorm(-10+0.1*tx(!i)))
!s1 = (35+!i*20) begin of sample
!s2 = (45+!i*20) end of sample
smpl !s1 !s2 adjust sample
if @mean(y) <> 1 then
ratio_b(!i) = @mean(y)/(1-@mean(y))
else
ratio_b(!i) = na
endif
next end of for loop
smpl 1 200
scat x ystar scatter diagram
The theoretical and sample odds ratios are shown in Table S 6.2. The sample odds ratio for
95 xi105 (1.2) is quite close to the theoretical value of 1 for x= 100. For 55 xi65
and 75 xi85 all observed values of yiare zero, so the sample odds ratio is also zero. Note
that both intervals contain 11 observations, so that these outcomes could be expected on
the basis of the theoretical odds ratios (of zero and 0.023 respectively). Further, the sample
odds ratios for the intervals 115 xi125 and 135 xi145 can not be determined as all
yihave the value 1 in these two subsamples (as could be expected from the large theoretical
odds ratios for x= 120 and x= 140).
Figure S 6.3 shows the scatter diagram of yagainst x. Clearly, around x= 60 and x= 80
there are no values y>0, so that y= 0 in these intervals. For instance, for x= 80 there
holds y=10+8+εiso that P[y>0] = P[εi>2] = 0.023. For similar reasons, around
x= 120 and x= 140 there are no values y<0 (although in our simulation for xi= 127 the
corresponding value y
i= 0.479 comes quite close to zero), so that y= 1 in these intervals.
c. The results of OLS are shown in Table S 6.3, and the corresponding estimated odds ratios
are given in the third column of Table S 6.4. The OLS estimates of the odds ratios are very
imprecise. For small values of xthe odds ratio is much overestimated, whereas for large
values of xit is much underestimated. That is, the estimated effect of xon the odds ratio
is much smaller than the actual effect.
pf3

Partial preview of the text

Download 232 ANSWERS CHAPTER 6 6.7.a. The data can be ... and more Study notes Descriptive statistics in PDF only on Docsity!

232 ANSWERS CHAPTER 6

6.7.a. The data can be generated in EViews by means of the following program.

create exer6_7 u 1 200 ’ create workfile genr x = @trend(0) ’ generate series x, ystar and y genr ystar = -10 + 0.1*x + nrnd genr y = (ystar >= 0)

b. The theoretical odds ratios and the odds ratios in the sample can be computed as follows.

vector(5) tx ’ stores the 5 values of x vector(5) tratio_b ’ theoretical odds ratios vector(5) ratio_b ’ odds ratios in sample

tx.fill 60, 80, 100, 120, 140

for !i = 1 to 5 ’ compute odds ratios

tratio_b(!i) = @cnorm(-10+0.1tx(!i))/(1-@cnorm(-10+0.1tx(!i)))

!s1 = (35+!i20) ’ begin of sample !s2 = (45+!i20) ’ end of sample smpl !s1 !s2 ’ adjust sample if @mean(y) <> 1 then ratio_b(!i) = @mean(y)/(1-@mean(y)) else ratio_b(!i) = na endif

next ’ end of for loop

smpl 1 200 scat x ystar ’ scatter diagram

The theoretical and sample odds ratios are shown in Table S 6.2. The sample odds ratio for 95 ≤ xi ≤ 105 (1.2) is quite close to the theoretical value of 1 for x = 100. For 55 ≤ xi ≤ 65 and 75 ≤ xi ≤ 85 all observed values of yi are zero, so the sample odds ratio is also zero. Note that both intervals contain 11 observations, so that these outcomes could be expected on the basis of the theoretical odds ratios (of zero and 0.023 respectively). Further, the sample odds ratios for the intervals 115 ≤ xi ≤ 125 and 135 ≤ xi ≤ 145 can not be determined as all yi have the value 1 in these two subsamples (as could be expected from the large theoretical odds ratios for x = 120 and x = 140). Figure S 6.3 shows the scatter diagram of y∗^ against x. Clearly, around x = 60 and x = 80 there are no values y∗^ > 0, so that y = 0 in these intervals. For instance, for x = 80 there holds y∗^ = −10 + 8 + εi so that P [y∗^ > 0] = P [εi > 2] = 0.023. For similar reasons, around x = 120 and x = 140 there are no values y∗^ < 0 (although in our simulation for xi = 127 the corresponding value y i∗ = 0.479 comes quite close to zero), so that y = 1 in these intervals.

c. The results of OLS are shown in Table S 6.3, and the corresponding estimated odds ratios are given in the third column of Table S 6.4. The OLS estimates of the odds ratios are very imprecise. For small values of x the odds ratio is much overestimated, whereas for large values of x it is much underestimated. That is, the estimated effect of x on the odds ratio is much smaller than the actual effect.

EXERCISE 6.7 233

theoretical sample x ratio xi ratio 60 0. 000 55-65 0. 80 0. 023 75-85 0. 100 1. 000 95-105 1. 120 42. 956 115-125 na 140 31573. 386 135-145 na

Table S 6.2: Part (b) : Theoretical and sample odds ratios

0

4

8

12

0 40 80 120 160 200 240

X

YSTAR

Figure S 6.3: Part (b) : Scatter diagram of y∗^ against x

Dependent Variable: Y Method: Least Squares Date: 11/11/02 Time: 15: Sample: 1 200 Included observations: 200 Variable Coefficient Std. Error t-Statistic Prob. C -0.244573 0.036941 -6.620718 0. X 0.007409 0.000319 23.24516 0. R-squared 0.731830 Mean dependent var 0. Adjusted R-squared 0.730476 S.D. dependent var 0. S.E. of regression 0.260230 Akaike info criterion 0. Sum squared resid 13.40850 Schwarz criterion 0. Log likelihood -13.54488 F-statistic 540. Durbin-Watson stat 1.118403 Prob(F-statistic) 0.

Table S 6.3: Part (c) : OLS estimates

x Theoretical OLS Probit Logit 60 0. 000 0. 250 0. 000 0. 001 80 0. 023 0. 534 0. 026 0. 034 100 1. 000 0. 985 0. 919 0. 921 120 42. 956 1. 813 29. 722 24. 513 140 31573. 386 3. 822 10955. 660 657. 636

Table S 6.4: Part (c), (d) and (f) : Estimated odds ratios of OLS, Probit and Logit