rename series in the group, or rename variables in eq object

For questions regarding programming in the EViews programming language.

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

ecofin
Posts: 182
Joined: Fri May 10, 2013 11:24 am

rename series in the group, or rename variables in eq object

Postby ecofin » Thu Mar 09, 2017 8:48 am

Hi everybody,
i have two question:
1/ i have group named g1 with 14 series, (GDP, INF, @month=1, @month=2,....,@month=12) with my equation estmation ls stock c GDP INF @expand(@month), i want to rename the 12 last series (@month=1 will be dum1 and @month=2 will be dum2.....etc ) by this code i get error message "DUM is not defined in "GROUP G DUM" i know that my code is incomplete.

Code: Select all

group g dum
for !i=1 to 12
%oldname = g.@seriesname(!i)
%newname = dum!i
rename {%oldname} {%newname}
next

2/ suppose i estimate this model: ls stock c GDP INF @expand(@month), is there an other way to rename the 12 varaibles (@month=1,... @month=12) in equation object by (dum1,..... dum12).

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

Re: rename series in the group, or rename variables in eq object

Postby EViews Gareth » Thu Mar 09, 2017 8:51 am

You can only rename objects that exist inside your workfile. @expand doesn't create series objects, it is just a function that you can use inline.

To actually create dummy variables for the months that exist in your workfile, you'd have to do something like:

Code: Select all

group g
for !i=1 to 12
series dum{!i} = @month=!i
g.add dum{!i}
Follow us on Twitter @IHSEViews

ecofin
Posts: 182
Joined: Fri May 10, 2013 11:24 am

Re: rename series in the group, or rename variables in eq object

Postby ecofin » Fri Mar 10, 2017 8:12 am

thanks a lot. :D


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 22 guests