I am using GRETL 1.912 and ran into a problem using strings in a user
defined function
I wanted to create a function that accepts a bundle with a set of
specification terms.
but I understand bundles can not hold lists since the last step in the
code below fails
list xlist= dy(-1) de(-1)
bundle amodel=null
amodel.xlist= xlist
So I thought I could pass a string of variable names through the bundle
since this code works
string xstring= "dy(-1) de(-1)"
list xlist= @xstring
ols dy const xlist
However, I get a error message with a function version
function matrix olslist1(string xstring)
list xlist= @xstring #fails
ols dy const xlist
#ols dy const @xstring #also fails
return $coeff
end function
The message is
list xlist= dy(
The symbol 'dy' is undefined
The problems seems fundamental to strings in a function since
print @xstring
works outside of function but fails inside a function
Or am I using strings and functions incorrectly?