You may have to provide actual data to diagnose this. What does your LOG show when you run this code? Copy the text from the log window of the code and all the notes or other messages and paste the result into a text box opened on the forum with the </> icon that appears above the message window. The text box preserves diagnostic messages better than the main message window which will reformat pasted text and remove spaces and possibly replace characters.
Question: What is the value(s) for the variable LLOQN and the maximum and minimum of the variable Result?
I ran this similar code:
proc sgplot data=sashelp.class;
series x=height y=weight;
refline 0 / axis=y lineattrs=(thickness=3 pattern=dash) label=("Upper Level of Healthy") noclip;
refline age / axis=y lineattrs=(thickness=3 pattern=dash) label=("LLOQ") labelloc=inside noclip;
run;
And there is a NOTE in the log explaining why the label for the second refline statement is not created:
NOTE: CURVELABEL='LLOQ' is invalid. The option value cannot be a string when a column of reference lines is plotted. The label will not be drawn.
When you specify the refline as a variable, it suggests that you want to create mutiple reference lines, one for each value in the variable. It wouldn't make sense to apply one label, "LLOQ" to multiple reference lines. When you use refline variable, SGPLOT expects you to use label=variable, not label="text string".
So this code "works":
proc sgplot data=sashelp.class;
series x=height y=weight;
refline 0 / axis=y lineattrs=(thickness=3 pattern=dash) label=("Upper Level of Healthy") noclip;
refline age / axis=y lineattrs=(thickness=3 pattern=dash) label=name labelloc=inside noclip;
run;
(The plot is nonsensical and the labels collide, but they are printed.)
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.