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

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

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