** Next:** The DOW loop
** Up:** Writing frequently-used code as
** Previous:** Sundry macros

###

Regressions

Often, in preliminary analysis, I want to run simple regressions and have printed output that isn't the reams and reams of inessential statistics that SAS produces when I run proc reg. To do this, I use the following macro:

%macro regme(inds, depvar, indvars, subt);
proc reg data=&inds;
model &depvar = &indvars;
ods select ParameterEstimates;
title ``&subt'';
run;
%mend;

And now I can write, for instance,

%regme(crsp.msf, ret, retx, Regression of return on return without dividends);

which produces the beautifully simple output

Regression of return on return without dividends
Obs Variable Estimate tValue Probt
1 Intercept 0.00192 467.15 <.0001
2 RETX 0.99877 41951.9 <.0001

which is all I am really interested in anyway.
%regmewhite

Andre de Souza
2012-11-19