Is there a built in way to convert cards to regression lists

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.
macro
Posts: 70
Joined: Thu Jul 16, 2015 3:01 pm

Is there a built in way to convert cards to regression lists

Unread post by macro »

I wrote a simple procedure that takes a supplementary card and converts it to a regression list

Code: Select all

procedure rlfromcards
    local equation regs
    equation regs *
    compute %rl = %rlfromeqn(regs)
end
so I can write code like this

Code: Select all

@rlfromcards
# gdp{1 to 4} ffed{1 to 2} pce{1 to 4}
and convert it to a regression list that I can pass into other procedures that take a regression list. This seems like something that would be built into RATS. ENTER is certainly related to this, but it didn't seem like the way forward.

I use -rlfromcards- because I have several custom procedures that take regression lists as input, and it's helpful to build the regression list once, using the -cards- format, and then reuse it throughout the program, instead of manually specifying the -cards- format every time.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Is there a built in way to convert cards to regression l

Unread post by TomDoan »

You can use a combination of the %table... and %rl... functions for that. For instance:

Code: Select all

equation yeqn *
# y u ddp
*
* Co-states from measurement equation(s)
*
equation zeqn *
# ddp{1 to nlags} ddm{0 to nlags} constant
*
* Figure out the observable range
*
inquire(reglist) start end
# %rlfromtable(%eqntable(zeqn)) %rlfromtable(%eqntable(yeqn))
macro
Posts: 70
Joined: Thu Jul 16, 2015 3:01 pm

Re: Is there a built in way to convert cards to regression l

Unread post by macro »

Perfect, thanks for the quick response. I always prefer a built-in way than using some home-cooked procedure. For my purposes, this

Code: Select all

equation eq *
# gdp{1 to 4} ffed{1 to 2} pce{1 to 4} constant
compute %rl = %rlfromeqn(eq)
seems to work, since my custom procedures handle the ranges on their own.
Post Reply