Page 1 of 1

How to make a regressor list

Posted: Tue Jun 14, 2016 2:21 pm
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.

Re: How to make a regressor list

Posted: Tue Jun 14, 2016 4:03 pm
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.

Re: How to make a regressor list

Posted: Wed Jun 15, 2016 9:15 am
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;

Re: How to make a regressor list

Posted: Wed Jun 15, 2016 11:23 am
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

Re: How to make a regressor list

Posted: Wed Jun 15, 2016 11:45 am
by rsdeacle
That is what I'm looking for. Thanks a lot!