BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tim_sas_
Obsidian | Level 7

Hello,

 

I have a problem to speed up my regressions in SAS using the macro below.

 

I would like to suppress the regression results in the results window, however, the Noprint function does not work here because it sends no output to ODS.

 

I have tried "ODS select none" as well as "ODS exclude none", but the results window then still appears. I would be very glad if someone could help me out. Any ideas on how to speed up the macro (multiple regressions) below or on how to suppress the output in the results window while still calculating the output tables are highly appreciated.

 

Thank you a lot for any help.

 

Tim

 

*Macro to run several regressions using a loop (based on a startyear);
%Macro Startermacro (window=,dataset_in=);
	%do startyear = 2003 %to %eval(2014 - &window. + 1);

*Run a regression of earnings on lagged variables and save the output statistics;
proc reg data=&dataset_in. ;
	model earn_w = L1_earn_w L1_negE_w L1_NExE_w;
	where &startyear. <= HouFyear <= %eval(&startyear. + &window. - 1);
	ODS OUTPUT parameterestimates = par_est_&startyear.;
run; quit;

*Write the start year in a separate column; 
		data par_est_&startyear.;
			set par_est_&startyear.;
			startyear = %eval(&startyear. + &window. - 1);
		run;

*Combine all outputs to one file;
	data combined_par_est;
		set par_est_:;
	run;
%end;
%mend;

 

1 ACCEPTED SOLUTION
2 REPLIES 2

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 344 views
  • 1 like
  • 2 in conversation