计量经济学|ECON 4261 – Homework 2

联系我们: 手动添加方式: 微信>添加朋友>企业微信联系人>13262280223 或者 QQ: 1483266981
这是一篇美国作业是一个计量经济学的assignment

Part 1
The following questions are from Wooldridge’sIntroductory Econometrics – 7e

Question 1
Using data from 1988 for houses sold in Andover, Massachusetts, from Kiel and McClain (1995), the following equation relates housing price (price
price
) to the distance from a recently built garbage incinerator (dist
dist
):
log(price)=9.40+0.312log(dist)
log(price)^=9.40+0.312log(dist)

n=135,R2=0.162
n=135,R2=0.162

Q1-1Interpret the coefficient on log(dist
dist
). Is the sign of this estimate what you expect it to be
Q1-2Do you think simple linear regression provides an unbiased estimator of the ceteris paribus elasticity ofprice
price
with respect todist
dist
(Think about the city’s decision on where to put the incinerator)
Q1-3What other factors about a house might affect its price Might these be correlated with distance from the incinerator

Question 2
Consider the savings function
sav=β0+β1inc+u
sav=β0+β1inc+u

u=inc ̄ ̄ ̄√ε
u=incε

whereε
ε
is a random variable withE[ε]=0
E[ε]=0
andV[ε]=σ2
V[ε]=σ2
. Assume thatε
ε
is independent ofinc
inc
.
Q2-1Show thatE[ε|inc]=0
E[ε|inc]=0
, so that the key zero conditional mean assumption (A3) is satisfied.
Q2-2Show thatV[u|inc]=σ2inc
V[u|inc]=σ2inc
, so that the homoscedasticity assumption (A4) is violated. In particular, the variance ofsav
sav
increases withinc
inc
.
Q2-3Provide a discussion that supports the assumption that the variance of savings increases with family income.

Question 3
We are interested in the birth weight (bwght
bwght
) of infants and the number of cigarettes the mother smoked per day during pregnancy (cigs
cigs
). The following simple regression was estimated using data onn=1388
n=1388
births
bwght=119.770.514cigs
bwght^=119.770.514cigs

Q3-1What is the predicted birth weight whencigs
cigs
= 0 What about whencigs=20
cigs=20
(one pack a day) Comment on the difference
Q3-2Does this simple regression necessarily capture a causal relationship between the child’s birth weight and the mother’s smoking habits Explain.
Q3-3To predict a birth weight of 125 ounces, what wouldcigs
cigs
have to be Comment.
Q3-4The proportion of women in the sample who did not smoke while pregnant is about 0.85. Does this help reconcile your finding from part (3)

Part 2
These next questions will be usingR

Question 4
In this question we will compare the difference between the finite sample properties and large sample properties of OLS. Let’s say the population regression is
Yi=β0+β1Xi+εi
Yi=β0+β1Xi+εi

where

β0
β0
= 3
β1
β1
= 5
Xi~N(2,1)
Xi~N(2,1)

εi~N(0,1)
εi~N(0,1)

Q4-1Simulate{(Yi,Xi)}5000i=1
{(Yi,Xi)}i=15000
(i.e., 5000 data points), save it as a data frame, and plot the histogram ofYi
Yi
andXi
Xi
. Properly label your graphs (you will lose points if you don’t – you can add+ xlab(“appropriate label for X”) + ylab(“appropriate label for Y”)to your line of code)
Q4-2Now let’s show the unbiasedness ofβ
β^
.
Do the following steps inR.

Create a function that will calculateβ0
β^0
andβ1
β^1
from a sample of sizeN

Initiate your function using

regOLS <- function(N){ } Now inside your function, usesamp <- df[sample(nrow(df), N), ]to draw a sample of sizeNfrom your data frame and save it assamp Calculate the OLSβ1 β^1 andβ0 β^0 based yoursampdata Have your function returndata.frame(b0 = __, b1 = __) Create 4 empty data frames to store your values ofβ1 β^1 andβ0 β^0 val1 <- data.frame(b0 = double(), b1 = double()) val2 <- data.frame(b0 = double(), b1 = double()) val3 <- data.frame(b0 = double(), b1 = double()) val4 <- data.frame(b0 = double(), b1 = double()) Using aforloop, run yourregOLSfunction for 100, 500, 1000, 5000 times, savingβ1 β^1 andβ0 β^0 each time into yourval1,val2,val3,val4dataframes, respectively. UseN=5 N=5 for your sample size, so that you are running the regression on a sample of size 5 each time.val1should have size 100,val2should have size 500, and so on. Report the average ofβ1 β^1 andβ0 β^0 for each of yourvaldata frames by running the following code as is: results = data.frame(n= double(), beta0_avg = double(), beta1_avg = double()) results[1:4,'N'] =c(100,500,1000,5000) results[1,2:3] = colMeans(val1) results[2,2:3] = colMeans(val2) results[3,2:3] = colMeans(val3) results[4,2:3] = colMeans(val4) print(results) Show the output ofprint(results)for credit. Q4-3Interpret your results. Does having a small sample size of 5 matter in terms of expected values Q4-4Since we simulated the unbiasedness of the OLS estimator, now let’s simulate the consistency of it. Using the sameregOLSfunction from before, run the function four times withN=10,50,500,5000 N=10,50,500,5000 each. You can just run the code below. results = data.frame(n= double(), beta0_avg = double(), beta1_avg = double()) results[1:4,'n'] =c(10,50,500,5000) results[1,2:3] = colMeans(regOLS(10)) results[2,2:3] = colMeans(regOLS(50)) results[3,2:3] = colMeans(regOLS(500)) results[4,2:3] = colMeans(regOLS(5000)) print(results) Show the output ofprint(results)for credit. Q4-5Interpret your results. What happens to your estimators asN N increases Q4-6Explain the difference between unbiasedness (finite sample property) and consistency (large sample / asymptotic property).

发表评论

了解 KJESSAY历史案例 的更多信息

立即订阅以继续阅读并访问完整档案。

继续阅读