retaining series name in reglist

Use this forum to post questions about syntax problems or general programming issues. Questions on implementing a particular aspect of econometrics should go in "Econometrics Issues" below.
Gilbril
Posts: 78
Joined: Thu Aug 19, 2010 2:00 pm

retaining series name in reglist

Unread post 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!
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: retaining series name in reglist

Unread post 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.
Post Reply