Page 1 of 1

Computing a Series's Mean

Posted: Mon Jun 07, 2010 9:06 am
by john_edmonds
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.

Re: Computing a Series's Mean

Posted: Mon Jun 07, 2010 9:13 am
by EViews Gareth
Change it to this:

Code: Select all

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