Page 1 of 1

Adding date to loop

Posted: Wed Jun 08, 2022 6:19 am
by Alfa318
I'm using EViews 11 to run the following simple code for a sample of 173 firms:

Code: Select all

vector(173) myvec for !i=1 to 173 smpl if c_id=!i myvec(!i) = @cor(ret,ret(-1)) next
I have a daily data file, how can I run the above loop for every month separately? I don't know how to introduce date restrictions in the loop. Many thanks.

Re: Adding date to loop

Posted: Wed Jun 08, 2022 7:32 am
by EViews Gareth

Code: Select all

for !i=1 to 12 smpl if @month=!i next

Re: Adding date to loop

Posted: Sat Jun 11, 2022 3:10 am
by Alfa318
Thanks a lot! :mrgreen: