Professional Documents
Culture Documents
Stata Eview Problem Set 2 Sol
Stata Eview Problem Set 2 Sol
Stata Eview Problem Set 2 Sol
1. Estimate the own-price elasticity of demand by using OLS to regress the log of the
quantity of grain shipped on the log of the price of shipping grain and the full set of
month binary indicators.
. reg lquantity lprice $months, r;
------------------------------------------------------------------------------
| Robust
lquantity | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
lprice | -.6620433 .0754213 -8.78 0.000 -.8104383 -.5136484
seas1 | -.0955314 .0901446 -1.06 0.290 -.2728952 .0818324
seas2 | .1064381 .0844977 1.26 0.209 -.0598151 .2726913
seas3 | .1510242 .0916339 1.65 0.100 -.0292699 .3313182
seas4 | .1286241 .1236321 1.04 0.299 -.1146279 .3718761
seas5 | -.1166274 .1206273 -0.97 0.334 -.3539673 .1207125
seas6 | -.3666743 .0978573 -3.75 0.000 -.5592132 -.1741354
seas7 | -.2919127 .1338223 -2.18 0.030 -.5552145 -.0286108
seas8 | -.6490938 .095055 -6.83 0.000 -.8361191 -.4620685
seas9 | -.4108652 .0904551 -4.54 0.000 -.5888399 -.2328905
seas10 | -.2473659 .0898223 -2.75 0.006 -.4240957 -.0706362
seas11 | -.1993899 .0906922 -2.20 0.029 -.3778311 -.0209488
seas12 | -.1926615 .0870309 -2.21 0.028 -.3638989 -.021424
_cons | 9.2401 .1172646 78.80 0.000 9.009376 9.470823
------------------------------------------------------------------------------
1
Advanced Econometrics STATA/EVIEW Problem Set 2
2. Consider two possibilities for instrumental variables: whether the railroad cartel was
experiencing one of its periodic collapses (cartel), and whether the Great Lakes are closed
because of ice (ice).
a. Use economic reasoning to argue whether cartel plausibly satisfies the two conditions for
a valid instrument.
cartel:
• Relevance: If the cartel is operating effectively then it will increase price, so
corr(lprice,cartel) should be nonzero and cartel would be relevant.
• Exogeneity: Exogeneity means that corr(cartel,u) = 0, where u is the error term in the
demand equation. The demand for shipping services depends on price, the amount of
grain to be shipped by rail, and the end user demand, but standard demand theory does
not suggest that the demand for shipping services should depend separately on whether
the cartel is operating, other than through the cartel’s effect on price; so cartel
plausibly is exogenous.
b. Use economic reasoning to argue whether ice plausibly satisfies the two conditions for a
valid instrument.
ice:
• Relevance: closing the Great Lakes will increase demand for rail services so price
should go up, so corr(lprice,ice) should be nonzero.
• Exogeneity: Exogeneity means that corr(ice,u) = 0, where u is the error term in the
demand equation. The amount of grain to be shipped by rail depends on whether an
alternative means (by boat) is available. If the Great Lakes are closed, demand
increases (the demand curve shifts up). Thus ice belongs in the demand curve as an
included exogenous regressor and, if so, it is not a valid instrumental variable.
3. Read Table 1, then compute and fill in the missing entries Note that an additional blank
column and blank row have been provided in case you have an additional specification
and/or estimator you wish to report; you are not expected to fill in entries in the blank
row when running regressions (1) – (5). (Feel free to add more rows or columns as
desired by editing the electronic file directly.)
See attached table.
2
Advanced Econometrics STATA/EVIEW Problem Set 2
Column (1) presents an estimate of the effect of the cartel on price. Columns (2) – (6) provide
different estimates of the own-price elasticity of demand for shipping services. Most of these
estimates are plausibly biased for one reason or another. The OLS estimate (2) suffers from
simultaneous causality bias (for the reasons given in the response to question 1(b)). The TSLS
estimators from regressions (4) and (5), which use ice as an instrument, are plausibly
inconsistent because ice is a component of the error in the demand curve, that is, it belongs in
the demand curve and arguably is not exogenous (as discussed in the answer to question 2(b))
(In addition, ice is a weak instrument because its first-stage F in regression (4) is less than 10;
if ice were plausibly exogenous this would call regression (4) into question but because ice is
not exogenous the estimator (4) is inconsistent anyway.) The endogeneity of ice is confirmed
by the rejection of the J-statistic testing the over-identifying restriction that both ice and cartel
are exogenous. This leaves us with regression (3) as the only plausible estimate of the demand
elasticity; however, this specification could still have omitted variable bias because demand
depends on ice, which has been omitted. Thus regression (6) extends regression (3) by
including ice as an additional a regressor and using cartel as an instrument; with a first-stage
F of 183.0, the instrument is not weak so the results are reliable, assuming that cartel is
exogenous.
What is the evidence concerning the effectiveness of the cartel? First, regression (1) shows
that when the cartel was operating, it increased prices by a lot, 36% (which is statistically
significant). However, demand is inelastic: the estimated own-price elasticity from regression
(6) is - 0.867 > -1, and the 95% confidence interval is (-1.13, -0.60). This confidence intervals
includes both elastic and inelastic regions, and thus the results are not decisive on the elasticity
question. In any event, the second prediction, elastic demand, is not borne out decisively.
Perhaps the cartel was not completely successful, in the sense that it did not raise prices as
much as a monopolist would have; or perhaps the operators of the cartel had other
considerations that kept them from raising prices too much.
3
Advanced Econometrics STATA/EVIEW Problem Set 2
One threat to internal validity is if the instrument cartel is in fact endogenous. This cannot be
checked by empirical analysis. The instrument would be endogenous if demand depends
directly (not just through the current price) on whether the cartel is operating. Because price
wars occurred intermittently, grain shippers might expect that a period of high prices would be
temporary, and could hold inventories in silos and wait until a price war, at which point they
would ship large quantities of grain; in effect, the shippers might wait until rail shipping
services are “on sale.” If so, cartel would in effect appear in the demand curve (cartel = 1
means shippers hold back shipments in expectation of a future price collapse) and if so cartel
would not be exogenous and thus would not be a valid instrument.
A second threat to the internal validity of the conclusion that the cartel was not operating in a
region of elastic demand is that the elasticity was estimated using data that includes both
weeks when the cartel was operating and weeks when it was not. The functional form we use
here (log-log) has a constant elasticity, so we are estimating an average elasticity over these
two regimes (cartel and no cartel); even though the average elasticity was -0.867, when the
cartel was functioning demand could in fact have been more elastic. Said differently, our
conclusion might be sensitive to functional form misspecification. One way to investigate this
would be to estimate a quadratic- or cubic-in-logarithms specification in ln(P) and compute the
elasticity at different points, in particular the cartel = 1 region. That might provide a more
compelling answer to the question of whether the cartel, when it was operating, had increased
prices to the point that demand was elastic.
A third threat to internal validity, which we have not yet studied, arises from the fact that these
are time series data. Thus omitted factors in demand are plausibly correlated over time, and
this “serial correlation” in the demand error term means that the standard errors are computed
incorrectly; we will return to the proper calculation of standard errors with serially correlated
error terms when we discuss regression with time series data.
4
Advanced Econometrics STATA/EVIEW Problem Set 2
Table 1: Estimates of the own-price elasticity of the demand for rail shipments of grain, 1880 –
1886
Notes: ln(P) is the logarithm of the price of transporting one ton of grain by rail and ln(Q) is
the logarithm of the quantity (weekly tonnage) of grain shipped. The entries in the rows
labeled cartel and ln(P) are the corresponding regression coefficient and, in parentheses, its
heteroskedasticity-robust standard error, estimated using the regression method in the relevant
column. All regressions contain a full set of monthly indicators, and the row labeled “F-
statistic testing coefficients on monthly indicators (p-value)” gives the F-statistic (and its p-
value in parentheses) testing the hypothesis that the coefficients on these monthly indicators
are all zero. The penultimate row presents the first-stage F-statistic testing the hypothesis that
the coefficients on the instruments are zero in the first-stage regression, when TSLS is used,
and the final row presents the J-test of over identifying restrictions. All regressions contain an
intercept, the value of which is not reported in the table. The data are weekly, 1880-1886, for
a total of n = 328 observations. Note that there are 13 “months” in a year in this dataset (see
the variable definitions).
5
Advanced Econometrics STATA/EVIEW Problem Set 2
#delimit ;
clear;
capture log close;
*************************************************************;
* ps2.do;
* Elasticity of demand for rail shipping services and;
* the Joint Executive Committee cartel;
*************************************************************;
set more off;
log using ps2.log, replace;
*************************************************************;
* read in data;
use grain;
desc;
su;
******************************;
* Data manipulations;
******************************;
gen lprice = log(price);
gen lquantity = log(quantity);
global months "seas1 seas2 seas3 seas4 seas5
seas6 seas7 seas8 seas9 seas10 seas11 seas12";
******************************;
* regressions and diagnostics;
* ------------- (1) ------------- ;
reg lprice cartel $months, r;
test $months;
* ------------- (2)------------- ;
reg lquantity lprice $months, r;
test $months;
* ------------- (3) ------------- ;
ivreg lquantity $months (lprice = cartel), r;
test $months;
* 1st stage F;
reg lprice cartel $months, r; test cartel;
* ------------- (4) ------------- ;
ivreg lquantity $months (lprice = ice), r;
test $months;
* 1st stage F;
reg lprice ice $months, r; test ice;
* ------------- (5) ------------- ;
ivreg lquantity $months (lprice = cartel ice), r;
test $months;
* J-test of overidentifying restrictions;
predict e1, residuals;
reg e1 cartel ice $months; test cartel ice; drop e1;
dis "J-test = " r(df)*r(F)
" p-value = " 1-chi2(r(df)-1,r(df)*r(F));
* 1st stage F;
reg lprice ice cartel $months, r; test ice cartel;
* ------------- (6) ------------- ;
ivreg lquantity ice $months (lprice = cartel), r;
test $months;
* 1st stage F;
reg lprice cartel ice $months, r; test cartel;
*************************************************************;
log close;
clear;
exit;
6
Advanced Econometrics STATA/EVIEW Problem Set 2
STATA OUTPUTS
. use grain;
. desc;
. su;
. ******************************;
. * Data manipulations;
. ******************************;
. gen lprice = log(price);
7
Advanced Econometrics STATA/EVIEW Problem Set 2
. ******************************;
. * regressions and diagnostics;
. * ------------- (1) ------------- ;
. reg lprice cartel $months, r;
. test $months;
( 1) seas1 = 0
( 2) seas2 = 0
( 3) seas3 = 0
( 4) seas4 = 0
( 5) seas5 = 0
( 6) seas6 = 0
( 7) seas7 = 0
( 8) seas8 = 0
( 9) seas9 = 0
(10) seas10 = 0
(11) seas11 = 0
(12) seas12 = 0
. * ------------- (2)------------- ;
. reg lquantity lprice $months, r;
8
Advanced Econometrics STATA/EVIEW Problem Set 2
( 1) seas1 = 0
( 2) seas2 = 0
( 3) seas3 = 0
( 4) seas4 = 0
( 5) seas5 = 0
( 6) seas6 = 0
( 7) seas7 = 0
( 8) seas8 = 0
( 9) seas9 = 0
(10) seas10 = 0
(11) seas11 = 0
(12) seas12 = 0
( 1) seas1 = 0
( 2) seas2 = 0
( 3) seas3 = 0
( 4) seas4 = 0
( 5) seas5 = 0
( 6) seas6 = 0
( 7) seas7 = 0
9
Advanced Econometrics STATA/EVIEW Problem Set 2
( 8) seas8 = 0
( 9) seas9 = 0
(10) seas10 = 0
(11) seas11 = 0
(12) seas12 = 0
. * 1st stage F;
. reg lprice cartel $months, r;
( 1) cartel = 0
F( 1, 314) = 186.42
Prob > F = 0.0000
10
Advanced Econometrics STATA/EVIEW Problem Set 2
( 1) seas1 = 0
( 2) seas2 = 0
( 3) seas3 = 0
( 4) seas4 = 0
( 5) seas5 = 0
( 6) seas6 = 0
( 7) seas7 = 0
( 8) seas8 = 0
( 9) seas9 = 0
(10) seas10 = 0
(11) seas11 = 0
(12) seas12 = 0
. * 1st stage F;
. reg lprice ice $months, r;
( 1) ice = 0
F( 1, 314) = 2.39
Prob > F = 0.1231
11
Advanced Econometrics STATA/EVIEW Problem Set 2
( 1) seas1 = 0
( 2) seas2 = 0
( 3) seas3 = 0
( 4) seas4 = 0
( 5) seas5 = 0
( 6) seas6 = 0
( 7) seas7 = 0
( 8) seas8 = 0
( 9) seas9 = 0
(10) seas10 = 0
(11) seas11 = 0
(12) seas12 = 0
12
Advanced Econometrics STATA/EVIEW Problem Set 2
------------------------------------------------------------------------------
. test cartel ice;
( 1) cartel = 0
( 2) ice = 0
F( 2, 313) = 5.98
Prob > F = 0.0028
. drop e1;
. * 1st stage F;
. reg lprice ice cartel $months, r;
( 1) ice = 0
( 2) cartel = 0
F( 2, 313) = 92.85
Prob > F = 0.0000
13
Advanced Econometrics STATA/EVIEW Problem Set 2
( 1) seas1 = 0
( 2) seas2 = 0
( 3) seas3 = 0
( 4) seas4 = 0
( 5) seas5 = 0
( 6) seas6 = 0
( 7) seas7 = 0
( 8) seas8 = 0
( 9) seas9 = 0
(10) seas10 = 0
(11) seas11 = 0
(12) seas12 = 0
. * 1st stage F;
. reg lprice cartel ice $months, r;
( 1) cartel = 0
F( 1, 313) = 182.98
Prob > F = 0.0000
14