[Gretl-users] passing a series name to a function

Ignacio Diaz-Emparanza ignacio.diaz-emparanza at ehu.es
Thu Jun 14 11:00:36 EDT 2007


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?




-- 
Ignacio Diaz-Emparanza  
DEPARTAMENTO DE ECONOMÍA APLICADA III (ECONOMETRÍA Y ESTADÍSTICA)                                        
UPV/EHU
Avda. Lehendakari Aguirre, 83 | 48015 BILBAO
T.: +34 946013732 | F.: +34 946013754
www.et.bs.ehu.es 



More information about the Gretl-users mailing list