Hi All, Sorry if it's already post, can't see the first 2 posts idid. Can You please help to find out what’s wrong with my code, I’m trying to have spaghetti plot for 2 groups (TRTN), I want to control the color, the thickness, and symbols etc…by treatment. i.e all subjects within the same group have same color etc. The line plot are mixed up and do not display the correct values. I want for TRT=1 RED LINE and solid. For TRTN=2 BLUE LINE AND SHORTDASH proc sgplot data=my_data; title1 'MY TITLTE'; title2; styleattrs datacontrastcolors=(red blue) datasymbols=(squarefilled trianglefilled) datalinepatterns=(Solid ShortDash); series x=avisitn y=aval / group=subjid grouplc=trtn name='grouping' Markers MARKERATTRS = (color = black) curvelabel; scatter x=avisitn y=aval / group = subjid name = 'subjid' markerattrs=(color = black ); xaxis display=all grid integer values=(12 13 14 15 16 17) valueshint; yaxis LABEL = 'YLABEL)' grid; keylegend 'grouping' / type=linecolor; run; Here is my data data my_data ; input subjid avisit $ avisitn aval trt $ trtn; datalines; 20110100 Month3 14 2.9 A 1 20110101 Baseline 13 2.3 A 1 20110101 Month3 14 2 A 1 20110101 Month6 15 2.3 A 1 20110101 Month9 16 2.9 A 1 20110200 Baseline 13 2.7 A 1 20110200 Baseline 13 2.9 A 1 20110200 Month3 14 2 A 1 20110200 Month6 15 2 A 1 20110200 Month9 16 2 A 1 20110200 Month12 17 1.4 A 1 20110300 Baseline 13 2 A 1 20110300 Month3 14 1.8 A 1 20110300 Month6 15 2 A 1 20110600 Month3 14 2.9 A 1 20110200 Baseline 13 2.3 B 2 20110200 Baseline 13 2.3 B 2 20110200 Month3 14 2.7 B 2 20110200 Month6 15 2.3 B 2 20110200 Month9 16 2.5 B 2 20110200 Month12 17 2.3 B 2 20110600 Month3 14 2.9 B 2 ; run;
... View more