Problem Set 2.
1. (Wooldridge, 17.1) 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). Suppose
you predict the outcome to be equal to 1 if the estimated probability that
Copyright By PowCoder代写 加微信 powcoder
yi = 1 is greater than 0.5 (and predict that the outcome is zero otherwise).
Let qˆ be the percent correctly predicted for the outcome y = 0 and let qˆ 00
be the percent correctly predicted for the outcome y = 0 and let qˆ be the 1
percent correctly predicted for the outcome y = 1. If pˆ is the overall percent correctly predicted show that pˆ is a weighted average of qˆ and qˆ :
pˆ=(1−y)qˆ +yqˆ 01
ANSWER: Let yˆ be 1 if y is predicted to be 1 and 0, otherwise. Then, (yyˆ+(1−y)(1−yˆ))
where N is the number of observations. Above, the numerator counts ob-
servations where either both y and yˆ are one or both y and yˆ are zero
(i.e., the correct predictions). Then note that qˆ = ( yyˆ)/( y) and qˆ = 10
((1 − y)(1 − yˆ))/( 1 − y). In words, because yyˆ is equal to 1 if both y and yˆ are one and zero otherwise, qˆ counts the number where both yˆ and
y are 1 and divides that by the number of observations for which y is one. Analogously for qˆ : it counts the observations where both y and yˆ are zero
and divides by the number of observations where y is zero. The previous expression can be manipulated to obtain:
(yyˆ+(1−y)(1−yˆ)) N
(yyˆ) (1 − y)(1 − yˆ))
(yyˆ)y (1−y)(1−yˆ))(1−y)
=yN+(1−y) N
= yqˆ +(1−y)qˆ 10
2. (Wooldridge, Exercise 17.2) Let grad be a dummy variable for whether a student-athlete at a large university graduates in five years. Let hsGPA and SAT be high school grade point average and SAT score, respectively. Let study be the number of hours spend per week in an organized study hall. Suppose that, using data on 420 student-athletes, the following logit model is obtained:
Pˆ(grad = 1|hsGPA,SAT,study)
= Λ(−1.17 + 0.24hsGP A + 0.00058SAT + 0.073study)
where Λ(z) = exp(z)/[1 + exp(z)] is the logit function. Holding hsGPA fixed at 3.0 and SAT fixed at 1,200, compute the estimated difference in teh grad- uation probability for someone who spent 10 hours per week in study hall and someone who spent 5 hours per week.
ANSWER: Λ(−1.17 + 0.24 × 3 + 0.00058 × 1, 200 + 0.073 × 10) − Λ(−1.17 + 0.24 × 3 + 0.00058 × 1, 200 + 0.073 × 5) = 0.7263 − 0.6482 = 0.0781.
3. Consider the example in ( 1 ). Compute the marginal effect (i.e. partial effect) of study on the graduation probability when emphhsGPA is fixed at 3.0, SAT is fixed at 1,200 and study is fixed at 5 hours per week. One possi- ble approximation for the estimated difference in teh graduation probability for someone who spent 10 hours per week in study hall and someone who spent 5 hours per week is to multiply the marginal effect by 10-5=5 hours. Does this provide the same answer as in ( 1 )? If not, why?
ANSWER: 0.073×Λ′(−1.17+0.24×3+0.00058×1,200+0.073×5)×5 = 0.073×Λ(−1.17+0.24×3+0.00058×1,200+0.073×5)×[1−Λ(−1.17+ 0.24 × 3 + 0.00058 × 1, 200 + 0.073 × 5)] × 5 = 0.0832. The suggested calcula- tion provides a (linear) approximation to the difference between the predicted probability at 10 hours minus at 5 hours. As seen in the graph below, this approximation overshoots the effect of going from 5 to 10 hours.
4. You want to estimate a logit model relating Yi with one dependent variable Xi and a constant (P(Y1 = 1|Xi = x) = Λ(β0 + β1x)). Write down the log-likelihood function when the data set at your disposal consists of the following four observations:
yi xi 1 10.2 0 4.7 1 3.5 1 5.7
ANSWER: log Λ(β0 + β110.2) + log[1 − Λ(β0 + β14.7)] + log Λ(β0 + β13.5) + log Λ(β0 + β15.7)
5. (Wooldridge, Exercise 17.5) Let patents be the number of patents applied for by a firm during a given year. Assume that the conditional expectation of patents given sales and RD is
E(patents|sales, RD) = exp[β0 + β1 log(sales) + β2RD + β3RD2] where sales is annual firm sales and RD is total spending on research and
development over the past 10 years.
(i) How would you estimate the βj? Justify your answer by discussing the
nature of patents.
ANSWER: BECAUSE patents ∈ {0,1,2,…}, ASSUME A POISSON RE-
GRESSION MODEL AND ESTIMATE IT BY MLE.
(ii) How do you interpret β1?
ANSWER: NOTICE THAT
∂E(patents|sales, RD) ∂sales
= β E(patents|sales, RD) ⇒ 1 sales
= ∂E(patents|sales, RD) × sales . ∂sales E(patents|sales, RD)
(iii) Find the partial effect of RD on E(patents|sales, RD) (i.e., ∂E(patents|sales, RD)/∂RD). ANSWER:
(β2 + 2β3RD) exp[β0 + β1 log(sales) + β2RD + β3RD2]
HENCE, IT IS THE ELASTICITY OF E(patents|sales,RD) WITH RE-
SPECT TO sales.
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com