BookmarkSubscribeRSS Feed
igsteo
Calcite | Level 5

 

ods output ParameterEstimates = capmparam
	(keep= dsName Variable Estimate);
proc autoreg data=longcapm;
     by dsname;
     model stockreturn = wtindexreturn / dwprob;
     test wtindexreturn = 1;
     output out=capmout p=p r=r ucl=u lcl=l alphacli=.10;
run;

In ods output, i wish to include the 'Total R-Square'. However i am not sure how to specify it in keep=.

 

I would appreciate some assistance on this!

 

1 REPLY 1
maguiremq
SAS Super FREQ

I'm not sure exactly how you want the results. It seems as though you want data sets, so I went ahead and did this. The solution is in the ODS TRACE statement. It prints all the HTML results and their respective names to the log. Then you trace down exactly what you need. Note: I have no experience with the AUTOREG procedure, but I went ahead and created a fake data set.

 

data have;
input value time;
datalines;
1 1
3 2
5 3
7 8
9 7
2 9
;
run;

ods trace on; 				/* Trace the HTML results in the log. */
proc autoreg data = have;
model value = time;
run;
ods trace off;				/* Turning off for good practice.	*/

/* Extract the part of the report you want. I name the output data set here 'want'. I also mimicked your call for the parameter estimates */

ods output parameterestimates = capmparam
		   fitsummary = want (where = (label2 = "Total R-Square")); 
proc autoreg data = have;
model value = time;
run;

/* Just showing the 'want' data set via PROC PRINT */

proc print data = want;
run;
Obs Model Label1 cValue1 nValue1 Label2 cValue2 nValue2 
1 Model1 Durbin-Watson 1.9201 1.920052 Total R-Square 0.2091 0.209074 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 277 views
  • 0 likes
  • 2 in conversation