Page 1 of 1

Generate Dummy variables

Posted: Thu Feb 05, 2015 9:18 am
by SamChampanhet
Hi,
I have a quarterly workfile. I would like to generate a dummy variable for each date of my workfile.
I tried the following code:

for !j=2000 to 2014
for !i=1 to 4
dummy_{!j}Q{!i}=@recode(@date=@dateval("{!j}Q{!i}"),1,0)
next
next

The code does generate the series but they only have NAs.
Any idea?
Thanks a lot in advance for your help!!

Re: Generate Dummy variables

Posted: Thu Feb 05, 2015 9:19 am
by EViews Gareth
You're probably better off just using @expand(@date) where ever you want the dummies.

Re: Generate Dummy variables

Posted: Fri Feb 06, 2015 3:31 am
by SamChampanhet
Thanks!!