12-29-2016 10:32 AM
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 ;
DATA _NULL_ ;
SET REG_OUT ;
CALL SYMPUT ('RSQ', _RSQ_ ) ;
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' ;
12-29-2016 11:05 AM
The regression from proc reg and proc sgplot are same.
Please refer to teh link which confirms the same.