Page 1 of 1
pagecontract
Posted: Sun Mar 13, 2011 4:33 pm
by javiersan
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
Re: pagecontract
Posted: Sun Mar 13, 2011 5:49 pm
by startz
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.)
Re: pagecontract
Posted: Mon Mar 14, 2011 8:07 am
by EViews Gareth
Dick is correct.
A quick workaround would be something like:
Code: Select all
series i = x = x(-1)
pagecontract if i=0
Re: pagecontract
Posted: Mon Mar 14, 2011 8:23 am
by javiersan
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