## 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: 3337
Joined: Wed Sep 17, 2008 2:25 pm

### Re: Dummy Variables

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

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

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.

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

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: 11811
Joined: Tue Sep 16, 2008 5:38 pm

### Re: Dummy Variables

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.

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

### Re: Dummy Variables

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: 11811
Joined: Tue Sep 16, 2008 5:38 pm

### Re: Dummy Variables

The Command Reference has full details on how to use @expand.

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

### Re: Dummy Variables

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

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
Variables
goog.png (75.7 KiB) Viewed 5601 times
File
Panel Data.jpg (104.93 KiB) Viewed 5601 times

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

### Re: Dummy Variables

Not quite sure what you're trying to do?

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

Code: Select all

`series dum = 0smpl if var01="GOOG"dum = 1smpl @all`

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

### Re: Dummy Variables

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.

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

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

### Re: Dummy Variables

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

### Re: Dummy Variables

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

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

### Re: Dummy Variables

What have you done so far?

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

### Re: Dummy Variables

for the moment I have no idea.