BookmarkSubscribeRSS Feed
greveam
Quartz | Level 8

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)

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

You cannot use density plot with basic plots.  See this page for compatability:

http://documentation.sas.com/?docsetId=grstatproc&docsetTarget=p0yud64khw8fuin1xgr85dgxbb7t.htm&docs...

 

Basic and Distribution are not compatible.

greveam
Quartz | Level 8
Thanks

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2422 views
  • 0 likes
  • 2 in conversation