BookmarkSubscribeRSS Feed
statsas
Fluorite | Level 6

Dears,

I'm using SAS 9.4.

I have a problem with jitter option in scatterplot statement within proc template.

I got a strange jittering for group "TRT A".

Bellow my SAS code and output.

 

Thanks in advance.

 

proc template;
   define statgraph plot1;
   begingraph;
      ENTRYTITLE  " Title"   ;


     layout datalattice COLUMNVAR=TRTSEQPN / columns=2 rows=1 headerlabeldisplay=value headerlabelattrs=(size=8pt)
            headerlabelattrs=GraphUnicodeText OUTERPAD=0.2 cm columngutter=8
     columnaxisopts=(display=(ticks tickvalues LABEL)  LABEL="xx" TICKVALUEATTRS= (family = "Arial" size = 7pt)
             type=discrete OFFSETMIN=0.15 OFFSETMAX=0.15) 
     rowaxisopts =(display=(ticks tickvalues LABEL) type=log 
            logopts=(BASE=2 Thresholdmax=1 Thresholdmin=1 MINORTICKS =TRUE MINORGRID=TRUE) 
            labelattrs=GraphUnicodeText labelattrs=(size=7pt) LABEL="y"  griddisplay=on )
     INSET=(nbc) insetopts=(autoalign=(topleft) CONTENTDISPLAY=VALUE DATASCHEME=Matched);
      layout prototype;
      SCATTERPLOT X=vis Y=aval/ group=TRTSEQPN MARKERATTRS=(size=8 ) jitter=auto JITTEROPTS=(width=0.50 );
  

      endlayout;


      endlayout;
   endgraph;
   end;
 quit;

proc format;
  value trtf 1="trt A"
             2="trt B";
Run;

proc sgrender data=im03 template=plot1 ; 
FORMAT  TRTSEQPN trtf. ;
run;

SGRender14.png

1 REPLY 1
ballardw
Super User

Since the markers are jittered then you will have to describe just what the actual "problem" is.

I suspect that you have an expected appearance but you don't say what that would be.

This from the documentation on the WIDTH option for JITTEROPTS may apply:

Note For a discrete axis, this option has effect only when the markers cannot be clustered side-by-side without overlapping. When WIDTH= is set to a value that is sufficient to eliminate marker overlap in that case, increasing the value further has no effect.

You have specified the x axis as discrete. If your issue is the odd vertical dispersion of markers I suspect the procedure is attempting to avoid overlapping the markers in both vertical and horizontal. Also o character has more area for overlapping than + so things move further apart to avoid the overlap.

 

And without any data we can't test your code for modification. From your display I would guess that Trt A has more records with similar Y values.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 2752 views
  • 0 likes
  • 2 in conversation