Page 1 of 1

shaded area doesn't appear in the graph

Posted: Tue May 10, 2016 7:02 am
by melamel
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.

Re: shaded area doesn't appear in the graph

Posted: Tue May 10, 2016 7:06 am
by melamel
:oops: I forgot to attach the screenshots

Re: shaded area doesn't appear in the graph

Posted: Tue May 10, 2016 8:59 am
by EViews Gareth
.draw doesn't support arithmetic in the sample expression.

Re: shaded area doesn't appear in the graph

Posted: Wed May 11, 2016 1:06 am
by melamel
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 :?:

Re: shaded area doesn't appear in the graph

Posted: Wed May 11, 2016 4:37 am
by EViews Gareth
EViews interprets different illegal code differently.

Re: shaded area doesn't appear in the graph

Posted: Thu May 12, 2016 1:01 am
by melamel
Ok! Thank you !