10-30-2017 02:32 PM
I am trying to draw a graph as shown below, I was wondering why the points at the same time point didn't consistent on the same vertical line?? for example, all points at x = -1 are not consistent on the vertical line x = -1, some a little left, some a little right...any idea?
here is my code:
ods graphics on / ATTRPRIORITY=NON width = 8in height = 6in border = off; proc sgplot data= height_mean nowall noborder; styleattrs datacontrastcolors=(blue red mediumgreen magenta orange lilac) datasymbols=(circlefilled squarefilled trianglefilled triangleDownfilled DiamondFilled circle square) datalinepatterns=(solid); title height=.22in font ="Arial" 'Height cm'; series x=month y = mean_height / group = patient groupdisplay=cluster clusterwidth=0.5 lineattrs=(thickness=3) markers markerattrs=(size=11); xaxis label='Time (Months)' values = (-1 to 12 by 1) offsetmin=0.02 labelattrs = (Family=Arial size = 12 weight = bold) valueattrs = (Family=Arial size = 12 weight = bold); yaxis label="Height cm" values = (50 to 80 by 5) labelattrs = (Family=Arial size = 12 weight = bold) valueattrs = (Family=Arial size = 12 weight = bold) offsetmin=0; keylegend / valueattrs=(Family=Arial size = 12 weight=bold) linelength=0.5cm position = right noborder title=""; run;
Here is the graph:
10-30-2017 03:07 PM
Yes, they are. The month value was that I classified by event date in original data. Actually, as you can see, my previous questions you helped me solved, the points also didn't consistent in one vertical line. Any idea?
Thanks so much!
10-30-2017 03:15 PM
I agree with @WarrenKuhfeld, SAS doesn't jitter by default so it would have to be in the data.
Run a proc print on your data set and remove any formats to ensure you're seeing the underlying values, which is what SAS will be using. If you can, post the output from the following.
proc print data=height_mean; var month; format month; where month < 0; run;
Need further help from the community? Please ask a new question.