关键词 > ECOM30001/ECOM90001
ECOM30001/ECOM90001: Basic Econometrics Semester 1, 2022 Solutions: Tutorial 3
发布时间:2022-07-16
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
ECOM30001/ECOM90001: Basic Econometrics
Semester 1, 2022
SoLUT1oNs: TUToR1AL 3
This tutorial reviews some fundamental concepts for the basic linear model, including conducting hypothesis tests about a single coefficient, using the econometrics software
package R that we will be using in this subject.
This tutorial requires one data file:
- cocaine .csv
This file can be obtained from the LMS subject page.
In addition the R script file tut3 .R provides the program code necessary to complete the tutorial. This R script file uses the following package(s) which need to be installed prior to running the R script file:
stargazer : for easily generating summary statistics for an R data file
These can be installed directly in RSTUD1o from the packages tab or by using the com- mand install .packages() and inserting the name of the package in the brackets.
Question 1 (Hill, Griffiths & Judge Exercise 5.5)
Consider the following econometric model for prices of owner-occupied homes in a metropoli- tan area surrounding a major city.
VALUEi = β0 + β1 CRIMEi + β2 NITOXi
+ β3 ROOMSi + β4 AGEi + β5 DISTi
+ β6 ACCESSi + β7 TAXi + β8 PTRATIOi + εi These variables are defined as:
VALUE = median value of owner-occupied homes in $’000’s
CRIME = per-capita crime rate
NITOX = nitric oxides concentration (parts per million
ROOMS = average number of rooms per dwelling
AGE = proportion of owner-occupied dwelliingsbuilt prior to 1940 DIST = weighted distance to five employment centres
ACCESS = index of accessability to radial highways
TAX = full-value property tax rate per $10,000
PTRATIO = pupil-teacher ratio by town
Suppose you have data on 506 local census areas within the major city. An OLS regression provides the following estimates:
Dependent Variable: VALUE
Sample: 1 506
Included Observations : 506
Variable Coefficient Std.Error t-statistic Prob.
C |
28.40666 |
5.365948 |
5.293875 |
0.0000 |
CRIME |
-0.183449 |
0.036489 |
-5.027548 |
0.0000 |
NITOX |
-22.81088 |
4.160741 |
-5.482407 |
0.0000 |
ROOMS |
6.371512 |
0.392387 |
16.23784 |
0.0000 |
AGE |
-0 047750 |
0 014102 |
-3 386085 |
0 0008 |
DIST |
-1.335269 |
0.200147 |
-6.671448 |
0.0000 |
ACCESS |
0 272282 |
0 072276 |
3 376250 |
0 0002 |
TAX |
-0.012592 |
0.003770 |
-3.339939 |
0.0009 |
PTRATIO |
-1.176787 |
0.139415 |
-8.440868 |
0.0000 |
a) Report briefly how each of the explanatory variables affects the value of a home.
Solution Recall that the dependent variable (median value of owner-occupied homes) is measured in $’000’s.
· b1 = _0.184—as the per-capita crime rate increases by one unit, the median
home value falls by $183.45.
· b2 = _22.81088—a one unit increase in the nitric oxide concentration leads to
a decline in median value of $22,810.
· b3 = 6.371512—increasing the average number of rooms by one unit raises the
median value by $6,372
· b4 = _0.04775—a one unit increase in the proportion of owner-occupied
dwellings built prior to 1940 reduces the median home value by $47.75
· b5 = _1.335269—for every unit of weighted distance from five employment
centers, the median home value declines by $1335.27
· b6 = 0.272282—a one unit increase in the index of accessability to radial
highways raises median value by $272.82
· b7 = _0.012592—a higher property tax rate per $10,000 lowers the median
home value
· b8 = _1.176787—a one unit increase in the pupil-teacher ratio lowers median
value by $1176.78
b) Test the hypothesis that increasing the average number of rooms by one changes the median value of a house by $7, 500. Your answer should clearly state the null and alternative hypotheses, the distribution of the test statistic, and your decision.
Solution: This hypothesis may be represented as H0 : β3 = 7.5 since the dependent variable is measured in $1000. Consider a two-sided alternative:
i) specify H0 and HA :
H0 : β3 = 7.5
ii) the test statistic :
t =
iii) the level of significance:
α = 0.05
b3 _ 7.5 se(b3 )
HA : β3 7.5
? t(N _ 9)
tc ~ 1.96
with degrees of freedom N _ 9 = 497. Reject H0 if t < 1.96 or t ● _1.96. Note that the file tut3 .R provides an exact critical value of tc = 1.964749 and _tc = _1.964749.
iv) regression results
b3 = 6.371512 se(b3 ) = 0.392387
v) calculate the sample value of the test statistic
b3 _ 7.5 _1.128488
se(b3 ) 0.392387
vi) apply the decision rule:
t < _tc
so reject the null hypothesis. The data are not consistent with the hypoth- esis that changing the number of rooms raises the median value of a house by $7,500.
Alternatively, the p-value fore this test is given by p = 0.0042. Since p < 0.05, then reject H0 . Check the file tut3 .R for the calculation of this p-value.
c) Test the hypothesis that reducing the pupil-teacher ratio by 10 will increase the median value of a house by more than $10, 000. Your answer should clearly state the null and alternative hypotheses, the distribution of the test statistic, and your decision.
Solution: We want to test HA : β8 < _1:
i) specify H0 and HA :
H0 : β8 < _1 HA : β8 < _1
ii) the test statistic :
b8 _ (_1)
se(b8 )
iii) the level of significance:
α = 0.05 tc ~ 1.645
with degrees of freedom N _ 9 = 497. Reject H0 if t ● _1.645 since this is a one-tailed test. Note that the file tut3 .R provides an exact critical value of tc = _1.647925.
iv) regression results
b8 = _1.176787
v) calculate the sample value of the test statistic
se(b8 ) = 0.139415
b8 + 1 _0.17679
se(b8 ) 0.139415
vi) apply the decision rule. We will reject H0 when t < _tc . Since t > _tc , do not reject the null hypothesis. The data are not consistent with the hypothesis that reducing the pupil-teacher ratio by 10 will increase the median home value by more than $10,000.
Alternatively, the p-value fore this test is given by p = 0.1027. Since p > 0.05, then do not reject H0 . Check the file tut3 .R for the calculation of this p-value.
Note: The hypothesis tests for parts (c) and (d) should be conducted at the 5% level of significance.
Question 2
Illicit drugs are increasingly being sold on crypto-markets on the ‘dark-web’ . These markets facilitate anonymous buying and selling and are characterised by the following characteristics:
- anonymous internet browsing
- payments in virtual crypto-currencies (such as Bitcoin)
- payments to third-party vendors (intermediaries)
- vendor feedback systems (ratings)
This question examines the market for cocaine using a single platform on the dark-web, during July 2017. Consider the following econometric model:
pricei = β0 + β1 quanti + β2 quali + β3 ratingi + εi
where:
price = price per gram in USD for a cocaine sale
quant = number of grams of coccaine in a given sale
qual = quality of the coccaine expressed as a percentage purity rating = rating of the seller on a five-hundred point scale, 0 to 500
The data required to complete this question are located on the subject page. The data file is called cocaine .csv.
The hypothesis tests for parts (d), (e), and (f) should be conducted at the 5% level of significance.
a) What signs do you expect for β1 , β2 and β3 ?
Solution:We expect the following signs for the population coefficients:
· β1 < 0—as the number of grams in a given sale increases by one unit, the
expected price per gram will fall (for a given quality and seller rating). This suggests that there is a quantity discount for large sales.
· β2 > 0—as the quality index increases by one percentage point, the expected
price will increase (for a given quantity and seller rating). We expect that, all else equal, relatively more pure cocaine should command a higher unit price.
· β3 > 0—as the seller rating increases by one unit, the expected price will
increase (for a given quantity and quality). This suggests that the reputations of the sellers are important for buyers such that, all else equal, they are willing to pay a premium to purchase from more reliable sellers.
b) Using R estimate the econometric model. Report and interpret the coefficient
estimates. Do the signs of your estimated coefficients turn out as you expect? Solution: The estimated regression results are reported in Figure 1.
meignreassvnea(s)l(u)e(lt)i(s)ncreasesby one unit,
the price per gram will fall by USD 0.0798. This marginal effect is relatively small, which might reflect the reduced risk faced by sellers on the ‘dark web’ .
· b2 = 0.7636—as the quality index increases by one percentage point, the price
per gram will increase by USD 0.7636.
· b3 = 0.2179—as seller rating increases by one unit (on a 500-point scale), the
price per gram increases by USD 0.2179.
The estimated coefficients have the signs that we would expect.
c) What proportion of the variation in cocaine price is explained by variation in quan- tity, quality, and seller rating?
Solution: Using the R2 = 0.1307 from the regression results in Figure 1, the proportion of the variation in the cocaine unit price that is explained by variation in the quantity, quality, and seller rating is 13.07%.
d) It is claimed that the greater the number of sales, the higher the risk of getting caught; and thus, sellers are willing to accept a lower price if they can make sales in greater quantities. Test this hypothesis. Your answer should clearly state the null and alternative hypotheses, the distribution of the test statistic, and your decision.
Solution: This hypothesis may be represented as a one-sided test:
i) specify H0 and HA :
H0 : β1 < 0
ii) the test statistic :
t = ? t(N _ 4)
iii) the level of significance:
α = 0.05
HA : β1 < 0
tc ~ 1.6449
with degrees of freedom (N _ 4) = 1, 405. Reject H0 if t ● _1.6449. Note that the file tut3 .R provides an exact critical value of tc = _1.6459.
iv) regression results
b1 = _0.0798
v) calculate the sample value of the test statistic
se(b1 ) = 0.0071
b1 _ 0
se(b1 )
vi) apply the decision rule:
t < _tc
reject the null hypothesis. The data are consistent with the hypothesis that sellers are willing to accept a lower price if they can make sales in larger quantities.
Alternatively, the p-value fore this test is given by p = 0.0000. Since p < 0.05, then reject H0 . Check the file tut3 .R for the calculation of this p-value.
e) Test the hypothesis that a premium is paid for better quality cocaine. Your answer should clearly state the null and alternative hypotheses, the distribution of the test statistic, and your decision.
Solution: This hypothesis may be represented as a one-sided test.
i) specify H0 and HA :
H0 : β2 ● 0 HA : β2 > 0
ii) the test statistic :
b2 _ 0
se(b2 )
iii) the level of significance:
α = 0.05 tc ~ 1.6449
with degrees of freedom (N _ 4) = 1, 405. Reject H0 if t < 1.6449. Note that the file tut3 .R provides an exact critical value of tc = 1.6459.
iv) regression results
b2 = 0.7636
v) calculate the sample value of the test statistic
se(b2 ) = 0.0965
b2 _ 0
se(b2 )
vi) apply the decision rule:
t > tc
reject the null hypothesis. The data are consistent with the hypothesis that a premium is paid for better quality cocaine.
Alternatively, the p-value fore this test is given by p = 0.00000. Since p < 0.05, then reject H0 . Check the file tut3 .R for the calculation of this p-value.
f) Test the hypothesis that, controlling for quality and quantity, seller rating is an important determinant of price. Your answer should clearly state the null and
alternative hypotheses, the distribution of the test statistic, and your decision.
Solution: This hypothesis may be represented as a one-sided test.
i) specify H0 and HA :
H0 : β3 = 0 HA : β3 0
ii) the test statistic :
b3 _ 0
se(b3 )
iii) the level of significance:
α = 0.05 tc ~ 1.96
with degrees of freedom (N _ 4) = 1, 405. Reject H0 if t < 1.96 or t ● _1.96. Note that the file tut3 .R provides an exact critical value of tc = 1.9617.
iv) regression results
b3 = 0.2179
se(b3 ) = 0.0475
v) calculate the sample value of the test statistic
b3 _ 0
se(b3 )
vi) apply the decision rule:
t > tc
reject the null hypothesis. The data are consistent with the hypothesis that seller rating is an important determinant of price.
Alternatively, the p-value fore this test is given by p = 0.00000. Since p < 0.05, then reject H0 . Check the file tut3 .R for the calculation of this p-value.