BookmarkSubscribeRSS Feed
master_jiang
Calcite | Level 5

Does anyone know how to modify width of errorbar in scatterplot with discrete X-axis and use line instead of symbols to display estimate?

The target figure is like

There are three lines while the middle one is the estimate such as 0.8 and the upper line/lower line are value of CI such as 1.0/0.6.
My template code is like this:
proc template;
define statgraph ratio;
begingraph/ subpixel=on designwidth=15.5 in designheight=7.4 in attrpriority=NONE;
layout overlay/
yaxisopts=(type=log label="ratio" logopts=( tickintervalstyle=LOGEXPAND base=10 tickvaluelist=(0.1 1 10) viewmin=0.1 viewmax=10 ) )
xaxisopts=(name="xaxis" type=discrete discreteopts=(tickvaluefitpolicy=split tickvaluesplitchar="+")) ;
scatterplot y=ratio x=groupa/subpixel=off jitter=auto JITTEROPTS=(axis=auto width=0.85)
markerattrs=(color=darkred size=10pt symbol=triangledown)

markercharacterposition=left;
scatterplot y=ratio x=groupb/subpixel=off jitter=auto JITTEROPTS=(axis=auto width=0.85)
markerattrs=(color=blue size=10pt symbol=triangle)
markercharacterposition=left;
scatterplot y=gmr x=groupa/ERRORBARATTRS=(thickness=2 color=black) yerrorupper=upp yerrorlower=low index=index
markerattrs=(color=black size=10 symbol=trianglefilled)
;
referenceline y=0.68 / lineattrs=(pattern=3);
referenceline y=1/lineattrs=(color=black pattern=dot);
/* drawline x1= 1 y1=1 x2=5 y2=1 /drawspace=wallpercent; */
endlayout;
endgraph;
end;
run;


What I got is like


The length of errorbar is shorter and I cannot find a way to draw a line with specified length to replace symbol to display estimate. Does anyone know a solution?

2 REPLIES 2
master_jiang
Calcite | Level 5
I'm unable to upload screenshot....... sorry for that
ballardw
Super User

With a scatter plot you cannot "replace" markers. Something will be there and I am not sure what you intend to replace it with. If your concern is the marker is big enough that it is obscuring the errorbar line then make the markers transparent(MARKERFILLATTRS=) and possibly the marker size smaller (SIZEMAX=) and use a non-filled marker

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 814 views
  • 0 likes
  • 2 in conversation