
'estimate 4 models of the page 1
equation eq01.ls gdp oil gas usd euro @expand(@datepart(@date,"ww"))
equation eq02.ls gdp usd euro @expand(@quarter)
equation eq03.ls gdp usd @expand(@quarter)
equation eq04.ls gdp oil gas usd @expand(@month)

'use @wlookup function to rename coefs dummy
%eqlist = @wlookup("*","equation")
!n = @wcount(%eqlist)
for !j=1 to !n
%eq = @word(%eqlist, !j)
next

'use @pagelist to obtain a list of all the pages and  rename the part of coefs dummy for all pages: i.g. d_eq01_page1,...

'use @pageselect to switch betwwen page to estimate models of page 2 and 3


'################# PAGE 1 ####################
'extract dummy weekly  coefs page 1 model 1
for !i=1 to 53
smpl if @datepart(@date,"ww")=!i
series d_{%eq} =  {%eq}.@coef(4+!i)
next
smpl @all

'extract dummy quarterly coefs page 1 model 2 
for !i=1 to 4
smpl if @quarter=!i
series d_{%eq}=  {%eq}.@coef(2+!i)
next
smpl @all

'extract dummy quarterly coefs page 1 model 3
for !i=1 to 4
smpl if @quarter=!i
series d_{%eq} = {%eq}.@coef(1+!i)
next
smpl @all

'extract dummy monthly coefs page 1 model 4
for !i=1 to 12
smpl if @month=!i
series d_{%eq} =  {%eq}.@coef(3+!i) 
next
smpl @all

'################# PAGE 2 ####################

'estimate 3 models of the page 2
equation eq01.ls rgdp oil gas usd euro @expand(@datepart(@date,"ww")) 
equation eq02.ls rgdp oil gas usd euro @expand(@month) 
equation eq03.ls rgdp oil gas usd euro @expand(@quarter)


'extract dummy weekly  coefs page 2 model 1
for !i=1 to 53
smpl if @datepart(@date,"ww")=!i
series d_{%eq} =  {%eq}.@coef(4+!i)
next
smpl @all

'extract dummy quarterly coefs page 2 model 2
for !i=1 to 4
smpl if @quarter=!i
series d_{%eq} =  {%eq}.@coef(4+!i)
next
smpl @all

'extract dummy monthly coefs page 2 model 3
for !i=1 to 12
smpl if @month=!i
series d_{%eq}=  {%eq}.@coef(4+!i) 
next
smpl @all

'################# PAGE 3 ####################

'estimate 3 models of the page 3
equation eq01.ls rgdp2 oil gas usd euro @expand(@datepart(@date,"ww")) 
equation eq02.ls rgdp2 oil gas usd euro @expand(@month) 
equation eq03.ls rgdp2 oil gas usd euro @expand(@quarter)

'extract dummy weekly  coefs page 2 model 1
for !i=1 to 53
smpl if @datepart(@date,"ww")=!i
series d_{%eq} =   {%eq}.@coef(4+!i)
next
smpl @all

'extract dummy quarterly coefs page 2 model 2
for !i=1 to 4
smpl if @quarter=!i
series d_{%eq}=   {%eq}.@coef(4+!i)
next
smpl @all

'extract dummy monthly coefs page 2 model 3
for !i=1 to 12
smpl if @month=!i
series d_{%eq} =  {%eq}.@coef(4+!i) 
next
smpl @all








