Implementing dummy

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

Puninzo
Posts: 4
Joined: Tue Aug 12, 2014 5:30 am

Implementing dummy

Postby Puninzo » Tue Aug 12, 2014 5:50 am

Hi there,

I have a question concerning dummy variable implementation.

I'm working on the relation between commodity price returns and a set of weather variables.

I want to look into 2 things:
1) If the effect of the weather on returns during the period when the crop is out on the field (March - December)
2) If the effect of the weather on returns has become bigger the last 10 years.

The current code doesn't include dummies, but simply makes several regressions.
I could compare the significant coefficients with z = (B1 - B2) / SQRT ( (STDerror1^2) + STDerror2^2)) right?

smpl @all

genr returns = dlog(price)
genr Fog_ice_Freezing = wt01
genr Heavyfog = wt02
genr Thunder = wt03
genr Ice_or_snow_pellets = wt04
genr Hail = wt05
genr Glaze_or_rime = wt06
genr Volcanic_ash = wt07
genr Smoke_or_haze = wt08
genr Blowing_or_drifting_snow = wt09
genr Tornado_Watersprout = wt10
genr Damaging_winds = wt11
genr Mist = wt13
genr Drizzle = wt14
genr Freezing_drizzle = wt15
genr Rain = wt16
genr Freezing_rain = wt17
genr Unknown_source_precip = wt19
genr Ground_fog = wt21
genr Ice_or_freezing_fog = wt22
genr Fog2 = wv01
genr Thunder2 = wv03
genr Ash2 = wv07
genr Rain2 = wv20

equation reg.ls returns c Heavyfog Thunder Ice_or_snow_pellets Hail Glaze_or_rime Volcanic_ash Smoke_or_Haze Blowing_or_drifting_snow Tornado_Watersprout Damaging_winds Drizzle Freezing_drizzle Freezing_rain Ice_or_freezing_fog
equation reg1.ls returns c Heavyfog(-1) Thunder(-1) Ice_or_snow_pellets(-1) Hail(-1) Glaze_or_rime(-1) Volcanic_ash(-1) Smoke_or_Haze(-1) Blowing_or_drifting_snow(-1) Tornado_Watersprout(-1) Damaging_winds(-1) Drizzle(-1) Freezing_drizzle(-1) Freezing_rain(-1) Ice_or_freezing_fog(-1)

equation regmin.ls returns c Thunder Hail Volcanic_ash Tornado_Watersprout Damaging_winds
equation regmin1.ls returns c Thunder(-1) Hail(-1) Volcanic_ash(-1) Tornado_Watersprout(-1) Damaging_winds(-1)

smpl if @month>=3 and @month<=12

equation regA.ls returns c Heavyfog Thunder Ice_or_snow_pellets Hail Glaze_or_rime Volcanic_ash Smoke_or_Haze Blowing_or_drifting_snow Tornado_Watersprout Damaging_winds Drizzle Freezing_drizzle Freezing_rain Ice_or_freezing_fog
equation reg1A.ls returns c Heavyfog(-1) Thunder(-1) Ice_or_snow_pellets(-1) Hail(-1) Glaze_or_rime(-1) Volcanic_ash(-1) Smoke_or_Haze(-1) Blowing_or_drifting_snow(-1) Tornado_Watersprout(-1) Damaging_winds(-1) Drizzle(-1) Freezing_drizzle(-1) Freezing_rain(-1) Ice_or_freezing_fog(-1)

equation regminA.ls returns c Thunder Hail Volcanic_ash Tornado_Watersprout Damaging_winds
equation regmin1A.ls returns c Thunder(-1) Hail(-1) Volcanic_ash(-1) Tornado_Watersprout(-1) Damaging_winds(-1)

smpl 2004M1 @last

equation extreme.ls returns c Thunder Hail Volcanic_ash Tornado_Watersprout Damaging_winds
equation extreme1.ls returns c Thunder(-1) Hail(-1) Volcanic_ash(-1) Tornado_Watersprout(-1) Damaging_winds(-1)

smpl 2004M1 @last if @month>=3 and @month<=12

equation extremea.ls returns c Thunder Hail Volcanic_ash Tornado_Watersprout Damaging_winds
equation extreme1a.ls returns c Thunder(-1) Hail(-1) Volcanic_ash(-1) Tornado_Watersprout(-1) Damaging_winds(-1)


I have tried to implement the following code to insert the dummy to check if the coefficients are significantly different.

Dummy on the field
series field=@recode(@month>=3 and @month<=12,1,0)

Dummy last 10 years
series lastten=recode(@year>2003,1,0)

Code is for shortest model:

Field:
equation regminfield.ls returns c Thunder Hail Volcanic_ash Tornado_Watersprout Damaging_winds field Thunder*field Hail*field Volcanic_ash*field Tornado_Watersprout*field Damaging_winds*field

I implement te same interaction variable for the last ten years dummy, but for both of the dummies I get a "near singular matrix error".

Someone knows what im doing wrong?
I can compare the results for the regressions seperately however, I would like to implement a dummy variable

Puninzo
Posts: 4
Joined: Tue Aug 12, 2014 5:30 am

Re: Implementing dummy

Postby Puninzo » Tue Aug 12, 2014 7:45 am

I have added the excel file used with the program.

I'm still not sure what to do to answer both questions.
Looked into breakpoint testing, but not yet certain what to use.
Attachments
corn.xlsx
(119.3 KiB) Downloaded 197 times

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

Re: Implementing dummy

Postby startz » Tue Aug 12, 2014 7:52 am

You might want to post your EViews workfile, including the exact equation that gives you an error message.

Puninzo
Posts: 4
Joined: Tue Aug 12, 2014 5:30 am

Re: Implementing dummy

Postby Puninzo » Tue Aug 12, 2014 12:25 pm

Hi,

Hereby my workfile.
The workfile basicly contains 2 equations:

1) Multiple regression with (almost) all the variables (known as reg.ls)
2) Multiple regression with a selection of a few weather variables (known as regmin.ls)

Ive ran lagged regressions and also created different samples etc. However I would like to try to include a dummy to check whether there is a signficant difference between a) time crops are out on the field b) last 10 years of sample (runs from 1980M1 - 2013M12)

The code that generates the problem is linked to creating this dummy for the time the crops are out on the field (March - December)

smpl @all

series field=@recode(@month>=3 and @month<=12,1,0)

equation regminfield.ls returns c Thunder Hail Volcanic_ash Tornado_Watersprout Damaging_winds field Thunder*field Hail*field Volcanic_ash*field Tornado_Watersprout*field Damaging_winds*field
Attachments
corn.wf1
(235.3 KiB) Downloaded 166 times
Last edited by Puninzo on Tue Aug 12, 2014 12:42 pm, edited 1 time in total.

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

Re: Implementing dummy

Postby startz » Tue Aug 12, 2014 12:35 pm

Thunder and thunder*field are almost perfectly collinear. Hail and Hail*field are pretty bad too. My guess is that's your problem.

Puninzo
Posts: 4
Joined: Tue Aug 12, 2014 5:30 am

Re: Implementing dummy

Postby Puninzo » Tue Aug 12, 2014 1:08 pm

That is the problem, some weather events only occur during the time the crops are out on the field.
Would you know a different way of including the dummy or should I just stick to running 2 seperate regressions and comparing the coefficients with a z-test?

Thanks for your input so far

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

Re: Implementing dummy

Postby startz » Tue Aug 12, 2014 1:12 pm

If the events only occur when the crops are out in the field, then you can't find out what happens when the crops aren't in the field. (If I understand what you're saying.)


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 1 guest