shaded area doesn't appear in the graph

For questions regarding programming in the EViews programming language.

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

melamel
Posts: 30
Joined: Tue May 10, 2016 3:49 am

shaded area doesn't appear in the graph

Postby melamel » Tue May 10, 2016 7:02 am

Hi everyone,
I am using draw(shade, b) to separate history from forecast in a figure. I am using these piece of commands:

Code: Select all

range 2002m1 2018m12 %fsmpl="@first+!a @last" smpl @all !a=obs(my_variable) delete(noerr) my_graph smpl 2015m04 2018m12 freeze(my_graph) my_variable.line my_graph.draw(shade,b,gray) {%fsmpl} show my_graph
I attached a screenshot of graph I obtained after runing the code below, I named it "shade1"

More suprinsingly, I wanted to know the value of "a" just to be sure that it's computed correcly so I runned this code (which is the same as above except for the first, the third and the fourth line):

Code: Select all

range 2002m1 2018m12 %fsmpl="@first+a @last" smpl @all scalar a a=obs(my_variable) delete(noerr) my_graph smpl 2015m04 2018m12 freeze(my_graph) my_variable.line my_graph.draw(shade,b,gray) {%fsmpl} show my_graph
The hole graph have been shaded this time, while, in my understanding, this code should give us exactly the same result as above since I just declared "a" as a scalar instead of using it as a control variable.
I attached a screenshot of the graph I obtained this time, I named it "shade2"

Thank you in advance for your reponses.

melamel
Posts: 30
Joined: Tue May 10, 2016 3:49 am

Re: shaded area doesn't appear in the graph

Postby melamel » Tue May 10, 2016 7:06 am

:oops: I forgot to attach the screenshots
Attachments
shade2.png
shade2.png (29.11 KiB) Viewed 4265 times
shade1.png
shade1.png (28.21 KiB) Viewed 4265 times

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

Re: shaded area doesn't appear in the graph

Postby EViews Gareth » Tue May 10, 2016 8:59 am

.draw doesn't support arithmetic in the sample expression.

melamel
Posts: 30
Joined: Tue May 10, 2016 3:49 am

Re: shaded area doesn't appear in the graph

Postby melamel » Wed May 11, 2016 1:06 am

Thank you for your response.
And how do you explain the difference in the results of using "a" as a scalar and as a control variable :?:

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

Re: shaded area doesn't appear in the graph

Postby EViews Gareth » Wed May 11, 2016 4:37 am

EViews interprets different illegal code differently.

melamel
Posts: 30
Joined: Tue May 10, 2016 3:49 am

Re: shaded area doesn't appear in the graph

Postby melamel » Thu May 12, 2016 1:01 am

Ok! Thank you !


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests