Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple model statements differing number of observations

Status
Not open for further replies.

Crofty50

Technical User
Oct 1, 2007
2
NZ
Hi guys,

I have to run 210 regressions. All with the same independent variable but with different dependent variables. However if I use

proc reg data=chris;
model20: model rpfund20=rpax/clb;
model21: model rpfund21=rpax/clb;
model22: model rpfund22=rpax/clb;
model23: model rpfund23=rpax/clb;
model24: model rpfund24=rpax/clb;
model25: model rpfund25=rpax/clb;
model26: model rpfund26=rpax/clb;
model27: model rpfund27=rpax/clb;
model28: model rpfund28=rpax/clb;
model29: model rpfund29=rpax/clb;
run;
then each model has the same number of observations. Say the variable rpfund27 has 44 observations (which is the smallest amount of any of the independent variables) then all the above regressions are calculated using 44 observations, even if say rpfund21 has 214 observations.

Please help me get around this. And I know I could write proc reg data=chris; for each model statement but then when I use the 'outest' and 'tableout' functions I have to write them to different data files. Ideally I want all the parameter estimates and the r-squares and p-values for each of the regressions in one table seem I'm running 210 regressions in total.

Thanks very much
 
I have not worked with the SAS\STAT package in a long time, but why not run each regression on a model and add the results to another dataset. (you could use PROC APPEND for this)
This way you will have one dataset with the 210 results that you are looking for. If you feel that writing the 210 test is a lot to code why not use a macro to generate the code for you.

If you need examples on how to code the macro let me know.

Klaz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top