DATA Step, Macro, Functions and more

Noprint in Proc Model

Occasional Contributor
Posts: 8

Noprint in Proc Model

Hello and good day. 

I'm running the code below for my project but it takes very long time, so I wondered if it was a way ... so that it did not print? Smiley Happy  

"Running a Fama-Macbeth regression in SAS is quite easy, and doesn't require any special macros. The following code will run cross-sectional regressions by year for all firms and report the means.


ods listing close;
ods output parameterestimates=pe;
proc reg data=dset;
 by year;
 model depvar = indvars; run;
ods listing;

proc means data=pe mean std t probt;
 var estimate; class variable;

Since the results from this approach give a time-series, it is common practice to use the Newey-West adjustment for standard errors. Unlike Stata, this is somewhat complicated in SAS, but can be done as follows:


proc sort data=pe; by variable; run;

%let lags=3;
ods output parameterestimates=nw;
ods listing close;
proc model data=pe;
 by variable;
 instruments / intonly;
 fit estimate / gmm kernel=(bart,%eval(&lags+1),0) vardef=n; run;
ods listing;

proc print data=nw; id variable;
 var estimate--df; format estimate stderr 7.4;


Super User
Posts: 24,026

Re: Noprint in Proc Model

Posted in reply to TorTheHammer

Look at ODS SELECT and ODS EXCLUDE. It allows you to control the output and suppressing the output can speed up your processes.

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation