I am currently writing an sgplot code for forest plot (SAS University edition). I have managed to get the correct graph as I want, however I can not change the color of a specific observation. This is my code
data my_data;
input study $ year rr lcl ucl;
datalines;
mickey 2015 1.5 0.7 2.3
minny 2010 1.2 1.0 1.4
donald 2013 0.8 0.2 1.4
daisy 2014 1.3 1.0 1.6
goofy 2017 1.9 0.9 2.9
pluto 2010 1.4 0.7 2.1
;
run;
proc sgplot data=my_data
noautolegend nocycleattrs;
scatter y=study x=rr/ markerattrs=(symbol=squarefilled size=12 color=black);
highlow high=ucl low=lcl y=study / type=line lineattrs=(color=black);
yaxistable study year / labelattrs=(family=arial size=12pt weight=bold) position=left location=inside valueattrs=(family=arial size=10pt);
yaxistable rr lcl ucl / labelattrs=(family=arial size=12pt weight=bold) position=right location=inside valueattrs=(family=arial size=10pt);
xaxis offsetmin=0.1 offsetmax=1 min=0.5 max=3.0 display=(nolabel);
yaxis offsetmin=0.1 offsetmax=0.1 display=none reverse;
refline 1 / axis=x;
styleattrs axisextent=data;
run;
What I am trying to achieve is changing observation number 3 (donald, 2013, 0.8 0.2 1.4) into a red color (the text when plotting, not only the marker attributes).
I have tried to check for different sgplot attributes, but I am not able to change this specific color of observation number 3 (as red, and other observations remain black) when plotting. I have also looked at template, but this does not help. How can I achieve this?