Ignacio Diaz-Emparanza schrieb: > > The question is: > Is there a way to pass the name of the variable to the function, so that the > function can generate new series which change the names depending on what > series are applied to? > > 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 -sven