BookmarkSubscribeRSS Feed
tmtemples
Fluorite | Level 6

I was asked to add the rsquared and p-values to a graph that I made using proc sgplot.  I found an example that saves the rsquared from proc reg into a macro variable and then prints it in a footnote, but I am not sure that proc reg and the regression in proc sgplot are using the same methods and have the same output. 

 

Can someone confirm whether they are?  If not, is there a way to print those values within proc sgplot?

 

Here's the code I'm currently using:

 

PROC REG DATA = CAUTI_QTR_SIR OUTEST = REG_OUT ;
   MODEL SIR = QUARTER / SELECTION = RSQUARE  ;
RUN ;

DATA _NULL_ ;
   SET REG_OUT ;
   CALL SYMPUT ('RSQ', _RSQ_ ) ;
RUN ;

FOOTNOTE1 ' ' ;
FOOTNOTE2 J=L "R-squared = &RSQ" ;
FOOTNOTE3 ' ' ;


PROC SGPLOT DATA = CAUTI_QTR_SIR ;
   SERIES X = QUARTER Y = SIR / MARKERS ;
   REG X = QUARTER Y = SIR / LINEATTRS = (COLOR = BLACK) ;
   YAXIS LABEL = 'SIR';
   TITLE 'CMC CAUTI SIR 2013 - 2016' ;
RUN;

 

Thank you,

Tina Temples

2 REPLIES 2
Jagadishkatam
Amethyst | Level 16

The regression from proc reg and proc sgplot are same.

 

Please refer to teh link which confirms the same.

 

http://support.sas.com/kb/40/504.html

 

Thanks,
Jag
tmtemples
Fluorite | Level 6

Great!  Thank you for the quick response!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 2 replies
  • 1865 views
  • 0 likes
  • 2 in conversation