I am trying to inset some text on some graphs produced in PROC SGPLOT. My code produces three different plots, and I want to add the corresponding correlations to each plot. I used the BY statement to get the three different plots, and I used the INSET statement to place the correlations on the plots. However, I don't know how to specify which correlations go to which plot. Currently, all three correlations are being placed on all three plots. Does anyone know how to address this problem?
Here is a snippet of my code:
proc sgplot data=timeondrug;
by drug;
scatter x=priortime y=duration;
reg x=priortime y=duration;
xaxis label="Duration on Prior Study (weeks)";
yaxis label="Duration on Endocyte Study (weeks)";
title 'Endocyte Therapy vs. Prior Therapy';
inset ("EC0225" = "&corr225."
"EC0489" = "&corr489."
"EC145" = "&corr145.") / border title='Correlation';
run;