Hello,
when I use this syntax in sgpanel (I am using LSAF = SAS9.4):
1)symbolchar name=sym1 char='2014'x ;
scatter x=avisitn y=mean / markerattrs=(symbol=sym1 size=10pt color=black) name="med";
I am not getting all datapoints right (half is visible, half is missing)
see attached file "symbolchar"
but when I use normal symbol=plus (commenting symbolchar statement)
2) scatter x=avisitn y=mean / markerattrs=(symbol=plus size=10pt color=black) name="med";
I am getting all results correctly.
I was using in previous graphs :
3) scatter x=avisit2n y=MEDIAN / MARKERCHAR=box_char MARKERCHARATTRS=(color= black size=10PT) yerrorlower = lci yerrorupper = uci ERRORBARATTRS=(color=black) name="med";
and in dataset:
box_char="--------";
but this produces legend that show squarefilled instead of dash
I want to know how to show dash as graphical representation of the mean on top of other scatter plots in procedure sgpanel.
Full sgpanel syntax for reference
proc sgpanel data = xxxx;
panelby tseqpg1 / border colheaderpos =top layout=columnlattice spacing = 0 novarname ONEPANEL sort = DATA;
refline 1000/ axis=y LINEATTRS=(pattern = mediumdash color = black) label="LLOQ";
scatter x=avisitn y=aval_resp / jitter legendlabel="Responder" markerattrs=(color=green symbol=circlefilled) name="r1";
scatter x=avisitn y=aval_noresp / jitter legendlabel="No Responder" markerattrs=(color=orange symbol=circle) name="nr1";
symbolchar name=sym1 char='2014'x ;
scatter x=avisitn y=mean / markerattrs=(symbol=sym1 size=25pt color=black) name="med";
colaxistable N MEAN RESPONDERS_RATE / NOMISSINGCHAR SEPARATOR X=avisitn statlabel name="stat_table" VALUEATTRS=(Size=7pt);
rowaxis logbase = 10 logstyle=logexpand type=log label="EU/ml" min = 100 max=10000 LOGVTYPE=EXPANDED MINOR minorcount=9
GRID GRIDATTRS=(color=grayee pattern=solid THICKNESS=1) MINORGRID MINORGRIDATTRS=(color=grayee pattern=solid THICKNESS=1);
colaxis type=linear integer label="Weeks" VALUES=( 1 3 5 7 9 11);
run;
Here is some example data and a program that works in the latest version of SAS:
data have;
call streaminit(123);
do tseqpg1 = 0, 1;
do avisitn = 1 to 4;
mean = avisitn;
do i = 1 to 30;
y = rand("Normal", mean, 1);
output;
end;
end;
end;
drop i;
run;
proc sgpanel data=have noautolegend;
panelby tseqpg1;
symbolchar name=sym1 char='2014'x / textattrs=(family='Arial Unicode MS' weight=bold);
scatter x=avisitn y=y / jitter transparency=0.5;
scatter x=avisitn y=mean / markerattrs=(symbol=sym1 size=40);
run;
Hopefully, it works for you. If not, supply some sample data. Maybe we can use a HIGHLOW or VECTOR statement to create the graph you want.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.