Page 1 of 1

Replicate value of odds observations

Posted: Wed Mar 02, 2016 2:38 pm
by lilian.ferro
Hello,

I have a workfile where my id is a number (not a date).
I would like to replicate the value of the odds observations on the evens observations.
Can you help me?

Thanks,

Lilian

Re: Replicate value of odds observations

Posted: Wed Mar 02, 2016 2:46 pm
by EViews Gareth

Code: Select all

smpl if @mod(@trend,2)=0 x=x(-1) smpl @all

Re: Replicate value of odds observations

Posted: Thu Mar 03, 2016 2:26 pm
by lilian.ferro
Thank you, but the code works only with observations before the 97th obs.
Here's my code. Hope you can help me.

Code: Select all

for !i = 1 to 135 series fx_!i=(x_!i(-24)+x_!i(-48)+x_!i(-72)+x_!i(-96))/4 smpl 97 @last equation eq.ls x_!i xm_!i eq.fit fx_!i 'equation eq.ls x_!i xf_!i 'eq.fit fx_!i 'equation eq.ls x_!i xm_!i xf_!i 'eq.fit fx_!i smpl @all next smpl if @mod(@trend,2)=0 series fx_1=x_1(-1) series fx_2=x_2(-1) series fx_50=x_50(-1) series fx_53=x_53(-1) series fx_55=x_55(-1) series fx_56=x_56(-1) series fx_77=x_77(-1) series fx_94=x_94(-1) series fx_98=x_98(-1) series fx_103=x_103(-1) series fx_114=x_114(-1) series fx_117=x_117(-1) series fx_127=x_127(-1) series fx_134=x_134(-1) series fx_135=x_135(-1) smpl @all

Re: Replicate value of odds observations

Posted: Thu Mar 03, 2016 2:29 pm
by EViews Gareth
There is nothing in my code to prevent it from working on observations past the 97th.

Re: Replicate value of odds observations

Posted: Thu Mar 03, 2016 2:55 pm
by lilian.ferro
I know, but as my variable is the result of a forecast from a equation that begins in the 97th obs, your code is only working for observations before the 97th.
Can you help me with that?

Re: Replicate value of odds observations

Posted: Thu Mar 03, 2016 3:07 pm
by startz

Code: Select all

series fx_1=x_1(-1)
Do you intend to have fx on one side of the equation and x on the other?

Re: Replicate value of odds observations

Posted: Thu Mar 03, 2016 3:08 pm
by EViews Gareth
You appear to have changed my code to include an F.