## 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

magister
Posts: 16
Joined: Tue Mar 08, 2016 4:14 pm

### Re: Dummy Variables

EViews Gareth wrote:The .adjust bit is just creating a sequence of seven 1s followed by twenty one 0s. You could do the same thing with series.fill instead by manually writing out that sequence.

Hi, Gareth,

I've downloaded a demo version of EViews 8 and the program worked, thank you. But it turned out to be something different from what I expected. I've made some adjustments and I upload the workfile to see exactly what I meant. Of course, this is due to my inaccuracy in explaining what I really want. Now the problem is that, having 4 dummies, I lose some observation for certain months, because for some months, there are 5 weeks and thus 5 dummies. More exactly, I lose 65 observations from the end of the months (4-5 observations per year) and valuable information for weekly patterns. For 2000, the weekly returns that I lose are on 1/31/2000, 5/29/2000, 7/31/2000 and 10/30/2000. Is there a way to address this problem?

Thank you again,

Nicu
Attachments
dummies.wf1

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

### Re: Dummy Variables

As I said before, you need to define what you mean by a week. Until you can explain how you want to define the dummies in English, we cannot tell you how to do it in EViews.

magister
Posts: 16
Joined: Tue Mar 08, 2016 4:14 pm

### Re: Dummy Variables

EViews Gareth wrote:As I said before, you need to define what you mean by a week. Until you can explain how you want to define the dummies in English, we cannot tell you how to do it in EViews.

Hi, Gareth,

Sorry for disturbing again, I have a new request. I realized that EViews has converted the daily returns into weekly returns using only full weeks. For instance, if the first trading day was on Tuesday, it didn't take it into consideration, and started with the second full week (5 trading days, in my case). Thus, I lose valuable observations. To avoid this, I've decided to use daily returns instead and compute weekly returns for each day, except first five trading days from the first week of the first year (using log/log(-5) function). After, I want to create 5 dummies: first 5 days (d1) to take value 1 and 0 otherwise, the following 5 days (d2) 1 and 0 otherwise and so forth. There will be a special case for 5th dummy, corresponding to 5th week (d5), which will have less than 5 days.
Can you create a program for this, which follows the same logic as the previous one, but with some adjustments for 5th dummy?

Thank you,

N.

jiyul_0602
Posts: 2
Joined: Fri Mar 25, 2016 6:19 am

### Re: Dummy Variables

Hello,

I have a question. My data is a little bit complicated with a mixed of company data and country data. I already created the Dummy variable in the excel file for each of the company (the criteria is the same but since it is unbalanced panel data so the each company has 1 column for the series and 1 column for the Dummy). Since I have a lot of companies, I group all the series and all dummies of all the companies together to make 2 groups (I didn't create the dummies in Eviews). However, when I run the equation, I use the group I created and it said there was an index error for the group with the Dummies but not for the group with the series.
Also, for the dummies, since I have missing data so I have cells with NA and normal cells with 0 or 1. Is that why the equation does not run through?

I wonder if you can help me with this problem.
Thank you very much!

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

### Re: Dummy Variables

It is very difficult to understand what you are asking. Perhaps you can explain in more detail with an example.

jiyul_0602
Posts: 2
Joined: Fri Mar 25, 2016 6:19 am

### Re: Dummy Variables

EViews Gareth wrote:It is very difficult to understand what you are asking. Perhaps you can explain in more detail with an example.

I attach in this post a sample of the data that I'm dealing with. So, the first few columns are company data and the highlighted columns towards the end are the country data. For each company, I have 1 column for dummy variable. The company data of each company is different and the country data is applied to all the companies. I wonder how I can organize or group these data when I import them into Eviews in order to run the regression.

Let's say the regression is y=a+b.x1+cDummy.x2+d.Countrydata+...

Attachments
Automobile-panel.xlsx

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

### Re: Dummy Variables

still not clear

michaelmcg
Posts: 2
Joined: Tue Mar 29, 2016 4:04 am

### Re: Dummy Variables

Hello
I am new to E-Views and am looking for some help concerning dummy variables.
I am working on my dissertation which is looking at the relationship between economic growth and population health.
I have panel data with 30 countries for the years 2005-2014 structured as such:
Country Variable 2005 2006 .. 2014
Austria gdp
Austria phy_cap

And so on for each country with 7 different variables.

I am looking to replicate the methodology of a paper I am following which has included year dummies.
How would I go about doing this in E-Views with my data.

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

### Re: Dummy Variables

@expand(@year)

michaelmcg
Posts: 2
Joined: Tue Mar 29, 2016 4:04 am

### Re: Dummy Variables

EViews Gareth wrote:@expand(@year)

It says "Near singular matrix" when I try to use this?

If it helps, the equation im trying to estimate is:
log(yrgdp) c log(yrphy_cap) log(yrlabour) yrschooling yrexp yrexp_sq yrlife_exp

Thanks

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

### Re: Dummy Variables

Dummy variable trap. Remove the constant

Tuinsmurf
Posts: 11
Joined: Thu Mar 31, 2016 5:44 am

### Re: Dummy Variables

Hi there,

I would like to change a dummy variable to indicate the opposite, i.e I'd like to switch around the 1's and 0's.

What would be the command for this in EViews?

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

### Re: Dummy Variables

Code: Select all

`series d2=1-d1`

manthonisz
Posts: 9
Joined: Tue Nov 11, 2014 10:32 pm

### Re: Dummy Variables

Hi guys,

I'm looking to create a dummy variable for an ordered probit model which takes the value of:

- 1 if variable_A is <2
- 2 if variable_A is =>2 and =<2.50
- 3 if variable_A is =>2.50 and =<3.00
- 4 if variable_A is >3

I tried all sorts of techniques using the recode function but wasn't able to get it to work. I'd be grateful for any ideas people might have.

Thanks so much!

Michael

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

### Re: Dummy Variables

series dummy = -1
dummy = @recode(dummy>=2 and dummy<2.5,-2,dummy)
dummy = @recode(dummy>=2.5 and dummy<3,-3,dummy)
etc.

### Who is online

Users browsing this forum: No registered users and 2 guests