I am unable to create stacked charts by group and subgroup in sas9.4, I want charts which are similar to excel graphs. The age group=ALL should have different pattern Please find the sample data and excel graph below (first image) and also the SAS graph (second image).
The graph as created in SAS: enter image description here
I need the plot to like in excel :
The age group=ALL should have different pattern. Could you please advise?
enter image description here
The age group=ALL should have different pattern as in excel.
In SAS I could not change the pattern or color of group level=ALLyour text
I am unable to create stacked charts by group and subgroup in sas9.4, I want charts which are similar to excel graphs. The age group=ALL should have different pattern Please find the sample data and excel graph below (first image) and also the SAS graph (second image).
The graph as created in SAS: enter image description here
I need the plot to like in excel :
The age group=ALL should have different pattern. Could you please advise?
enter image description here
The age group=ALL should have different pattern as in excel.
In SAS I could not change the pattern or color of group level=ALLyour text
- 1 Please post data and code you used to produce those pictures. – Tom Commented 2 days ago
- Is this even a programming question? – Robert Commented 2 days ago
1 Answer
Reset to default 0
data attrmap;
length id $10 value $ 10 fillcolor $25 linecolor $ 25 fillattrs $25;
input id $ value $ fillcolor $ linecolor $ fillattrs $ ;; cards;
originmap 2002-1996 CX4D7EBF CX4D7EBF CX4D7EBF
originmap 2009-2003 CX90B0D9 CX90B0D9 CX90B0D9
originmap 2010-2017 CX13478C CX13478C CX13478C
;
run;
ods graphics / reset=all;
proc sgplot data=surivival_graph1 dattrmap=attrmap;
vbarparm category=agexppp response=cr_r /
group=period attrid=originmap name="mybar"
OUTLINEATTRS=(color=black) groupdisplay=cluster
fill ;
Highlow High = hi_cr low = lo_cr x = agexppp /
highcap =serif lowcap = serif lineattrs=(color=red) labelattrs=(color=black)
highlabel= label group=period groupdisplay=cluster
fill ;
xaxis label= "age group" values=('20-49' '50-64' '65+' 'All') ;
yaxis min=0 max=100 /*minor minorcount=10*/ label="surivival"
offsetmin = 0.05 offsetmax = 0.05 ;
keylegend "mybar" / title="";
;
format period $period. agexppp $agexpppc.;
;
run;