Chart with date axis from [t-x to t+x]

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

javiersan
Posts: 184
Joined: Mon Jan 19, 2009 8:18 am

Chart with date axis from [t-x to t+x]

Postby javiersan » Thu Jan 27, 2011 9:17 am

Hello,

Is it possible to do this type of chart?
chart1.JPG
chart1.JPG (82.36 KiB) Viewed 6740 times
Thanks,

Javier

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

Re: Chart with date axis from [t-x to t+x]

Postby EViews Gareth » Thu Jan 27, 2011 10:33 am

There's nothing built in that will do it. You can do it with some trickery though. See below:

Code: Select all

create a 1970 2002 series NewZealand = rnd series Australia = rnd series Canada = rnd series uk = rnd 'use 1989 as the base year series Can1989 = canada series Aus1989 = australia series NZ1988 = newzealand(-1) series nz1996 = newzealand(+7) series uk1980 = uk(-9) group g can1989 aus1989 nz1988 nz1996 uk1980 smpl 1983 1995 freeze(gr) g.line alpha obslab = @str(@year-1989) gr.setobslabel(series) obslab show gr

javiersan
Posts: 184
Joined: Mon Jan 19, 2009 8:18 am

Re: Chart with date axis from [t-x to t+x]

Postby javiersan » Thu Jan 27, 2011 11:13 am

Interesting way of doing it. Thanks.

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

Re: Chart with date axis from [t-x to t+x]

Postby startz » Thu Jan 27, 2011 11:26 am

But there should be a way to do this. Wanting to show before vs after "event" data is pretty common.

javiersan
Posts: 184
Joined: Mon Jan 19, 2009 8:18 am

Re: Chart with date axis from [t-x to t+x]

Postby javiersan » Fri Jan 28, 2011 8:19 am

I am almost sure that the following chart is not possible to do without manual fiddling of the date axis with addtext(s) (as I was doing with the chart types above before Gareth's stunned me with his super simple solution). It could be great if these types of double date axis charts were built into future Eviews versions.
double_scale.JPG
double_scale.JPG (25.64 KiB) Viewed 6704 times

Cheers,

Javier

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

Re: Chart with date axis from [t-x to t+x]

Postby EViews Gareth » Fri Jan 28, 2011 9:02 am

Yeah, I can't think of another way to get that double scale. If we allowed carriage returns in obs labeling, it would be easy, but we don't :(


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests