I have variables trt and trt(n=200). In mean plot automation process (GTL), I want to apply discreteattribmap from dataset to trt which is already there in input dataset but want to display only trt(n=200) in legend. trt(n=200) is generated while running GTL which i cant assign attrimmap before running code. I tried with linecolor = trt. in series plot. .It displayed both trt, trt(n=200). but only want trt(n=200) in legend.. Can any one help me?.
I think that you will need to show at a minimum your existing GTL code and the Proc Sgender used to create the graphs.
Possibly example data as well.
Since " trt(n=200)" is an unlikely variable name it isn't clear exactly what this is supposed to represent when you say "I have variables trt and trt(n=200). "
output is attached. discreteattribmap working for scatter but not matching with line color from 'line' of series plot. I need line,symbol color,symbol shape need to merged in legend and plot. can anybody help?
trt= 'Drug A' or 'Drug B'
trtn= 'Drug A(n=200)' or 'Drug B(n=230)'
proc template;
define statgraph order;
begingraph;
layout overlay/yaxisopts=(label="Concenration mg/L")
xaxisopts=(label="Week");
ScatterPlot
X=ndy Y=meancon / GROUP=trt NAME="scatter"
YErrorLower=EVAL(meancon-stdcon)
YErrorUpper=EVAL(meancon+stdcon);
SeriesPlot X=ndy Y=meancon / GROUP=trtn name = 'line' ;
mergedlegend 'scatter' 'line' / ;
;
EndLayout
;
EndGraph
;
END;
RUN;
ods rtf file = 'C:\Users\sasgraph_lib\meanplot1.rtf' style = mystyle;
PROC SGRENDER DATA=pk2 dattrmap = sym TEMPLATE=order
; dattrvar trt ='kk' ;
RUN;
quit;
ods rtf close;
ods listing;
main aim is to : 1. color , shape of line , symbol with "trt" from discreteattribmap applied to trt .
2. make legend with trtn which has count as above.
3. line and symbol merged in legend.
Can anybody give hint or suggestion on this ?. Thanks.
Why do you have two different group variables if they should display as a single item on the legend?
All the examples if find using MERGEDLEGEND show use of the same GROUP variable.
trt is from input data set which i am assigning discreteattribmap for color , symbol, line type. But trtn generated during GTL run which I cant assign discreteattribmap beforehand. only difference between them is suffix count. I need only legend with trtn. Main aim is to get discreteatribmap directly from input data set.
No response yet.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.