Page 6 of 10

Re: Dummy Variables

Posted: Tue Jun 16, 2015 1:47 pm
by amal
What variables should I remove?

Re: Dummy Variables

Posted: Tue Jun 16, 2015 2:14 pm
by EViews Gareth
There is no way anyone can answer that for you.

Re: Dummy Variables

Posted: Thu Jun 18, 2015 7:02 am
by jlbrillet
Hello from Paris,

In my opinion, the easiest way of manipulating dummy variables is the following;

Create a time trend using the date and adding a fraction to the previous value in case of quarterly data.

For quarterly data over a 1980 - 2020 period:

smpl 1980q1 1980q1
genr t=1980
smpl 1980q2 2020q4
genr t=t(-1)+0.25

Then you create "logical" dummies by stating a condition.

For instance:;

in 1984 second quarter : (t=1984.25)
starting in 1984 second quarter : (t>=1984.25)
in 1984 : (t>=1984)*(t<1985)

etc....

These logical variables do not need to be updtaed, forecasted.....

Re: Dummy Variables

Posted: Wed Sep 02, 2015 10:02 am
by adnma
Hi!

In my panel data set, I have the data in the following format
Year Company Industry
2010 ABC Pharma
2011 ABC Pharma
2012 ABC Pharma
2010 DEF Electricals
2011 DEF Electricals
2012 DEF Electricals
2010 MNO Finance
2011 MNO Finance
2012 MNO Finance

I want to create industry dummies for each of the industry groups, so that in my regression I can find industry effects
Could anybody suggest a method by which I can do so???
Thanks in advance.....

Re: Dummy Variables

Posted: Wed Sep 02, 2015 10:10 am
by EViews Gareth
Just use @expand(industry, @dropfirst) as a regressor.

Re: Dummy Variables

Posted: Sun Sep 13, 2015 3:10 am
by adnma
Hi Garreth!
Thanks a lot for the reply. It really helped. :D :D :D
However, I have another question for the same data set. I now need to control for "industry effects and "time effects" (both together).
If we use STATA, the approach is as below: (My doubt is that HOW DO I REPLICATE THE BELOW METHODOLOGY IN EVIEWS :?: ). Kindly advice me in this regard.....


"In STATA, you can use the xi functionality that's built in. Let industry be a variable indicating the industry of each observation and year being the year variable. If you have a simple regression of y on x, then adding the industry and year fixed effects is as simple as
xi: regress y x i.industry i.year


The command xi says that there is some x variable that you want to become a set of dummy or indicator variables based on each different value the variable can have. The i. simple tells STATA which variables you would like to transform.

STATA automatically drops one of the created dummy/indicator variables so that your model does not suffer from exact multicollinearity."

Re: Dummy Variables

Posted: Sun Sep 13, 2015 7:52 am
by EViews Gareth
@expand does something similar

Re: Dummy Variables

Posted: Sat Nov 21, 2015 10:36 am
by JohnM
hello,

being new to eviews, I have some issues creating dummy variables.
I want to create a dummy variable (1=cash 0=all other). I generated and defined them on my own

In regression, I used @expand(cash) and at first i had the collinear probelm. I looked at this http://www.eviews.com/Learning/dummies.html, and removed the constant.
If i want to include the constant to the regression, I read here that I have to use the @expand(cash, @dropfirst). This would regress Y with the constant, with Xs and with my dummy?

Re: Dummy Variables

Posted: Sat Nov 21, 2015 10:43 am
by startz
Yes. But why not just try it to see what happens?

Re: Dummy Variables

Posted: Thu Nov 26, 2015 10:12 am
by JohnM
This is my file.
I created the dum_cash dummy variable with the generate (dum_cash = 0) and then I edited it and put the value 1 to the transactions with cash.
I want to run a regression of cars_y with all the other variables, including the dummy and the constant. The estimation command I use is " LS CARS_Y_ C ROE_X1_ LN_MV TOTAL_DEBT_COMMON_EQUITY MARKET_VALUE_TO_BOOK__X5 PE_X6_ @EXPAND(DUM_CASH, @DROPFIRST) ".
I believe that it is not correct to use the @dropfirst.
What is my alternative?

Re: Dummy Variables

Posted: Thu Nov 26, 2015 10:14 am
by startz
There's nothing wrong with what you've done, but instead of @expand you could simply have included dum_cash.

Re: Dummy Variables

Posted: Thu Nov 26, 2015 11:19 am
by JohnM
Thank you very much for taking time answering me. :)

Re: Dummy Variables

Posted: Sat Jan 23, 2016 6:14 am
by skdahems
Hey there,

i have monthly panel data from 2003 to 2013 for 25 countries. I want to estimate a fixed effects model with a shift in coefficients during the financial crisis. So i need a dummy variable for each country just for the crisis period to estimate the fixed effects for the crisis. For example for Spain from 2008M10 to 2013M12 the values are equal to one and all other values are 0.
A for loop with something like this:
series crisis = @recode (@date>@dateval("2008m9"), 1, 0)
but with the crossid selction.
Can you help me?
Thanks a lot

Re: Dummy Variables

Posted: Sat Jan 23, 2016 8:23 am
by startz
skdahems wrote:Hey there,

i have monthly panel data from 2003 to 2013 for 25 countries. I want to estimate a fixed effects model with a shift in coefficients during the financial crisis. So i need a dummy variable for each country just for the crisis period to estimate the fixed effects for the crisis. For example for Spain from 2008M10 to 2013M12 the values are equal to one and all other values are 0.
A for loop with something like this:
series crisis = @recode (@date>@dateval("2008m9"), 1, 0)
but with the crossid selction.
Can you help me?
Thanks a lot

Maybe

Code: Select all

series crisis = @recode (@date>@dateval("2008m9") and country="Spain", 1, 0)

Re: Dummy Variables

Posted: Sun Jan 24, 2016 5:55 am
by skdahems
Thanks a lot,
it works, so i can at least create the dummy variables manually for all 25 countries.