sum up series in panel data set

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

Posts: 63
Joined: Wed Sep 30, 2015 12:24 am

sum up series in panel data set

Postby stefanp » Tue Nov 06, 2018 3:53 am

I have a panel data set which contains several series. I need to sum up the values for some cross sections (across identifiers, not time) depending on some specific conditions. I thought of something like this:

Code: Select all

smpl @all if condition_a=1
series test=@sum(series_a)

However, the values of test appear to be summed up across cross sections and over time. Is it necessary to write a loop which repeats the above procedure for each period separately or is there a simple command to do that?

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

Re: sum up series in panel data set

Postby EViews Gareth » Tue Nov 06, 2018 8:01 am

Use @sumsby(series_a, @crossid) (or replace @crossid with the name of your cross-section identifier series).
Follow us on Twitter @IHSEViews

Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 4 guests