Page 1 of 1

retaining series name in reglist

Posted: Mon Aug 19, 2019 7:55 am
by Gilbril
Dear Tom, i do have two questions I want to label some series with short descriptions.
I want to collect these series later in a separate procedure in a vector of series. When I pass the labeled series via reglist (# series1 series2...) to the procedure , it uses the labels insted of the series names and the vector of series is empty.
How can I fix this?

And the second question is: How can I not only pass series names via reglist to a procedure but also the lags (#series1 series2{1})
Thanks in advance!

Re: retaining series name in reglist

Posted: Mon Aug 19, 2019 11:43 am
by TomDoan
Gilbril wrote:Dear Tom, i do have two questions I want to label some series with short descriptions.
I want to collect these series later in a separate procedure in a vector of series. When I pass the labeled series via reglist (# series1 series2...) to the procedure , it uses the labels insted of the series names and the vector of series is empty.
How can I fix this?

And the second question is: How can I not only pass series names via reglist to a procedure but also the lags (#series1 series2{1})
Thanks in advance!
You want to use the %tablefromrl function to convert the regressor list into a table with series and lags separated. As a simple example

procedure test
local vect[int] rl
enter(varying) rl
compute tt=%tablefromrl(rl)
do j=1,%cols(tt)
disp %l(tt(1,j)) "{" tt(2,j) "}"
end do j
end test
@test
# x1{1 to 3} x2

will display

X1 { 1 }
X1 { 2 }
X1 { 3 }
X2 { 0 }

Depending upon what you are doing, you might find it easier to just put the reglist information directly into an EQUATION in the procedure with

local equation eqn
equation eqn *

then it will pick up the list of variables from outside the procedure.