Академический Документы
Профессиональный Документы
Культура Документы
Page: 1
Problem 1(a)
Problem 1(b). Now we assume that results are from the logit model.
We should evaluate the three terms at x1 = 1 and x2 = 2.
∂p ∂p
i ∂x1 = 0.60p(1−p) = 0.60λ(Xβ) and ∂x2 = −0.40p(1−p) = −.40λ(Xβ).
Econometrics II, Solutions to PS4, Summer 2010. Page: 2
Thus
exp(Xβ) exp(0.30 + 0.60(1) − 0.40(2))
λ(Xβ) = 2
= = 0.2494
[1 + exp(Xβ)] [1 + exp(0.30 + 0.60(1) − 0.40(2))]2
∂p ∂p
Then we get ∂x1 = 0.1496 and ∂x2 = −0.0998
∂(1−p) ∂(1−p)
ii ∂x1 = −0.1496 and ∂x2 = 0.0998
p ∂(l) ∂(l)
iii l = log( 1−p ) = 0.30 + 0.60x1 − 0.40x2 , so ∂x1 = 0.60 and ∂x2 = −0.40
Problem 3(i). 166 out of 401 participated in the job training program.
The highest number of months a man participated was 24.
Problem 3(ii). The F -statistic for the joint significance of the ex-
planatory variables is F (7, 393)=1.40 with the respective p−value of 0.2027.
Hence the explanatory variables are jointly insignificant even at the 20 per
cent level.
Problem 3(iii). The likelihood ratio test statistic for the joint signif-
icance of the explanatory variables in the probit model is equal to 10.03
with the respective p − value of 0.1866, which is quite similar to the result
obtained in part (ii).
As one can see, participating in the job training program lowers the esti-
mated probability of being unemployed in 1978 by more than 10 percentage
points: the probability of being unemployed without participation is 0.3447,
and the training program reduces it to 0.2410. The difference is statistically
significant at the 5 per cent level.
Econometrics II, Solutions to PS4, Summer 2010. Page: 4
And since the probabilities have different functional forms, it makes no sense
to compare the coefficient on train for the probit model with the above LPM
estimate.
Hence
N 1
γ̂M LE = PN =
i=1 yi
y
yi∗ = xi β + εi
Problem 6.
Problem 6(a).
i We have model P (yi = 1|xi , di ) = Φ(α + βxi + γx2i + δdi ). In order to
find the partial effects of xi and di , we compute:
∂P (y = 1|xi , di )
= φ(α + βxi + γx2i + δdi )(β + 2γxi ),
∂xi
∆P (y = 1|xi , di )
= P (y = 1|xi , di = 1) − P (y = 1|xi , di = 0) =
∆di
= Φ(α + βxi + γx2i + δ) − Φ(α + βxi + γx2i ).
ii By the same token, for P (yi = 1|xi , di ) = Φ(α + βxi + γdi + δxi di ), we
get:
∂P (y = 1|xi , di )
= φ(α + βxi + γdi + δxi di )(β + δdi ),
∂xi
∆P (y = 1|xi , di )
= P (y = 1|xi , di = 1) − P (y = 1|xi , di = 0) =
∆di
= Φ(α + βxi + γ + δxi ) − Φ(α + βxi ).
∂P (y = 1|xi , di )
→ N (g(θ), G0 (θ̂)var(θ̂)G(θ̂)),
∂xi
Econometrics II, Solutions to PS4, Summer 2010. Page: 7
∂g ∂g ∂g ∂g
where g(θ) = φ(α + βxi + γx2i + δdi )(β + 2γxi ) and G0 (θ̂) = [ ∂α , ∂β , ∂γ , ∂δ ]
and standard error of ∂P (y=1|x
∂xi
i ,di )
is just sqrt[G0 (θ̂)var(θ̂)G(θ̂)]. For the
other three partial effects, we proceed analogically.
The estimated effect from increasing pcnv from 0.25 to 0.75 is −0.154 ∗
(0.5) = −0.077, thus the probability of arrest falls by about 7.7 points.
There are no important differences between the usual and robust standard
errors.
variable mean
avgsen 0.632
tottime 0.839
ptime86 0.387
inc86 54.967
Now, we must compute the difference in the normal cdf at the two dif-
ferent values of pcnv (0.25 and 0.75), black = 1, hispan = 0 and born60 = 1
and at the average values of the remaining variables. The probability falls
by about 0.10, what is larger than the result obtained from the LPM.
Problem 7(f ). The extrema for all three models considered are shown
in Table 4. As you can see, the three maxima are quite similar, while the
minima differ substantially, the one for LPM even being negative (hence one
of the major disadvantages of the model).
Problem 7(g). Using the same method as in part (d), the following
cross-tables were obtained for LPM and logit (Table 5 and Table 6, respec-
tively). We can see that correctly predicted that person will be not arrested
is 1903/1970 = 97% and 1869/1970 = 95% for the LPM and logit models,
respectively. Correctly predicted that person will be arrested is 58/755 = 8%
and 90/755 = 12% for the LPM and logit models, respectively. As it was
the case with the probit model in part (d), the overall percent correctly pre-
dicted is quite high, but we cannot very well predict the outcome we would
most like to predict.
Econometrics II, Solutions to PS4, Summer 2010. Page: 11
STATA CODES
* =================================================================
* Problem 1
* =================================================================
* a)
* =================================================================
scalar a = invnormal(0.8) /* X*beta */
scalar b = normalden(a) * .6 /* derivative w.r.t. x_1 */
scalar c = normalden(a) * -.4 /* derivative w.r.t. x_2 */
scalar d = 0.30 + 0.60 - 0.40*2 /* X*beta */
scalar e = normalden(d) * .6 /* derivative w.r.t. x_1 */
scalar f = normalden(d) * -.4 /* derivative w.r.t. x_2 */
scalar g = 0.30 + 0.60*2 - 0.40*2 /* X*beta */
scalar h = normalden(g) * .6 /* derivative w.r.t. x_1 */
scalar i = normalden(g) * -.4 /* derivative w.r.t. x_2 */
scalar j = normal(g) - normal(d) /* discrete change in Prob(y=1) */
scalar list /* displaying the results */
* =================================================================
* b)
* =================================================================
scalar k = exp(d) / (1 + exp(d))ˆ2 * .6 /* derivative w.r.t. x_1 */
scalar l = exp(d) / (1 + exp(d))ˆ2 * -.4 /* derivative w.r.t. x_2 */
scalar list k l /* displaying the results */
* =================================================================
* Problem 3 (baby-Wooldridge 17.15)
* =================================================================
set seed 123 /* setting initial value of random-number seed */
use jtrain2 /* inputting data file */
sample 90 /* sample 90% of all data */
* =================================================================
* i)
* =================================================================
count if train == 1 /* counting # of participants */
tab mostrn /* determining max participation length */
* =================================================================
* ii)
* =================================================================
reg train unem74 unem75 age educ black hisp married /* LPM */
test unem74 unem75 age educ black hisp married /* F-test */
* =================================================================
* iii)
* =================================================================
Econometrics II, Solutions to PS4, Summer 2010. Page: 12
probit train unem74 unem75 age educ black hisp married /* Probit */
estimates store probit_unr /* storing estimation results [UNR] */
probit train /* Probit [RESTRICTED MODEL] */
estimates store probit_r /* storing estimation results [R] */
lrtest probit_unr probit_r /* likelihood ration test */
* =================================================================
* v)
* =================================================================
reg unem78 train /* LPM */
* =================================================================
* vi)
* =================================================================
probit unem78 train /* Probit */
* =================================================================
* vii)
* =================================================================
reg unem78 train /* LPM */
predict fit_lpm /* generating fitted values */
probit unem78 train /* Probit */
predict fit_probit /* generating fitted values */
tab fit_lpm fit_probit /* comparing fitted values */
* =================================================================
* viii)
* =================================================================
reg unem78 train unem74 unem75 age educ black hisp married
predict fit_lpm_all /* generating fitted values */
probit unem78 train unem74 unem75 age educ black hisp married
predict fit_probit_all /* generating fitted values */
sum fit_lpm_all fit_probit_all /* comparing fitted values */
correlate fit_lpm_all fit_probit_all /* calculating correl. */
* =================================================================
* Problem 7 (adult-Wooldridge 15.7)
* =================================================================
infile narr86 nfarr86 nparr86 pcnv avgsen tottime ptime86 ///
qemp86 inc86 durat black hispan born60 pcnvsq pt86sq ///
inc86sq ///
using CRIME.raw, clear /* input the raw file */
* =================================================================
* a) LPM
* =================================================================
g arr86=(narr86>0) /* define =1 if narr86>0, =0 otherwise */
reg arr86 pcnv avgsen tottime ptime86 inc86 black hispan born60
reg arr86 pcnv avgsen tottime ptime86 inc86 black hispan ///
Econometrics II, Solutions to PS4, Summer 2010. Page: 13
born60, robust
/* computing the effect of change in pcnv 0.25 - >0.75 */
scalar pcnv_025_075_lpm=_b[pcnv]*(0.75-0.25)
di "Effect of increasing pcnv from 0.25 to 0.75 (LPM): " ///
pcnv_025_075_lpm
* =================================================================
* b) Testing joint significance of avgsen and tottime
* =================================================================
/* we suppress regression output with command "quietly" */
qui reg arr86 pcnv avgsen tottime ptime86 inc86 black hispan born60
test avgsen tottime /* non-robust test */
qui reg arr86 pcnv avgsen tottime ptime86 inc86 black hispan ///
born60, robust
test avgsen tottime /* robust test */
* =================================================================
* c) Probit
* =================================================================
probit arr86 pcnv avgsen tottime ptime86 inc86 black hispan born60
/* compute the effect of increasing pcnv from 0.25 to 0.75 */
mfx, at(pcnv=0.25 black=1 hispan=0 born60=1)
scalar pcnv025 = e(Xmfx_y)
mfx, at(pcnv=0.75 black=1 hispan=0 born60=1)
scalar pcnv075 = e(Xmfx_y)
scalar pcnv_025_075_probit = pcnv075 - pcnv025
di "Effect of increasing pcnv from 0.25 to 0.75 (Probit): " ///
pcnv_025_075_probit
di "Effect of increasing pcnv from 0.25 to 0.75 (LPM): " ///
pcnv_025_075_lpm
* =================================================================
* d) % correctly predicted by them model
* =================================================================
estat class /* you can calculate the output by hands: */
* predict prob_hat, pr /* predict Pr. of ’+’ outcome for arr86 */
* g arr86_hat = (prob_hat > 0.5) /* predict arr86 */
* tab arr86_hat arr86 /* tabulate predictions */
* di "Correct prediction for not arrested men" 1903/1970
* di "Correct prediction for arrested men" 78/755
* =================================================================
* e) Probit with additional variables
* =================================================================
probit arr86 pcnv avgsen tottime ptime86 inc86 black hispan ///
born60 pcnvsq pt86sq inc86sq
test pcnvsq pt86sq inc86sq /* test for joint significance */
scalar pcnv_max = -_b[pcnv]/(2*_b[pcnvsq]) /* inflaction point */
di "pcnv inflection point: " pcnv_max /* display the point */
Econometrics II, Solutions to PS4, Summer 2010. Page: 14
* =================================================================
* f) predicted probability extrema comparison
* =================================================================
reg arr86 pcnv avgsen tottime ptime86 inc86 black hispan born60
predict prob_hat_lpm, xb /* predict Pr. of ’+’ outcome for
arr86 */ logit arr86 pcnv avgsen tottime ptime86 inc86 black
hispan born60 predict prob_hat_logit, pr /* predict Pr. of ’+’
outcome for arr86 */ sum prob_hat prob_hat_logit prob_hat_lpm
* =================================================================
* g) model goodness-of-fit comparison
* =================================================================
g arr86_hat_lpm =(prob_hat_lpm > 0.5) /* predict arr86 */ g
arr86_hat_logit =(prob_hat_logit > 0.5) /* predict arr86 */
tab arr86 arr86_hat_lpm /* goodness-of-fit cross-table */
display 1919 / 1970 /* calculating percentage predicted */
display 58 / 755 /* calculating percentage predicted */
tab arr86 arr86_hat_logit /* goodness-of-fit cross-table */
display 1869 / 1970 /* calculating percentage predicted */
display 90 / 755 /* calculating percentage predicted */