Data visualization with SAS programming

How to change legend values in PROC SGPLOT

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 19
Accepted Solution

How to change legend values in PROC SGPLOT

Hi, All:

 

I want to make a figure, which expresses linear regression analysis.

By submitting the following code, we can see one legend in the output, which includes "regression" & "95% confidence interval".

data test;
    input x y @@;
    datalines;
    10 10 4 5 2 5 2 4 8 4 9 6 7 6 5 2
    1 1 3 2 4 7 6 7 8 9 11 8 6 4
    ;
run;
proc sgplot data=test;
    reg x=x y=y / clm;
    keylegend / noborder location=outside position=top;
run;

By using LEGENDLABEL= option, I succeeded to change one value "regression" to "Mean predicted".

But I want to change both legend values ("regression" & "95% confidence interval").

Please give me some advice.

 

Thank you for your kind cooperation.


Accepted Solutions
Solution
a month ago
SAS Super FREQ
Posts: 806

Re: How to change legend values in PROC SGPLOT

Posted in reply to KentaMURANAKA

How about

 

proc sgplot data=test;
reg x=x y=y / clm="clm" legendlabel="legendlabel" ;
/* keylegend / noborder location=outside position=top;*/
run;

View solution in original post


All Replies
Solution
a month ago
SAS Super FREQ
Posts: 806

Re: How to change legend values in PROC SGPLOT

Posted in reply to KentaMURANAKA

How about

 

proc sgplot data=test;
reg x=x y=y / clm="clm" legendlabel="legendlabel" ;
/* keylegend / noborder location=outside position=top;*/
run;
Occasional Contributor
Posts: 19

Re: How to change legend values in PROC SGPLOT

Posted in reply to Bruno_SAS

Dear Bruno:

 

Thank you so much.

I accomplished it!

☑ This topic is solved.

Need further help from the community? Please ask a new question.

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