operation series different size

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator

Posts: 8
Joined: Thu Jul 13, 2017 7:42 am

operation series different size

Postby mkwazi » Wed Aug 09, 2017 3:44 am

Hi there, I hope you are keeping well. I am sorry to bother you but really need help with this due to is the last part of my dissertation.

I need to create a new serie "z" which is the difference between "x" and "y" series. However, the series "x" and "y" have different size. "x" from observation 1 to observation 5222, but really it contains values from 1 to 504 (from 505 ahead, NA). On the other hand, "y" has observations from 23 to 5222 (between 1 and 22, NA). So, my problem is that I need to create a serie "z" taking the difference of 504 observations between "x" and "y" but considering that this 504 observation must be the last 504 observations of "y" (from 4719 to 5222=504). So far, I have created "z" with wrong values. I have tried to do the following in order to capture only the relevant observation of the serie "y" but is not working:
smpl 4719 5222
series z=x-y
Please find attached the files. Really I need your support.
all the best
eviews question.wf1
(260.02 KiB) Downloaded 9 times
eviews question.prg
(118 Bytes) Downloaded 9 times

EViews Matt
EViews Developer
Posts: 148
Joined: Thu Apr 25, 2013 7:48 pm

Re: operation series different size

Postby EViews Matt » Wed Aug 09, 2017 9:13 am


It sounds like you can create the series you want via "series z = x(-4718) - y" with no sample applied. This place the non-NA results of the difference at the end of series z (observations 4719 through 5222). If you'd like the results at the beginning of series z, instead use "series z = x - y(4718)".

Return to “Programming”

Who is online

Users browsing this forum: No registered users and 5 guests