Академический Документы
Профессиональный Документы
Культура Документы
(
cr imei =
(
f emalei =
1 if person i is female
0 otherwise
X
f emalei f emale cr imei
1 =
i =1
n
2
X
f emalei f emale
i =1
o = cr ime 1 f emale
(c) Suppose we have the following output from stata
Variable |
Obs
Mean
Std. Dev.
Min
Max
-------------+-------------------------------------------------------female |
2725
.3001835
.4584217
0
1
------------------------------------------------------------------------Number of females in the sample= 818
Number of female criminals in the sample= 55
Number of criminals in the sample= 196
Total number of observations= 2725
i. Calculate 1 and o
solution
First to calculate 1 , note that the denominator can be calculated in two different ways.
PAGE
A. When stata gives the standard deviation of f emalei it actually computes the bottom of 1 and
divides by N 1. The Std. Dev. it gives is nothing but the square root of that. So all we have to
do is square the Std. Dev. and multiply by N 1 = 2725 1 = 2724 we get
n
2
X
f emalei f emale2 = N 1 Std .Dev .
i =1
= 2724 .45842172
= 572.45
B. The second way we could do this is by looking at the denominator and try to simplify what it is.
n
n
2 X
X
2
f emalei f emale =
f emalei2 N f emale
i =1
i =1
n
X
f emalei N
i =1
Nf 2
where, Nf is the number of females in the sample. Also denote the number of males in the
sample by Nm .
N2
= Nf f
N
N Nf
= Nf
N
Nf Nm
=
N
X
X
X
f emalei f emale cr imei =
f emalei cr imei f emale
cr imei
i =1
i =1
i =1
You should convince your self that the first element on the LHS is nothing but the number of female
criminals. This is because the variable f emalei cr imei is either 0 or 1 and takes the value 1 when
the person in the sample is a female and a criminal. Denote this number by Nf c . denote the number
of criminals by Nc
= Nf c
Nf
Nc
N
= 55 818/2725 196
= 3.84
Therefore,
3.84
b1 =
572.45
= 0.0067
Page 2 of 17
PAGE
and,
o = cr ime 1 f emale
196
818
=
0.0067
2725
2725
= 0.0739
ii. Calculate
2
solution
First we need to get the SSR. To do this, let ci denote cr imei (less messy), and note that
(
ci2 + o2 2 o ci
ci o
if male
u i =
u i2 =
ci2 + o + 1 2 o + 1 ci
ci o 1 if female
ci + o2 2 o ci
u i2 =
ci + o + 1 2 o + 1 ci
if male
if female
if male
if female
Nmc + Nm o2 2Nmc o
if male
2
u i =
Nf c + Nf o + 1 2Nf c o + 1 if female
i =1
n
X
Where, Nmc , Nf c are the number of male and female criminals respectively.
u i2 =
u i2 =
51.302
for females
i =1
n
X
Finally
n
X
u i2 = 181.8767, and
2 = 0.0668
i =1
iii. test if females and males have the same tendencies for criminal activities by conducting a t-test.
solution
The test is a t-test and we need
q the t-stat which means we need the standard error. This is
2
0.0668
=
n
572.45 = 0.0108 and its t-value is -0.62. So we cannot reject
2
X
f emalei f emale
i =1
the null that males and females likelihood of committing a crime are different from each other
iv. test if females and males have the same tendencies for criminal activities by conducting a F-test The
easiest way to do this is to square the t-test and get F(1,2723) = 0.386. This simply because the f-tets
is the square of the t-test when we only have one independent variable.
Question-2 Show that the F-stat
SSRr SSRu/q
SSRu/N k 1
Ru2 Rr2/q
1Ru2/N k 1
solution
First note that the T SS =
n
2
X
yi y does not change no matter how we estimate the model. Therefore
i =1
Page 3 of 17
PAGE
SSRr/T SS SSRu/T SS
/q
SSRu/T SS
/ N k 1
T SS ESSr /T SS T SS ESSu /T SS
/q
T SS ESSu
/T SS/N k 1
1 ESSr/T SS 1 + ESSu/T SS
1ESSu/T SS/N k 1
2
Ru Rr2/q
=
1Ru2/N k 1
=
y2 =
i =1
n
n1
n
2
X
yi y
i =1
2
X
yi y
X
2
i
=1
2
+
E y = E
y
n
n
i
=1
n
2
X
yi y
2
X
i =1
yi y
+ E
= E
E
n
n
i =1
n
2
X
yi y
i
=1
=
See your lecture notes for E
n
and, E n1
=
n1 2
n
n1
n
2
X
yi y
n
2
i
=1
and, E
y
y
=
n
E
=n
i =1
=
=
=
n1 2
= n 1 2 , therefore
n1 2
n
+ n 1 2
n
n1
n + 1 n 1
n
n
n1
n2 1 2
n
n
n1
Page 4 of 17
PAGE
(b) Is
y2 biased
solution
Since E
y2 6= y2
y2 is a biased estimator
(c) If the answer above was yes, how would you correct for this bias
solution
n
We first need to subtract n1
and multiply the left over with n2n1
n
n
2
+
y
n2 1
n1
n
2
X
yi y
X
2
n
n
n
i =1
+
y
y
+
= 2
n 1
n
n1
n 1
i =1
n
2
X
yi y
X
2
n
i
=1
yi y
+
= 2
n 1
n
i =1
y2 =
n + 1 X
yi y
n2 1
i =1
Maximum Likelihood
Question-4 Suppose that X1 , X2 , Xn are independent Poisson distributed random variables with mean > 0.i.e
P (X = x ) =
x e
x!
L=
n
Y
xi e
xi !
i =1
Pn
x
i =1 i
Qn
en
i =1
xi !
log L =
n
X
i =1
xi log n
n
X
log xi !
i =1
Page 5 of 17
PAGE
xi
log L = i =1
= x
n =0
1 e
2
2
1 ui
2 2
L=
n
Y
i =1
n
Y
f (ui )
i =1
n
Y
2
1 ui
1
e 2 2
2
2
1 yi o
1
2
e 2
2
i =1
2
1 Pn
yi o
1
2
i =1
2
=
e
2
n
1 X
log L
yi o = 0
=
+
2
2
4
2
2
(1)
log L
2 X
yi o = 0
=
o
2 2
(2)
i =1
i =1
n
X
yi y
n
i =1
Chapter-7 2, 4, 6, 8; C2, C4
Page 6 of 17
PAGE
solution
Page 7 of 17
PAGE
Page 8 of 17
PAGE
Page 9 of 17
PAGE
10
Page 10 of 17
PAGE
11
Chapter-8 2, 4, C6, C8
Page 11 of 17
PAGE
12
solution
Page 12 of 17
PAGE
13
Page 13 of 17
PAGE
14
Page 14 of 17
PAGE
15
Chapter-17 1,2,C2
solution
Page 15 of 17
PAGE
16
Page 16 of 17
PAGE
End of Assignment # 2
Total pages: 17
17