Horizontal vs Vertical sum?

For questions regarding programming in the EViews programming language.

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

Rosa.hh
Posts: 22
Joined: Tue Dec 14, 2010 8:07 am

Horizontal vs Vertical sum?

Postby Rosa.hh » Thu Feb 03, 2011 11:01 am

Hi, I recently started using eviews (v7) and I have a very basic question.

I am using time series and I want to generate the sum of a number of variables. Why do I get different results when using the @sum command (I get the wrong result) than when typing the whole sum equation (e.i: A=b+c+d) when I do manage to get the correct sum.

What I want is to generate a horizontal sum (summing rows). Anyone knows why the @sum command is generating something different than what I want?

These are the two codes I'm using:

series comp_ind= @sum(stand_indep{!j}) .......[this is not generating the correct sum]

series comp_ind2=stand_indep1+stand_indep2+stand_indep3+stand_indep4+stand_indep5+stand_indep6+stand_indep7 ........[does generate the correct sum]

Thanks!

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

Re: Horizontal vs Vertical sum?

Postby EViews Gareth » Thu Feb 03, 2011 11:02 am

Put the variables into a group, then use the @rsum command:

Rosa.hh
Posts: 22
Joined: Tue Dec 14, 2010 8:07 am

Re: Horizontal vs Vertical sum?

Postby Rosa.hh » Thu Feb 03, 2011 11:19 am

Thank you very much Gareth!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests