## Loop Equations Yearly

For questions regarding programming in the EViews programming language.

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

CNR15
Posts: 27
Joined: Thu Sep 16, 2021 7:06 am

### Loop Equations Yearly

Hi - I am looking to loop the below so they are recalculated every year. Any idea a better way than the year by year approach below?

Thanks!

smpl 2022 2022
series cap = (1-d)*cap(-1) + inv(-1)
series y = ia*(cap^alpha)*(lab^(1-alpha))
series inv = r*y

smpl 2023 2023
series cap = (1-d)*cap(-1) + inv(-1)
series y = ia*(cap^alpha)*(lab^(1-alpha))
series inv = r*y

smpl 2024 2024
series cap = (1-d)*cap(-1) + inv(-1)
series y = ia*(cap^alpha)*(lab^(1-alpha))
series inv = r*y

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

### Re: Loop Equations Yearly

The loops don't really make sense. Is there any reason you cannot simply do:

smpl 2022 2024

series cap = (1-d)*cap(-1) + inv(-1)

series y = ia*(cap^alpha)*(lab^(1-alpha))

series inv = r*y