Page 1 of 2
Fixed Effects- Industry and Year
Posted: Fri Aug 31, 2018 4:28 pm
by AbrahaM
Hi, I have a quick question.
I am analyzing panel data and wanted to run fixed effect model on Eviews and therefore include industry and time (year) fixed effects. My workfile structure is currently dated panel. I know this question was probably asked soo many times, but i still couldn't understand how i have to do it.
I want to group my companies into different industries e.g. financial services= Industry1 energy=industry2 etc etc.? and the time into each year from 2006- 2016.
Also is it possible to use industry and time fixed effects at the same time? or just one and then the other?
Thank you in advance! :)
Re: Fixed Effects- Industry and Year
Posted: Fri Aug 31, 2018 7:20 pm
by startz
You can use industry and time fixed effects at the same time. If you set up your panel to be annual by industry, then EViews will do this for you under estimation options.
Alternatively, if you don't have too many industries you can just create your industry variable and then use @expand in the regression to get fixed effects, taking care about the dummy variable trap.
Re: Fixed Effects- Industry and Year
Posted: Sat Sep 01, 2018 7:52 am
by AbrahaM
Okay thank you very much.
Ah i have about 38 Industries, i think that would be a bit much. But every time i try to change it to industry- Eviews creates an undated panel data again. What am I doing wrongs
Re: Fixed Effects- Industry and Year
Posted: Sat Sep 01, 2018 8:12 am
by startz
38 industries should be no problem.
Re: Fixed Effects- Industry and Year
Posted: Sat Sep 01, 2018 10:08 am
by AbrahaM
Okay thank you. But as soon as I use the Industry i can’t transform it into a dated panel workfile Structure. Can I use dummies for the years?
Thanks in advance. :)
Re: Fixed Effects- Industry and Year
Posted: Sat Sep 01, 2018 10:10 am
by startz
yes, something like
Code: Select all
ls y c x @expand(industry,@droplast) @expand(@year,@droplast)
Re: Fixed Effects- Industry and Year
Posted: Wed Sep 12, 2018 1:47 pm
by Lalan_dk
Hi,
If I interact dummy like industry year and time year, why it turns be near singular matrix? Or it's not allowed to interacting dummy like that?
Re: Fixed Effects- Industry and Year
Posted: Wed Sep 12, 2018 1:51 pm
by startz
You have probably fallen into the dummy variable trap.
Re: Fixed Effects- Industry and Year
Posted: Wed Sep 12, 2018 1:55 pm
by Lalan_dk
Nah, how to detect where the problem is or how to deal with this?
I want to control inflation but i dont have cpi data, so i interact regional dummy with year dummy
Re: Fixed Effects- Industry and Year
Posted: Wed Sep 12, 2018 1:59 pm
by startz
You'll probably have to post your data and the exact command that fails to get more advice.
Re: Fixed Effects- Industry and Year
Posted: Wed Sep 12, 2018 2:01 pm
by Lalan_dk
Ok, wait
Re: Fixed Effects- Industry and Year
Posted: Wed Sep 12, 2018 2:35 pm
by Lalan_dk
I want to estimate ECM with shock, the dependent variable is saving, the independent variable is household age, household age squared, housohold size, number of elder, number of children. I use the squared residual from Mincerian income equation as shock
if i didn't include the dummy interaction, it can give the result,
Code: Select all
smpl if jmliflssaving>0
equation lr.ls saving1 c hh_size head_age head_age^2 elder children
lr.makeresid lr_resid
equation mincertanpaf.ls lhh_income c head_age head_age^2 head_educ
mincertanpaf.makeresid mincertanpaf_resid
equation iecm1.ls d(saving1) d(hh_size) d(head_age) d(head_age^2) d(elder) d(children) hh_size(-1) head_age(-1) head_age(-1)^2 elder(-1) children(-1) lr_resid(-1) d(mincertanpaf_resid^2) mincertanpaf_resid(-1)^2
show iecm1
if i include interaction dummy to control inflation, it give "near singular matrix"
Code: Select all
smpl if jmliflssaving>0
equation lrfi.ls saving1 c hh_size head_age head_age^2 elder children @expand(sc01, @dropfirst)*@expand(ifls, @dropfirst)
lrfi.makeresid lrfi_resid
show lrfi
equation mincerfi.ls lhh_income c head_age head_age^2 head_educ @expand(sc01, @dropfirst)*@expand(ifls, @dropfirst)
mincerfi.makeresid mincerfi_resid
show mincerfi
equation iecm5.ls d(saving1) d(hh_size) d(head_age) d(head_age^2) d(elder) d(children) hh_size(-1) head_age(-1) head_age(-1)^2 elder(-1) children(-1) lrfi_resid(-1) d(mincerfi_resid^2) mincerfi_resid(-1)^2 @expand(sc01, @dropfirst)*@expand(ifls, @drop(1), @drop(2))
show iecm5
sc01 is regional
ifls is the time
Re: Fixed Effects- Industry and Year
Posted: Wed Sep 12, 2018 2:44 pm
by startz
Try using
To be honest I'm not sure what multiplying @expand terms does, although perhaps the EViews team could chime in.
Re: Fixed Effects- Industry and Year
Posted: Wed Sep 12, 2018 5:24 pm
by Lalan_dk
It still give near singular matrix error
Re: Fixed Effects- Industry and Year
Posted: Wed Sep 12, 2018 6:47 pm
by startz
Code: Select all
equation mincerfi.ls lhh_income c head_age head_age^2 head_educ @expand(sc01,ifls, @dropfirst)
runs fine on my machine.