I have two proc reg statements below. SAS prints the adjrsq sse and aic information, but can these fit statistics be outputted to another data-set and then printed and sorted according to their values? Also, I do not see the regression coefficients in my printed output when I used these statements. How do you force SAS to show you the regression coefficients?
Can someone help me with the necessary coding?
proc reg data=lime;
model LRE62 = EC SOM Alext ExchAlp CEC pH
/selection=adjrsq sse aic;
proc reg data=lime;
model LRE60 = EC SOM Alext ExchAlp CEC pH
/selection=adjrsq sse aic;
First thing to realize is that Proc Reg will allow multiple Model statements.
Second the OUTEST option creates a data set containing estimates for each model and the fit statistics you have requested. You will want to read the documentation for details of the structure of the data set.
So you could reduce your code to:
proc reg data=lime outest=myestimates; First: model LRE62 = EC SOM Alext ExchAlp CEC pH /selection=adjrsq sse aic; Second: model LRE60 = EC SOM Alext ExchAlp CEC pH /selection=adjrsq sse aic; run; quit;
The text with the : before the Model statement is a Label. The output will have this word to identify which model the output pertains to and in the output data set to indicate which model the parameter and fit statistics are for. Likely I would use the name of the dependent variable if that varies in your models but used something else to show any short word should work.
First thing to realize is that Proc Reg will allow multiple Model statements.
Second the OUTEST option creates a data set containing estimates for each model and the fit statistics you have requested. You will want to read the documentation for details of the structure of the data set.
So you could reduce your code to:
proc reg data=lime outest=myestimates; First: model LRE62 = EC SOM Alext ExchAlp CEC pH /selection=adjrsq sse aic; Second: model LRE60 = EC SOM Alext ExchAlp CEC pH /selection=adjrsq sse aic; run; quit;
The text with the : before the Model statement is a Label. The output will have this word to identify which model the output pertains to and in the output data set to indicate which model the parameter and fit statistics are for. Likely I would use the name of the dependent variable if that varies in your models but used something else to show any short word should work.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.