Fixed Effects- Industry and Year

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

AbrahaM
Posts: 7
Joined: Mon Aug 27, 2018 10:30 am

Fixed Effects- Industry and Year

Postby AbrahaM » Fri Aug 31, 2018 4:28 pm

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! :)

startz
Non-normality and collinearity are NOT problems!
Posts: 3775
Joined: Wed Sep 17, 2008 2:25 pm

Re: Fixed Effects- Industry and Year

Postby startz » Fri Aug 31, 2018 7:20 pm

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.

AbrahaM
Posts: 7
Joined: Mon Aug 27, 2018 10:30 am

Re: Fixed Effects- Industry and Year

Postby AbrahaM » Sat Sep 01, 2018 7:52 am

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

startz
Non-normality and collinearity are NOT problems!
Posts: 3775
Joined: Wed Sep 17, 2008 2:25 pm

Re: Fixed Effects- Industry and Year

Postby startz » Sat Sep 01, 2018 8:12 am

38 industries should be no problem.

AbrahaM
Posts: 7
Joined: Mon Aug 27, 2018 10:30 am

Re: Fixed Effects- Industry and Year

Postby AbrahaM » Sat Sep 01, 2018 10:08 am

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. :)

startz
Non-normality and collinearity are NOT problems!
Posts: 3775
Joined: Wed Sep 17, 2008 2:25 pm

Re: Fixed Effects- Industry and Year

Postby startz » Sat Sep 01, 2018 10:10 am

yes, something like

Code: Select all

ls y c x @expand(industry,@droplast) @expand(@year,@droplast)

Lalan_dk
Posts: 22
Joined: Tue Apr 10, 2018 9:51 pm

Re: Fixed Effects- Industry and Year

Postby Lalan_dk » Wed Sep 12, 2018 1:47 pm

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?

startz
Non-normality and collinearity are NOT problems!
Posts: 3775
Joined: Wed Sep 17, 2008 2:25 pm

Re: Fixed Effects- Industry and Year

Postby startz » Wed Sep 12, 2018 1:51 pm

You have probably fallen into the dummy variable trap.

Lalan_dk
Posts: 22
Joined: Tue Apr 10, 2018 9:51 pm

Re: Fixed Effects- Industry and Year

Postby Lalan_dk » Wed Sep 12, 2018 1:55 pm

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

startz
Non-normality and collinearity are NOT problems!
Posts: 3775
Joined: Wed Sep 17, 2008 2:25 pm

Re: Fixed Effects- Industry and Year

Postby startz » Wed Sep 12, 2018 1:59 pm

You'll probably have to post your data and the exact command that fails to get more advice.

Lalan_dk
Posts: 22
Joined: Tue Apr 10, 2018 9:51 pm

Re: Fixed Effects- Industry and Year

Postby Lalan_dk » Wed Sep 12, 2018 2:01 pm

Ok, wait

Lalan_dk
Posts: 22
Joined: Tue Apr 10, 2018 9:51 pm

Re: Fixed Effects- Industry and Year

Postby Lalan_dk » Wed Sep 12, 2018 2:35 pm

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
Attachments
data_skripsi.wf1
(48.44 MiB) Downloaded 363 times

startz
Non-normality and collinearity are NOT problems!
Posts: 3775
Joined: Wed Sep 17, 2008 2:25 pm

Re: Fixed Effects- Industry and Year

Postby startz » Wed Sep 12, 2018 2:44 pm

Try using

Code: Select all

@expand(sc01, ifls, @dropfirst)

To be honest I'm not sure what multiplying @expand terms does, although perhaps the EViews team could chime in.

Lalan_dk
Posts: 22
Joined: Tue Apr 10, 2018 9:51 pm

Re: Fixed Effects- Industry and Year

Postby Lalan_dk » Wed Sep 12, 2018 5:24 pm

It still give near singular matrix error

startz
Non-normality and collinearity are NOT problems!
Posts: 3775
Joined: Wed Sep 17, 2008 2:25 pm

Re: Fixed Effects- Industry and Year

Postby startz » Wed Sep 12, 2018 6:47 pm

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.


Return to “Estimation”

Who is online

Users browsing this forum: Google [Bot] and 29 guests