Page 1 of 1

How to copy and paste consecutive values into series

Posted: Sat Aug 24, 2013 2:18 am
by neptunhiker
Hi everyone,

I beliebe I am having a syntax problem. I would like to copy a few consecutive values from one series into another. If you look at the code below you will understand what I would like to do. Thanks for your help.

Code: Select all

create d5 2012 2013 series x=@trend series y=rnd ' How to put 5 consecutive values of series x starting at row 106 into series y at row 17? ' For one value it's trivial like: y(17)=x(106) 'Here is my idea that does not work y(17)=x(106:110)

Re: How to copy and paste consecutive values into series

Posted: Sat Aug 24, 2013 7:17 am
by startz

Code: Select all

smpl 106 110 y = x smpl @all
eta: Not quite. See Gareth's version below.

Re: How to copy and paste consecutive values into series

Posted: Sat Aug 24, 2013 10:50 am
by EViews Gareth
Actually, I think something like:

Code: Select all

smpl 17 21 y = x(89)

Re: How to copy and paste consecutive values into series

Posted: Mon Aug 26, 2013 2:35 am
by neptunhiker
Hi Gareth,

That's a nice way to solve it. Thanks.

Re: How to copy and paste consecutive values into series

Posted: Mon Aug 26, 2013 8:27 am
by EViews Glenn
For dated data where you may not know the index of the element of interest, you can do something like

Code: Select all

smpl 2000 2012 y = @sum(x, "1980 1980") smpl @all