Professional Documents
Culture Documents
Panel Data (Ch. 10) The Recommended Exercise Questions From The Textbook
Panel Data (Ch. 10) The Recommended Exercise Questions From The Textbook
(Ch. 10)
Panel-1
[2] Revisiting Omitted Variables Biases
Issue:
Do alcohol taxes help decrease traffic deaths?
Data: fatality.wf1
48 U.S. states (excluding Alaska and Hawaii): N = 48.
1982 -1988: T =7.
fatality rate = # of traffic accident deaths per 10,000 people.
beertax = tax per a case of beer ($).
Panel-2
Panel-3
What is going on here?
Consider a simple multiple regression model (for a given time t):
Yit = 0 + 1Xit + 2Zi + uit, i = 1, ... , N,
where Zi is a time-invariant regressor.
Pal (Z) would have a positive partial effect on FatalityRate (2 > 0).
Thus, 1 could be positive even if the true 1 is negative.
Panel-4
[3] Panel Data with Two Time Periods
Two equations for 1982 and 1988:
FatalityRatei,1988 = 0 + 1BeerTaxi,1988 + 2Zi + ui,1988.
FatalityRatei,1982 = 0 + 1BeerTaxi,1982 + 2Zi + ui,1982.
FatalityRatei,1988 Fatalityi,1982
= 1(BeerTaxi,1988 BeerTaxi,1982) + (ui,1988-ui,1982). (1)
Panel-5
Comments on the before-and-after estimation results.
As real beer tax increases by $1 per case, the traffic fatality rate
falls by 1.04 deaths per 10,000 people.
This is a big effect, because mean traffic fatality rate is
approximately two.
This before-and-after approach works well if T = 2. What should
we do if T > 2?
Panel-6
[4] Fixed Effects Regression
(A) A simple regression model:
Yit = 0 + 1Xit + 2Zi + uit, i = 1, ... , N, t = 1, ... , T. (1)
For the ith cross-sectional entity, the regression line is (2). The
slope coefficient 1 is the same for all i, but the intercept terms i
are different across different i (but constant over time).
Set:
Yit = 0 + 1Xit + 2D2i + 3D3i + ... + nDni + uit, (3)
where i = 1, ... , n, t = 1, ..., T (nT observations),
1 if i is the 2nd entity;
D 2i =
0 otherwise,
and other dummy variables D3, ..., Dn are similarly defined.
In (3), 1 = 0, 2 = 0 + 2, ... , n = 0 + n.
Panel-7
Entity-demeaned OLS algorithm
Yit = 1Xit + i + uit
1 T
Yi = 1 X i + i + ui , where Yi = t =1Yit .
T
------------------------------------
(Y it Yi ) = 1 ( X it X i ) + ( uit ui ) . (4)
Panel-8
(B) Extension to multiple Xs.
The fixed effects regression model is
Yit = 1X1,it + ... + kXk,it + i + uit, (5)
where i = 1, ... , n, and t = 1, ... , T.
Equivalently, the fixed effects model can be written as
Yit = 0 + 1X1,it + ... + kXk,it + 2D2i + ... + nDni + uit. (6)
Entity-demeaned algorithm
(Y it Yi ) = 1 ( X 1,it X 1,i ) + ... + k ( X k ,it X k ,i ) + ( uit ui ) . (7)
Panel-9
[5] Time and Entity Fixed Effects Model
(1) Motivation.
Return to our FatalityRate example:
Yit = 0 + 1Xit + 2Zi + 3St + uit,
where, Yit = FatalityRate; Xit = BeerTax;
Zi = time-invariant preferences for alcohol or driving of the
people in State i;
St = Time specific effects (common to all states) such as
overall mobile safety improvements.
1 if t is the first time period ;
Let B1t =
0, otherwise.
Define dummy variables B2t, ... , BTt similarly.
Panel-10
[6] Drunk Driving Laws and Traffic Death
Would driving laws and economic conditions matter?
Panel-11
Drinking or drunken driving law do not matter very much.
Economic factors are important.
(4) is the base model.
Average tax = $0.5/case,
and average fatality rate = 2 per 10,000 people.
As tax increases by $0.5, fatality rate drops 0.450.5 = 0.225 (per
10,000).
But this result is somewhat imprecise: The confidence interval for
the effect of BeerTax at 95% of confidence level is:
0.45 1.96 0.22 (-0.88, -0.02),
which is quite wide.
Panel-12
[7] Eviews Exercise
There are four variables in the excel file, country, year, y, and x. Each
variable has 11 observations from the 3rd row to the 14th row. The data are
artificial numbers for three countries, US, Japan and Korea. Notice that the
variable country is alphabetic, not numeric.
STEP 1: Open artificial_panel.xls using Excel. Then, using your mouse, block
the data and copy them.
STEP 2: Open Eviews. Then, type the following on the Eviews window (the
narrow white window below the File, Edit, Object buttons):
create u 12 (enter)
Panel-13
Type the followings on the Eviews window:
Panel-14
Close the window by clicking on X on the North-East corner of the
window. Eviews will ask you whether you want to delete Untitled
Group. Click on the Yes button.
Panel-15
STEP 3: On the workfile, click on the show buttom. Then, a SHOW window
will pop up. Type on the window:
country year y x
Panel-16
Click on OK. Then, a spreadsheet will pop up.
Panel-17
Click on Edit+/- buttom and locate your cursor on the 1-country cell. And push
the right button on your mouse.
Panel-18
Then, you will see that the data from the excel file are pasted to the
spreadsheet.
Panel-19
Close the spreadsheet by clicking on X on the North-East corner.
Eviews will ask you whether you want to delete Untitled Group.
Click on the Yes button.
STET 4: On the workfile, push the save buttom. Determine the drive and file
folder where you want to save the file. Choose the file name
artificial_panel.wf1.
Panel-20
Click on the save button. Then, a Workfile Save window will pop
up. Just click on the ok button.
Panel-21
Then, you will be back to the workfile.
Panel-22
STEP 5: On the workfile, push the Proc button. Choose Structure/Resize
Current Page
Panel-23
Then you will have the Workfile Structure window. Choose Dated
Panel. Then, you will have the following screen.
Panel-24
Type 2001 for Start date, 2004 for End date, country for Cross-
section ID series, and year for Data series. Then, click on OK.
Panel-25
Then, you will be back to the workfile. Save it!!!
STEP 6: Push the objects/new object... button. Choose Equation and choose
art_pan as the name of the object. Then, an Equation Estimation
window will pop up. Type y x on the Equation specification box.
Panel-26
And click on Panel Options.
Panel-27
Choose Fixed for Cross-section, Fixed for Period, and White
(diagonal) for Coef covariance method.
Panel-28
STEP 7: Choose view/Fixed/Random Effects/Cross-section Effects.
Then you will have:
Panel-29
Choose view/Fixed/Random Effects/Period Effects.
Panel-30
Choose view/Fixed/Random Effects Testing/Redundant Fixed Effects.
Panel-31
Panel-32
I found that the F and 2 statistics for the individual dummy variables and the
time dummy variables are computed assuming the error terms in the
regression models are homoskedastic over i and t. So, the results are not
reliable if the error terms are in fact heteroskedastic.
If you would like to test whether time effects are statistically significant,
I would like to suggest you to estimate your model choosing None for Period
but including time-dummy variables as time dummy variables.
Panel-33
(2) Exercise with fatality.wf1.
-----------------------------------------------------------------------------------
variable name variable label
----------------------------------------------------------------------------------
state State ID (FIPS) Code
year Year
spircons Spirits Consumption
unrate Unemployment Rate
perinc Per Capita Personal Income
emppop Employment/Population Ratio
beertax Tax on Case of Beer
sobapt % Southern Baptist
mormon % Mormon
mlda Minimum Legal Drinking Age
dry % Residing in Dry Counties
yngdrv % of Drivers Aged 15-24
vmiles Ave. Mile per Driver
vmilespd Ave. Mile per 1,000 Driver
breath Prelim. Breath Test Law
jaild Mandatory Jail Sentence
comserd Mandatory Community Service
jailcom jaild + comserd
allmort # of Vehicle Fatalities (#VF)
mrall Vehicle Fatality Rate (VFR) = #VF/Population
vfrall 10,000*mrall = VFR per 10,000 people
allnite # of Night-time VF (#NVF)
mralln Night-time VFR (NVFR)
allsvn # of Single VF (#SVF)
a1517 #NVF, 15-17 year olds
mra1517n NVFR, 15-17 year olds
a1829 #VF, 18-20 year olds
a1820n #NVF, 18-20 year olds
mra1820 VFR, 18-20 year olds
mra1820n NVFR, 18-20 year olds
a2124 #VF, 21-24 year olds
mra2124 VFR, 21-24 year olds
a2124n #NVF, 21-24 year olds
mra2124n NVFR, 21-24 year olds
aidall # of alcohol-involved VF
Panel-34
da18 Dummy variable for drinking age = 18
da19 Dummy variable for drinking age = 19
da20 Dummy variable for drinking age = 20
lincperc Log of per capita real income
mraidall Alcohol-Involved VFR
pop Population
pop1517 Population, 15-17 year olds
pop1820 Population, 18-20 year olds
pop2124 Population, 21-24 year olds
miles total vehicle miles (millions)
unus U.S. unemployment rate
epopus U.S. Emp/Pop Ratio
gspch GSP Rate of Change
Dum1982
Dum1983
Dum1984
:
DUM1988
------------------------------------------------------------------------------------
Panel-35
Estimation of the specification (4) on Table 10.1 in p. 368.
Effects Specification
Panel-36
Testing significance of the individual and time dummy variables:
[Estimation choosing Fixed for period and not using dummy variables as
regressor.]
Panel-37
Testing significance of the time dummy variables:
[Estimation choosing None for period and using dummy variables as
regressor.]
Wald Test:
Equation: MIN
Panel-38
Comments on (FEA.5):
What if Assumption #5 fails: so corr(uit,uis|Xit,Xis,i) 0?
OLS panel data estimators of 1 are unbiased, consistent.
The OLS standard errors will be wrong.
Use heteroskedasticity and autocorrelation-consistent standard
errors (clustered standard errors).
The clustered SE formula is NOT the usual (hetero-robust) SE
formula! [Appendix 10.2 (pp. 379 381)].
The clustered SE might not be very accurate if N is small.
Eviews can compute these!
Panel-39
Estimation of the specification (7) on Table 10.1 in p. 368.
Effects Specification
Panel-40
Average tax = $0.5/case,
and average fatality rate = 2 per 10,000 people.
As tax increases by $0.5, fatality rate drops 0.450.5 = 0.225 (per
10,000).
The confidence interval for the effect of BeerTax at 95% of
confidence level is:
0.45 1.96 0.32 (-1.08, 0.18),
which is wider than (-0.88, -0.02).
Panel-41
Panel-42
Panel-43