Page 1 of 1

Dummy Variable

Posted: Fri Sep 10, 2010 10:34 am
by makaveli1981
Hi!

EViews 6

I have 3 series:
- net income as dependent variable (NI)
- stock returns as independent variable (RET)
- and a dummy variable: 1 if stock returns are negative, 0 if positive (NEG)

Regression: NI = c(1) + c(2)*RET + c(3)*NEG + c(4)*RET*NEG

My question is, how can I become a graph of this regression (two lines with different slopes for negative and positive stock returns in ONE picture)

Many thanks


Thomas

Re: Dummy Variable

Posted: Fri Sep 10, 2010 10:39 am
by EViews Gareth
Could you explain what you mean by "graph of this regression"?

Re: Dummy Variable

Posted: Fri Sep 10, 2010 10:46 am
by makaveli1981
RET-Axis and NI-Axis with all observations and linear regression (OLS), but two sections with different slopes according to dummy for negative and positive stock returns

Re: Dummy Variable

Posted: Fri Sep 10, 2010 10:50 am
by EViews Gareth
I cannot think of a way to do that.

Re: Dummy Variable

Posted: Fri Sep 10, 2010 11:23 am
by startz
Maybe something like this:

Create two series where the first is the fitted values when the dummy equals 1 and the second is when the dummy equals 0. Then recode the first series to NA when the dummy equals 0 and vice versa. Then graph both series against the independent variable.

Re: Dummy Variable

Posted: Fri Sep 10, 2010 12:18 pm
by EViews Glenn
Good idea. You should be able to do the recode off of the single forecast series since you have the dummy.

(Gareth does point out to me that because you have the restriction, this won't work since the scatter with regression line will do the two regression lines without restriction).

Re: Dummy Variable

Posted: Fri Sep 10, 2010 1:59 pm
by makaveli1981
it sounds not bad... i'll try it...

i found an easy example in my statistic-script
it's structural interruption:

y/ x / D (dummy variable)

1.7/ 1/ 0
2.7/ 2/ 0
4.8/ 3/ 0
4.7/ 4/ 0
6.9/ 5/ 0
6.8/ 6/ 0
7.5/ 7/ 0
8.1/ 8/ 0
10.3/ 9/ 0
11.3/ 10/ 0
17.2/ 11/ 1
20.4/ 12/ 1
21.9/ 13/ 1
23/ 14/ 1
26.3/ 15/ 1
27.9/ 16/ 1
29.8/ 17/ 1
32.3/ 18/ 1
34.6/ 19/ 1
35.9/ 20/ 1

result: y = 1.000 + 0.997*x - 6.169*D + 1.075*D*x

splited regression:
y = 1.000 + 0.997*x if x = 1,...,10
y = -5.169 + 2.072*x if x = 11,...,20

when I run this regression in eviews using y=c(1)+c(2)*x+c(3)*dv+c(4)*dv*x as equation, I become correct coefficients as result. But I don't know how to make a scatter then... And in my script I can see two regression lines - splited! And I'm pretty sure that this guy, who made it, made it with eviews :lol: