Inside functions, you need to access list members with the list name
prepended: vars.$i instead of just $i.
hth,
sven
Am 15.12.2011 15:02, schrieb artur tarassow:
Hey gretl-community,
I've got a small problem with a function. Here is a small part of this
function:
---------------------------------------------------------
function void adfgls (int pmx[0::1] "lag order",
scalar crit "Critical value for initial OLS",
list vars "List of variables to test")
genr time
loop foreach i vars
ols $i const time $i(-1 to -pmx) --robust
omit --auto=crit
lis = $xlist
check = inlist(lis, time)
endloop
end function
open pe.gdt
scalar crit = 0.05
scalar px = 8
list X = pe price
adfgls(px, crit, X)
----------------------------------------------------------
I obtain the following error:
adfgls(px, crit, X)
'pe' is not the name of a variable
*** error in function adfgls
> ols $i const time $i(-1 to -pmx) --robust
What is wrong with the function?
Best,
Artur
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users