OLS Function group

For questions regarding programming in the EViews programming language.

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

LeonardoMC
Posts: 9
Joined: Thu Jun 16, 2022 2:37 pm

OLS Function group

Postby LeonardoMC » Wed Apr 16, 2025 11:12 am

Hi,

I'm trying to use the function DLOG at a group of explanatory variables (xvars) so that I don't need to write all of them one by one. Here what I came up wtih:

%lista = ""
for !i = 1 to xvars.@count
%v = xvars.@seriesname(!i)
%lista = %lista + " dlog(" + %v + ")"
next

equation eq1.ls dlog(pib) c {%lista} @seas(1) @seas(2) @seas(3)

But it's not working. I get the answer "{%LISTA} is not defined".

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

Re: OLS Function group

Postby EViews Gareth » Wed Apr 16, 2025 7:29 pm

Are you doing it in a program?

Works for me:

Code: Select all

wfcreate m 1990 2020 for !i=1 to 5 series x{!i}=@rnorm+20+@trend next group xvars x* series pib = @rnorm %lista = "" for !i = 1 to xvars.@count %v = xvars.@seriesname(!i) %lista = %lista + " dlog(" + %v + ")" next equation eq1.ls dlog(pib) c {%lista} @seas(1) @seas(2) @seas(3)

LeonardoMC
Posts: 9
Joined: Thu Jun 16, 2022 2:37 pm

Re: OLS Function group

Postby LeonardoMC » Thu Apr 17, 2025 7:05 am

Working now.

Thanks a lot!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests