(please ask for my licence codes, and I will send them to you)
This should hopefully be 4 rather standard questions for you, but I have not figured them out so I would like to have some help.
I am having some computer assignments for my students.
I have a data set based on Stock and Watson’s book Intro. to econometrics (based on Stata, but I think EViews usually is more user-friendly).
I would like to replicate the result for my students (please see the attchment fatality.wf1 which is freely accessible from the website).
First I run a cross-section for 1988
smpl 1988 1988
ls MRALL c beertax
and then for 1982
smpl 1982 1982
ls MRALL c beertax
Then I do this using a FEM between 1982-1988, in order take into account for some omitted variables which do not change over time.
However, in the book (Stock and Watson page 355, eq.( 10.8 ) they also estimate a regression for 2 period Difference panel regression (only with 1988 and 1982). Difference regression (n = 48)
I tried Ls (MRALL(1988)-MRALL(1982)) c (beertax(1988)-beertax(1982)) but it is wrong... but you can see which model I want to estimate (therefore I write this out)
Q1---Therefore, instead I would like to know how to get the following result (for a 2-period panel difference regression)
The estimated result should be as below
MRALL(1988)-MRALL(1982) = –.072 – 1.04(BeerTax(1988)–BeerTax(1982))
(all cross-sections, US states, are included)
(N.B. it fatalities per 10 000 inhabitants)
Q2--- I guess I can change the sample so that we only have 1982 together with 1988 (all cross-sections, US states), like a 2-period Difference panel regression (did not figure that out, but it would be good to know how to do this not very elegant solution anyway).
Q3--- In another part of the question they only use 3 cross sections (only 3 cross-sections, US states: CA, TX, MA, but with all years 1982-1988). How can I change so that only these 3 states are taken into account together with all years between 1982-1988)? (Panel)
Q4--- With rather awkard programming I solved how to Entity-demean the panel (WG, within-group estimator), but is there a canned routine in EViews to solve this?
Thanks!
2-period difference panel regression
Moderators: EViews Gareth, EViews Moderator
2-period difference panel regression
- Attachments
-
- fatality.xlsx
- Fatality.xlsx (original file)
- (143.84 KiB) Downloaded 470 times
-
- fatality - original.wf1
- Fatality (converted file to wf1)
- (142.48 KiB) Downloaded 343 times
Re: 2-period difference panel regression
For Q1 and Q2 the following trick should work:
By the same token, you can confine your analysis to the states of your interest. I am not sure about the corresponding numbers of states, but you can do something along the following lines:
As for your last question, I think you are looking for @meansby function:
Code: Select all
smpl @all if @year = 1988
equation eq.ls mrall-mrall(-6) c beertax-beertax(-6)Code: Select all
smpl @all if state=1 or state=8 or state=13Code: Select all
series mrall_dm = mrall - @meansby(mrall,@crossid,"1982 1988")-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: 2-period difference panel regression
On the last question, if you want to run the regression, use the "cx=f" option to ls
Re: 2-period difference panel regression
Excellent help! Thanks!
Who is online
Users browsing this forum: No registered users and 2 guests
