Hi All,
I am trying to create a higlow graph. I want to color the bars with different colors based on the treatment subject received. For some reason this is not working as desired. I first created this dataset
data barcol ;
length id value fillcolor $50 ;
retain linecolor "black" ;
id = "coh"; value = "a" ; fillcolor = "red" ; output;
id = "coh"; value = "b" ; fillcolor = "green" ; output;
id = "coh"; value = "c" ; fillcolor = "orange" ; output;
run;
then I used this in proc sgplot statement
proc sgplot data=final noautolegend nocycleattrs dattrmap=barcol;
styleattrs wallcolor = lightyellow ;
highlow y=subj low=start high=end1 / highcap=acap group=coht type=bar nooutline nomissinggroup transparency=0.1 name = 'proj' attrid = coh ;
Any suggestions ?
What are the formatted values of the variable Coht?
If you have a default format for the variable that displays text other than 'a' 'b' 'c' then the values don't match.
Or if the actual values and no custom format is assigned then 'A' is not the same as the 'a' in the dattrmap data set.
What are the formatted values of the variable Coht?
If you have a default format for the variable that displays text other than 'a' 'b' 'c' then the values don't match.
Or if the actual values and no custom format is assigned then 'A' is not the same as the 'a' in the dattrmap data set.
Thanks for your response. I realize the mistake I made. It seems that same variable has to be used in group and attrid (atleast with same value).
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.