[Gretl-users] passing a series name to a function
Sven Schreiber
svetosch at gmx.net
Thu Jun 14 12:15:52 EDT 2007
Ignacio Diaz-Emparanza schrieb:
> On Thursday 14 June 2007 17:37:32 Sven Schreiber wrote:
>>> ...
>>> For example obtaining names "income_trend" ... when applied to "income"
>>> and names "consume_trend"... when applied to consume.
>> See py4gretl_vecdecomp inside the function package with the same name on
>> the package server for an example.
>>
>> An excerpt:
>>
>> loop foreach i endogenous --quiet
>> series $i_SWP = sw[,i]
>> list result = result $i_SWP
>> series $i_GGperma = GGperma[,i]
>> list result = result $i_GGperma
>> series $i_GGtrans = GGtrans[,i]
>> list result = result $i_GGtrans
>> endloop
>>
>
> Ok, but in that example "endogenous" is a list, so this implies that the user
> should define it first:
>
> list endogenous = income
> list components = decomp(endogenous)
>
> and I think that, given that my function does not need more than one input
> variable, gretl should have a way to obtain the same effect with only one
> line:
>
> list components = decomp(income)
>
> May be the function "varname()" of the "sprintf" command can help in doing
> something like that?
>
>
Sorry, I told you everything I know -- I assume you have tried the
$-trick with a single variable already?
-sven
More information about the Gretl-users
mailing list