Hi,
I want to overlay two plots using proc sgplot. I've tried the code below but get the error message:
"ERROR: Attempting to overlay incompatible plot or chart types"
Code:
proc sgplot data=estimates NOAUTOLEGEND Noborder;
Series y=ExpEstimate x=var / LINEATTRS=(THICKNESS=4);
band upper=UpperExp lower=LowerExp x=var / transparency=.5;
REFLINE 1 / Axis=Y LINEATTRS=(pattern=ThinDot color=Black THICKNESS=1);
yaxis Values=(0.25 0.5 1 1.5 2 3 4 5 6) Label="Hazard Ratio" Type=LOG LABELATTRS=(weight=BOLD style=normal size=11);
xaxis min=0 VALUES=(0 to 85 by 5) Label="Units" LABELATTRS=(weight=BOLD style=normal size=11);
density var;
run;
Attached is a copy of the graph I'm trying to create.
Any help would be greatly appreciated.
Thanks,
Anders (SAS9.4M2)
You cannot use density plot with basic plots. See this page for compatability:
Basic and Distribution are not compatible.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.