Page 1 of 1

frequency convert 2month

Posted: Wed Feb 24, 2010 6:01 am
by Katjes
Hi all,
I'm trying to convert monthly to quarterly frequency, but not to take the simply average, ... this is to easy ;o)
copy(c=na,smpl="1991 2011") MData\* QData\*

My current problem is construct the quarterly value by
1) the 2nd month of a quarter only (Is there a command similar to c=second?)
or
2) the average of the 1st and 2nd month( c=average(1+2)?)

I thougt about an "ifsample" condition, but didn't find an answer so far?
Anybody have already solved this problem?
Thanks in advance, Katjes

Re: frequency convert 2month

Posted: Mon Mar 01, 2010 3:35 pm
by EViews Chris
There's a few ways to do this. Here's one:

Code: Select all

copy(smpl="if @mod(@month-1,3)=1") MData\* QData\*
where the expression involving @mod is just a shorter way of writing: month=2 or month=5 or month=8 or month=11.

Re: frequency convert 2month

Posted: Mon Mar 01, 2010 3:40 pm
by EViews Chris
And note that that one way of writing a sample for the first two months of the quarter is:

Code: Select all

if @mod(@month-1,3)<=1
where the equality has been replaced by an inequality