Hi,
I have a regular procedure that produces time series graphs for the growth rate of a variable gir for a number of countries {%cc}. In some cases there are extreme outliers in the data which cause the y-axis of the grap to blow up too much, so that the smaller "normal" developments" cannot be easily identified anymore.
My idea to solve this issue was to reset the scale after the creation of the graph using graph.axis range() with specified numbers in case the maximum or minimum of the respective time series go beyond certain threshold values.
Now I would like to automate this using scalars for the minimum and maximum values of the y-scale, dependent on the mean and standard deviation of the time series :
graph gir_{%cc}.line @pc({%cc}_gir) @pc(NEW_{%cc}_gir)
genr gir_pc_{%cc} = @pc(NEW_{%cc}_gir)
scalar gir_pc_maxg_{%cc} = @mean(gir_pc_{%cc}) + 3*@stdev(gir_pc_{%cc})
scalar gir_pc_ming_{%cc} = @mean(gir_pc_{%cc}) - 3*@stdev(gir_pc_{%cc})
if @max(gir_pc_{%cc})> gir_pc_maxg_{%cc} or @min(gir_pc_{%cc})< gir_pc_ming_{%cc} then
gir_{%cc}.axis range(gir_pc_ming_{%cc}, gir_pc_maxg_{%cc})
endif
However when running the programme I receive the error message "Illegal scale option". Does graph.axis range() not work with variables or is it maybe an issue of too high decimal precision of gir_pc_maxg_{%cc} or @min(gir_pc_{%cc}?
Many thanks in advance!
Alex
Graph::axis range() using variables
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Graph::axis range() using variables
Use a program, !i, variable rather than a scalar object.
Re: Graph::axis range() using variables
That did the trick! Thanks
Who is online
Users browsing this forum: No registered users and 1 guest
