Dummy Variables

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

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

Re: Dummy Variables

Postby startz » Sat May 19, 2012 7:37 am

How do you know which county an observation is from? (You may want to give an example of your data or post your workfile.)

sabine
Posts: 1
Joined: Thu May 31, 2012 8:02 am

Re: Dummy Variables

Postby sabine » Thu May 31, 2012 8:07 am

Hi ,
you can write genr X= 1*(year>=1990) + 0*(year<1990). i test this command and it works.

best,
Sabine

purishiru
Posts: 8
Joined: Mon Jun 04, 2012 5:53 am

Re: Dummy Variables

Postby purishiru » Tue Jun 05, 2012 2:37 am

Hello, I need help.

I am new in both eviews and econometrics. Help will very much appreciated.
1. I am doing a panel data study for my thesis, and one of my 5 variables is a dummy of a Mod, which consist of three : A,B, C. one of the three will be represented by intercept (C), however. so that leave another two.
the dummy is for Mod(A,B)
I have tried several ways suggested by the forum, but i keep getting error message.
if i use Genr - generate series by equation - enter @expand(Mod); - it show : @EXPAND is not a genr or series expresion function , if I put equation
e.g. roe c gdp cpi @expand(Mod) or roe gdp cpi @expand(Mod); - it says: syntax error
I have tried to write : roe c gdp cpi Group 01 @expand(Mod)
its not working.

2. I need it for a regression in which i am using a pool. can the dummy equation and pool use together? or maybe an alternative so the regression could work as one.
3. is it possible to have the dummy input together in imported excel and have it worked?

I can´t find these on internet.
can someone please help me out??

I am very new to this,as I have acquainted with eviews only for a month. It would be great help if the explanation can go step by step.

Thank you in advance for save me here!

psantoro
Posts: 7
Joined: Sat Feb 25, 2012 12:40 am

Re: Dummy Variables

Postby psantoro » Wed Aug 01, 2012 1:29 pm

Just a quick econometrics query: when creating date dummies, say monthly, wouldn't you need 11 dummies as opposed to 12 to avoid what's commonly called the 'dummy variable trap'? This seems to be the case since using the @expand(@monthly) command yielded to a pop-up saying that a near-singular matrix is occuring when I test for a VAR.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 11405
Joined: Tue Sep 16, 2008 5:38 pm

Re: Dummy Variables

Postby EViews Gareth » Wed Aug 01, 2012 1:31 pm

Indeed, hence:

EViews Gareth wrote:Note that by default the @expand keyword will create a full set of dummies, thus you should not include a constant in your equation (since you'll create a singular matrix problem).

Alternatively, @expand lets you drop certain values from the expansion to avoid the singularity problem. You can use @dropfirst or @droplast to drop the first or the last categorisation. Thus:

Code: Select all

Y C X @expand(sex, @dropfirst)

Would regress Y on a constant, X and SEX=M, and not SEX=F.
Follow us on Twitter @IHSEViews

psantoro
Posts: 7
Joined: Sat Feb 25, 2012 12:40 am

Re: Dummy Variables

Postby psantoro » Thu Aug 02, 2012 10:12 am

Thanks for your response. I'm estimating a univariate VAR as a first step to testing for linearity, in turn to see whether a smooth transition AR model is appropriate. The @droplast command worked, but if I also wanted to drop June (month 6), how would I input a code for that?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 11405
Joined: Tue Sep 16, 2008 5:38 pm

Re: Dummy Variables

Postby EViews Gareth » Thu Aug 02, 2012 10:20 am

The Command Reference has full details on how to use @expand.
Follow us on Twitter @IHSEViews

Praharsh22
Posts: 2
Joined: Sat Aug 18, 2012 3:29 pm

Re: Dummy Variables

Postby Praharsh22 » Sat Aug 18, 2012 3:50 pm

Hi all,

I am fairly new at Eviews 7. I want to create dummy variables to consider seasonal effect on a daily data (7 days). Please help me.

Truike11
Posts: 5
Joined: Thu Nov 28, 2013 5:28 am

Re: Dummy Variables

Postby Truike11 » Tue Dec 03, 2013 1:48 am

Dear Eviews users,

I'm also having problems creating a dummy in my panel data. In my Tweets and Quotesdf are the tweets of 98 stocks and the first differenced stock quotes. Now I want to establish a dummy for the Google tweets & stocks since I'm hoping that my data will then be normally distributed. Can someone help me? I already tried making a dummy but I didn't work.

Thanks in advance for your time, very much appreciated!
Attachments
goog.png
Variables
goog.png (75.7 KiB) Viewed 4871 times
Panel Data.jpg
File
Panel Data.jpg (104.93 KiB) Viewed 4871 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 11405
Joined: Tue Sep 16, 2008 5:38 pm

Re: Dummy Variables

Postby EViews Gareth » Tue Dec 03, 2013 9:09 am

Not quite sure what you're trying to do?

Just create a dummy whenever the stock name is "GOOG"?

Code: Select all

series dum = 0
smpl if var01="GOOG"
dum = 1
smpl @all
Follow us on Twitter @IHSEViews

ecofin
Posts: 178
Joined: Fri May 10, 2013 11:24 am

Re: Dummy Variables

Postby ecofin » Fri Jan 03, 2014 2:23 am

I would like to create dummy variable for 400 obs daily (7 day week) from 1990/01/01 to 04/02/1991.
1-a dummy variable eqaul to 1 for 01/01/1990 to 31/01/1990 and equal 1 for 01/03/1990 to 31/03/1990...etc, and for monthly and quarterly ...etc date.
2-a dummy variable for No-dated, dummy equal to 1 for 1 and 2 obs and 5 and 6 obs...etc.

best regrads.
Attachments
dum3_quarterly.png
dum3_quarterly.png (71.65 KiB) Viewed 4742 times
dum2_No-dated.png
dum2_No-dated.png (58.73 KiB) Viewed 4742 times
dum1_daily.png
dum1_daily.png (72.91 KiB) Viewed 4742 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 11405
Joined: Tue Sep 16, 2008 5:38 pm

Re: Dummy Variables

Postby EViews Gareth » Fri Jan 03, 2014 6:22 am

Follow us on Twitter @IHSEViews

ecofin
Posts: 178
Joined: Fri May 10, 2013 11:24 am

Re: Dummy Variables

Postby ecofin » Fri Jan 03, 2014 10:23 am

I have no idea, would you like to help me :cry:
best regards

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 11405
Joined: Tue Sep 16, 2008 5:38 pm

Re: Dummy Variables

Postby EViews Gareth » Fri Jan 03, 2014 10:56 am

What have you done so far?
Follow us on Twitter @IHSEViews

ecofin
Posts: 178
Joined: Fri May 10, 2013 11:24 am

Re: Dummy Variables

Postby ecofin » Fri Jan 03, 2014 11:00 am

for the moment I have no idea.


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 11 guests