pagecontract

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

javiersan
Posts: 184
Joined: Mon Jan 19, 2009 8:18 am

pagecontract

Postby javiersan » Sun Mar 13, 2011 4:33 pm

Hello,

I have an alpha where the first two observations are the same. If I do pagecontract x<>x(-1) none of the two observations are kept when I think one of them should be.

Is there a way around this?

Thanks,

Javier

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: pagecontract

Postby startz » Sun Mar 13, 2011 5:49 pm

Check the following...
First observation, x<>x(-1) is false because x(-1) is NA
Second observation, x<>x(-1) is false because it's really false.

(But I haven't checked this myself.)

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: pagecontract

Postby EViews Gareth » Mon Mar 14, 2011 8:07 am

Dick is correct.

A quick workaround would be something like:

Code: Select all

series i = x = x(-1) pagecontract if i=0

javiersan
Posts: 184
Joined: Mon Jan 19, 2009 8:18 am

Re: pagecontract

Postby javiersan » Mon Mar 14, 2011 8:23 am

Unfortunately that still doesn't work as the first observation is deleted (i.e. i(1)=na so obs 1 is not kept).

I would have expected that for these comparisons the starting point would be observation 2 and the first comparison would be obs 2 vs. obs 1. The comparison of obs 1 vs obs 0 is an impossibility as obs 0 does not exist and it does not make sense to compare something that exists with something that does not exist.

The solution is this

Code: Select all

series i = x = x(-1) i(1)=0 pagecontract if i=0
but I just wonder whether the way the comparison is performed is not inconsistent.

Regards,

Javier


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest