How to make a regressor list

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.
rsdeacle
Posts: 6
Joined: Mon Jun 28, 2010 3:04 pm

How to make a regressor list

Unread post by rsdeacle »

Hi there,

This is a basic question, I know, and it's addressed in the manuals, I know, so I apologize for asking, but I spent four hours reading the manuals and forums, trying to hack it, but I couldn't get it to work.

I want to represent a list of regressors with a single word. I then want to add and subtract regressors from the list represented by that word. How can I do that? In other words, how can I change this:

Code: Select all

PREGRESS(METHOD = FIXED,SMPL = onecounty) p_roa / ROBUSTERRORS CLUSTER=%INDIV(T)
# p_df11 p_thrift_df11 p_thrift p_lnasset p_sar_lag p_lar_lag p_cilar_lag $
  p_clar_lag p_crelar_lag p_cldlar_lag p_rrelar_lag p_bdr_lag p_ncfr_lag $
  p_ncla_lag p_subchaps p_hhi_cnty p_cnty_unemp p_crisis p_rrelar_lag_crisis
to this?

Code: Select all

PREGRESS(METHOD = FIXED,SMPL = onecounty) p_roa / ROBUSTERRORS CLUSTER=%INDIV(T)
# regressors
And then how do I add and subtract variables from "regressors?"

Thanks.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: How to make a regressor list

Unread post by TomDoan »

It's the %TABLE... functions that permit "editing". (Regressor lists are designed to allow shorthand for lags, which don't really matter in your case, but it means that they can't be altered as easily).

See https://estima.com/forum/viewtopic.php?p=10736#p10736 for an example.
rsdeacle
Posts: 6
Joined: Mon Jun 28, 2010 3:04 pm

Re: How to make a regressor list

Unread post by rsdeacle »

Thanks. I used those commands to make it work.

Is there a way to create a term representing a set of series that can be referenced in a variety of contexts? For example, in SAS you can write

%LET regressors = x1 x2 x3;

And then type "&regressors" whenever you want to estimate a model with x1, x2, and x3, or calculate summary statistics for them, or correlations, etc. Then if you want to add x4 and x5 to the list, you just write

%LET regressors = x1 x2 x3 x4 x5;
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: How to make a regressor list

Unread post by TomDoan »

Assuming you're working with series that don't need lags, you can do something like:
dec vec[int] regressors
compute regressors=||x1,x2,x3||
linreg x5
# constant regressors
linreg x5
# constant regressors x4
compute regressors=||x1,x2,x3,x4,x5||
table / regressors
rsdeacle
Posts: 6
Joined: Mon Jun 28, 2010 3:04 pm

Re: How to make a regressor list

Unread post by rsdeacle »

That is what I'm looking for. Thanks a lot!
Post Reply