Computing a Series's Mean

For questions regarding programming in the EViews programming language.

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

john_edmonds
Posts: 1
Joined: Mon Jun 07, 2010 8:52 am

Computing a Series's Mean

Postby john_edmonds » Mon Jun 07, 2010 9:06 am

I have been trying to compute the mean of a series.

Since I have to do this for every series in a database, I first group them together:

Code: Select all

group all *
Then I create a table in which to store the output:

Code: Select all

table output
Then I attempt to compute the mean of each series and store that in the table:

Code: Select all

for !i=1 to all.@count output(!i,1)=@mean(all(!i)) 'Eviews flags this as an error next
But I get an error on the indicated line saying something to the effect of @mean has been given a bad argument. For something as simple as computing the mean of a series, I would expect this to be a bit easier, yet I cannot figure out what is causing Eviews to flag this as an error.

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

Re: Computing a Series's Mean

Postby EViews Gareth » Mon Jun 07, 2010 9:13 am

Change it to this:

Code: Select all

for !i=1 to all.@count %sn = all.@seriesname(!i) output(!i,1)=@mean({%sn}) next


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest