Page 1 of 1

sum up series in panel data set

Posted: Tue Nov 06, 2018 3:53 am
by stefanp
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?

Re: sum up series in panel data set

Posted: Tue Nov 06, 2018 8:01 am
by EViews Gareth
Use @sumsby(series_a, @crossid) (or replace @crossid with the name of your cross-section identifier series).