standard deviation and average
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
-
- Posts: 199
- Joined: Sun Mar 01, 2015 5:01 pm
standard deviation and average
I'd like to create charts of my variables that include the average and the standard deviation of each series. SO the first variable x1 would be plotted against the average of x1 and the average of x1 plus and minus the standard deviation. Now in order to do this I believe I have to create a scalar for each and then generate a new series of that one variable repeated. I have many variables with different naming conventions. My question, is there a simple way to program the creation of these scalars and series? Thanks!
-
- EViews Developer
- Posts: 563
- Joined: Thu Apr 25, 2013 7:48 pm
Re: standard deviation and average
Hello,
My quick-and-dirty way to create such graphs is via a group, e.g.,
The graph can be frozen and it's line styles, legend, etc., modified to create the look you want.
My quick-and-dirty way to create such graphs is via a group, e.g.,
Code: Select all
group g x1 @mean(x1) @mean(x1)+@stdev(x1) @mean(x1)-@stdev(x1)
g.line
The graph can be frozen and it's line styles, legend, etc., modified to create the look you want.
-
- Posts: 199
- Joined: Sun Mar 01, 2015 5:01 pm
Re: standard deviation and average
Thats so much better than what i was going for. Thanks!
And can I program this for all variables in one shot somehow?
And can I program this for all variables in one shot somehow?
-
- EViews Developer
- Posts: 563
- Joined: Thu Apr 25, 2013 7:48 pm
Re: standard deviation and average
Sure, you can always introduce a loop that will iterate through your series. For example,
Code: Select all
%series = @wlookup("*", "series")
for %s {%series}
group g {%s} @mean({%s}) @mean({%s})+@stdev({%s}) @mean({%s})-@stdev({%s})
%graph_name = %s + "_graph"
freeze({%graph_name}) g.line
next
delete g
-
- Posts: 199
- Joined: Sun Mar 01, 2015 5:01 pm
Re: standard deviation and average
Fantastic, thanks!
Who is online
Users browsing this forum: No registered users and 24 guests