Page 1 of 1

distinguish odd /even numbers

Posted: Mon Nov 22, 2010 10:17 am
by Katjes
Using EViews 7, I would like to use different commands according to whether the sample size is odd or even;
is there a specific command that looks to this issue or you have already a nice solution ;o)

sample 2000q1 2010q1+!step
!length=@obssmpl
if !length=EVEN then ...
else (if ODD) ..
endif

Re: distinguish odd /even numbers

Posted: Mon Nov 22, 2010 10:30 am
by EViews Gareth

Code: Select all

if @mod(!length,2) = 0 then
will test for EVEN. Set it equal to 1 for ODD.