Page 8 of 10

Re: Dummy Variables

Posted: Thu Mar 10, 2016 2:01 pm
by magister
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

Re: Dummy Variables

Posted: Thu Mar 10, 2016 2:04 pm
by EViews Gareth
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.

Re: Dummy Variables

Posted: Fri Mar 11, 2016 12:59 pm
by magister
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.

Re: Dummy Variables

Posted: Fri Mar 25, 2016 6:31 am
by jiyul_0602
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!

Re: Dummy Variables

Posted: Fri Mar 25, 2016 7:58 am
by EViews Gareth
It is very difficult to understand what you are asking. Perhaps you can explain in more detail with an example.

Re: Dummy Variables

Posted: Fri Mar 25, 2016 8:25 am
by jiyul_0602
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+...

Thank you for your help!

Re: Dummy Variables

Posted: Fri Mar 25, 2016 8:38 am
by EViews Gareth
still not clear

Re: Dummy Variables

Posted: Tue Mar 29, 2016 4:12 am
by michaelmcg
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.
Thanks in advance

Re: Dummy Variables

Posted: Tue Mar 29, 2016 11:07 am
by EViews Gareth
@expand(@year)

Re: Dummy Variables

Posted: Wed Mar 30, 2016 2:46 am
by michaelmcg
@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

Re: Dummy Variables

Posted: Wed Mar 30, 2016 3:28 am
by EViews Gareth
Dummy variable trap. Remove the constant

Re: Dummy Variables

Posted: Sun Apr 03, 2016 9:39 am
by Tuinsmurf
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?

Re: Dummy Variables

Posted: Sun Apr 03, 2016 9:54 am
by startz

Code: Select all

series d2=1-d1

Re: Dummy Variables

Posted: Thu May 11, 2017 1:45 am
by manthonisz
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

Re: Dummy Variables

Posted: Thu May 11, 2017 5:52 am
by startz
series dummy = -1
dummy = @recode(dummy>=2 and dummy<2.5,-2,dummy)
dummy = @recode(dummy>=2.5 and dummy<3,-3,dummy)
etc.