Page 1 of 1

a simple programme

Posted: Fri Mar 10, 2017 8:16 am
by suchen
I have 100 series

y1 y2 y3 .... y100

and i need to produce a new series y = average of (y1 + y2 + y3 +... + y100),

Could you please help write a syntax, many thanks.

Re: a simple programme

Posted: Fri Mar 10, 2017 8:27 am
by EViews Gareth
You'll have to be more specific.

Re: a simple programme

Posted: Fri Mar 10, 2017 8:34 am
by suchen
Thanks for your reply:

I have 100 series y1, y2, y3, y4, ..., y99, y100

and now i need to create a new series y, which is the average of the 100 series,

y = (y1 +y2 +y3+... + y100)/100

i am wondering if there is a simple syntax for this, thanks.

Re: a simple programme

Posted: Fri Mar 10, 2017 8:35 am
by EViews Gareth
Y1 is a single number?

Re: a simple programme

Posted: Fri Mar 10, 2017 8:43 am
by suchen
y1, y2, y3, ... y100, each of them is a series with 50 obs.

i want to get a new series y with 50 obs, each ob. is the average of the (y1, y2, y3, ... y100)

of course we can write y = (y1 +y2 + y3 +... +y100)/100,

but this is too complicated, is there any way like y1:y100 in excel?

hope this is clear, thanks.

Re: a simple programme

Posted: Fri Mar 10, 2017 9:10 am
by EViews Gareth
ok, I think you're saying you want the observation by observation average.

Put the series into a group, then use the @rmean function.

Re: a simple programme

Posted: Fri Mar 10, 2017 9:20 am
by suchen
thanks, group is good

group y y1, y2, y3, ..., y100

i just feel it is too complicated to write from y 1 to y100, is there an easy way to do this? like y1:y100?

Re: a simple programme

Posted: Fri Mar 10, 2017 9:33 am
by EViews Gareth
group y y*

Re: a simple programme

Posted: Fri Mar 10, 2017 9:44 am
by suchen
group y y*

this group y1 to y100,

can i ask another question, if i have y1 to y100 series, but i just want to group y1 to y99, is there any parameter setting?

sorry for the silly question:(

Re: a simple programme

Posted: Fri Mar 10, 2017 9:51 am
by EViews Gareth
Easiest thing is to do:

Code: Select all

group y y* y.drop y100

Re: a simple programme

Posted: Fri Mar 10, 2017 9:58 am
by suchen
group y y*
y.drop y100

many thanks for your patience, this works very well,

but i still want to know if we can make a parameter setting,

for example, i have the y1 to y100 series, but i just wanna group (y1 to y50), what should i do? many thanks.

Re: a simple programme

Posted: Fri Mar 10, 2017 10:08 am
by EViews Gareth

Code: Select all

group y for !i=1 to 50 y.add y{!i} next

Re: a simple programme

Posted: Fri Mar 10, 2017 10:20 am
by suchen
many thanks, it looks fine, i will try.
thanks for your patience. have a good weekend.