Page 1 of 1

OLS Function group

Posted: Wed Apr 16, 2025 11:12 am
by LeonardoMC
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".

Re: OLS Function group

Posted: Wed Apr 16, 2025 7:29 pm
by EViews Gareth
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)

Re: OLS Function group

Posted: Thu Apr 17, 2025 7:05 am
by LeonardoMC
Working now.

Thanks a lot!