Identifying the beginning and ending of series

For questions regarding programming in the EViews programming language.

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

justincn
Posts: 7
Joined: Mon Mar 11, 2024 4:20 pm

Identifying the beginning and ending of series

Postby justincn » Tue Sep 17, 2024 3:18 pm

Hello everyone,

I’m new to EViews programming and I’m struggling to find the answer to this question. We have legacy code where series are hardcoded with dates such as

%end_history = “2024”
%begin_forecast = “2025”
%end_forecast = "2034"

smpl {%begin_forecast } {% end_forecast }
model_mymod.update
model_mymod.solve(s=d)

I come from Stata where you could do something like

. summarize time_var if !missing(my_variable)

local begin_forecast = `r(max)’ + 1
local end_history = `r(max)’
local end_forecast = `r(max)’ + 10


So you can avoid having to hardcode/update the forecast and historical start/end dates.

What would be the analog in this case with Eviews if you had a data set up like this -

FY Some_Series
2021 25
2022 50
2023 75
2024 100
2025
2026
2027

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

Re: Identifying the beginning and ending of series

Postby EViews Gareth » Tue Sep 17, 2024 3:27 pm

Code: Select all

%end_history = some_series.@last smpl {%end_history}+1 {%end_history}+10

justincn
Posts: 7
Joined: Mon Mar 11, 2024 4:20 pm

Re: Identifying the beginning and ending of series

Postby justincn » Tue Sep 17, 2024 4:44 pm

Code: Select all

%end_history = some_series.@last smpl {%end_history}+1 {%end_history}+10
Thank you, Gareth!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests