Page 1 of 1

Using functions on groups

Posted: Sat Feb 06, 2016 3:27 pm
by pdwhoward
I have a group and I would like to calculate statistics for the series in the group. So for example

Code: Select all

group group_return rm
defines the group group_return and contains the series rm. In Eveiws, I can execute

Code: Select all

@mean(rm)
but I cannot execute

Code: Select all

@mean(group_return(1))
Although, I can do

Code: Select all

ls group_return(1) c
in place of

Code: Select all

ls rm c
So I would like to know why I cannot use / how do I use function commands like @mean() on series in a group. I.e. I would like to use commands like

Code: Select all

@mean(group_return(1))
Thanks for the help.

Re: Using functions on groups

Posted: Sat Feb 06, 2016 4:11 pm
by EViews Gareth

Code: Select all

show @mean(group_return(1))

Re: Using functions on groups

Posted: Sun Feb 07, 2016 10:45 am
by pdwhoward
That's great, thank you. How would I store the value. For example, I can issue the command

Code: Select all

scalar t = @mean(rm)
but the following command does not

Code: Select all

scalar t = @mean(group_return(1))

Re: Using functions on groups

Posted: Tue Sep 20, 2016 1:07 am
by dagfinnrime
Hi,

I too would like to use functions on groups. (User request!!!).

The way I fix it now is the following:

Code: Select all

for !i = 1 to gr_data.@count %varname = gr_data.@seriesname(!i) tab_descstats(1,!c) = %varname !mret = (1+@mean({%varname}))^12-1 !sdret = @stdev({%varname}) tab_descstats(2,!c) = !mret ' Return tab_descstats(3,!c) = !sdret ' Std.Dev tab_descstats(4,!c) = !mret/!sdret ' SR !c = !c+1 next