loop with dates / panel

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

fi99ggb
Posts: 26
Joined: Tue Jul 02, 2019 4:05 am

loop with dates / panel

Postby fi99ggb » Thu Sep 03, 2020 11:48 am

Hello

I have a panel dataset and I want to run a loop to sequentially increase the time dimension of the sample like:

for !i = 1 to 12
smpl @first 2012M12+!i
...estimate equation
next

I am bit confused but it looks like this does not increase the time dimension of the sample. Is that right? And is there an efficient way to address this?

Thanks
George

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13319
Joined: Tue Sep 16, 2008 5:38 pm

Re: loop with dates / panel

Postby EViews Gareth » Thu Sep 03, 2020 1:54 pm

That's exactly what it does.

Code: Select all

wfcreate m 2010 2015 10
series y=nrnd
series x=nrnd


table samples
for !i = 1 to 12
   smpl @first 2012M12+!i
   equation eq!i.ls y c x
   samples(!i,2) = eq!i.@smpl
   samples(!i,1) = !i
next

show samples
Follow us on Twitter @IHSEViews


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 43 guests