Changing variable names in several equations

For questions regarding programming in the EViews programming language.

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

EViews Matt
EViews Developer
Posts: 299
Joined: Thu Apr 25, 2013 7:48 pm

Re: Changing variable names in several equations

Postby EViews Matt » Thu Aug 02, 2018 11:30 am

Assuming for the moment that the observation you're dealing with is in program variable !j, you should be able to use something like:

Code: Select all

if @abs(res{%eq}(!j)) > {%eq}.@se then
   %estcmd = {%eq}.@command + "@event(""" + @otod(!j) +""")"

statsforecast
Posts: 26
Joined: Wed Feb 28, 2018 8:02 pm

Re: Changing variable names in several equations

Postby statsforecast » Thu Aug 02, 2018 12:26 pm

Thank you Matt! I imagined that I would have to loop through the observations in each residual series. Any idea of how to do this?

EViews Matt
EViews Developer
Posts: 299
Joined: Thu Apr 25, 2013 7:48 pm

Re: Changing variable names in several equations

Postby EViews Matt » Thu Aug 02, 2018 1:28 pm

The following should go through every observation in the current sample. !j is the workfile observation as previously mentioned.

Code: Select all

for !k = 1 to @obssmpl
   !j = @dtoo(@otods(!k))
   ...
next

statsforecast
Posts: 26
Joined: Wed Feb 28, 2018 8:02 pm

Re: Changing variable names in several equations

Postby statsforecast » Tue Aug 07, 2018 8:48 am

Thank you Matt!

statsforecast
Posts: 26
Joined: Wed Feb 28, 2018 8:02 pm

Re: Changing variable names in several equations

Postby statsforecast » Wed Aug 15, 2018 12:51 pm

I am trying to change the variables names in a group of series when writing to excel. I usually have something like this:

write(e,noid) "filepath" DATE group01

I would like to perform something like @mid(group01.@members, 3,8) to each series name in group01 when outputting to excel. What I am trying to do basically is to fetch the original series names which were numerical (8 digits), and strip them from the alpha characters that Eviews adds to make the series names valid and the character f at the end of the forecast series.

I would appreciate any ideas.

Thank you.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 8 guests