Graphing aggregate data from all cross-sections

For questions regarding programming in the EViews programming language.

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

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Graphing aggregate data from all cross-sections

Postby tchaithonov » Tue May 11, 2010 7:22 am

Hi Guys,

I have created some time series graphs out of a panel data (same variable, using "graph {%graph_name}.line(panel=i) ..."), and I am trying to make an aggregate line graph out of it. I need to add up, week-by-week, the values of the variable, and chart them. I could think of a matrix solution (so that I don't need to maintain the panel structure), but it wouldn't have the time series associating to the data points, but I can't find the graph console function from the manual. Another way is to create a new ts page and copy the data over there, matching only the @dateid and sum it up, but it would be a bit cumbersome if I have to run the program several times with a new page created each time it is run. So, is there any other way I should try? Please let me know. Thanks.

Tchaithonov

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

Re: Graphing aggregate data from all cross-sections

Postby EViews Gareth » Tue May 11, 2010 7:59 am

Aren't you just saying you want to stack (panel=stack) the cross-sections?

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Re: Graphing aggregate data from all cross-sections

Postby tchaithonov » Tue May 11, 2010 8:13 am

Hey Gareth, I think it should be similar to mean plus sd bounds but instead of mean, I want sum. Does that make sense to you?

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

Re: Graphing aggregate data from all cross-sections

Postby EViews Gareth » Tue May 11, 2010 8:23 am

Sorry, yeah, I wasn't thinking properly when I read your original post. I don't think there is a way to get the sum like that automatically in a graph. As you said, you could copy the series into a new page, or you could create a new series in your current page that is equal to the sums, then graph that:

Code: Select all

series ysum = @sumsby(y,@cellid)
where Y is the series you're interested in graphing.

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Re: Graphing aggregate data from all cross-sections

Postby tchaithonov » Tue May 11, 2010 8:50 am

Okay cool. I think that works. I did the calculation, use combined, and then remove the legend. Good enough for now. Thanks Gareth.

Gimel
Posts: 4
Joined: Sun Feb 02, 2014 6:41 am

Re: Graphing aggregate data from all cross-sections

Postby Gimel » Sun Feb 23, 2014 5:47 pm

I am still a novice and trying to do what Eviews did in interactive mode for graphs but I can't.

I read the example in Eviews 7 about classifying population according through year:
In eviews example (gulfcoast.wf1) we have to click population then view/graph change under general to "categorical graph" and change graph data to "sums" and write within graph "year" then click ok.

I am trying to mimic that using command in programming but failed. I did something like:

graph pops.bar pop within(year)

but it didn't work.

Could somebody help me with the command please?

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

Re: Graphing aggregate data from all cross-sections

Postby EViews Gareth » Sun Feb 23, 2014 9:42 pm

Probably need the (contract=sum) option on the bar.

Gimel
Posts: 4
Joined: Sun Feb 02, 2014 6:41 am

Re: Graphing aggregate data from all cross-sections

Postby Gimel » Thu Feb 27, 2014 6:22 am

Thanks a lot it works well now !!!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests