Data visualization with SAS programming

Merge graphs, don't know how

Reply
Frequent Contributor
Posts: 128

Merge graphs, don't know how

By using "plot=roc (id=prob)" option, i can create figure1, but this is jpg format graph. I need a png or tiff format for my paper.
Photobucket
FIGURE1


I try to use proc gplot to do this, and created two graphs, fig2 and fig3.
My questions,
1. how can i merge two graphs in to one (make it the same as fig1).
2. Or any way to create tiff png graphs from proc logistic directly?

Thanks!!

Photobucket
Figure2

Photobucket
Figure3
SAS Employee
Posts: 980

Re: Merge graphs, don't know how

gplot has an 'overlay' option, which you could use something like ...

plot y1*x y2*x / overlay
Frequent Contributor
Posts: 128

Re: Merge graphs, don't know how

Thanks for your advice! It works for me.

But if i can use figure two as a template, and then plot figure 3 on figure 2, then things will be more easier. Is there any way to do this? I know in "R" we can, but in "sas" i have no idea.

Anyway, you help me a lot! Thanks again!!
Smiley Very Happy
SAS Super FREQ
Posts: 925

Re: Merge graphs, don't know how

Hey Ken,

Your ROC curve output appears to be using ODS Graphics. If it is, you can use the IMAGEFMT option on the ODS GRAPHICS statement to set the image type to PNG:

ods graphics on / imagefmt=png;



ods graphics off;

Let me know if that works for you.

Thanks!
Dan
Frequent Contributor
Posts: 128

Re: Merge graphs, don't know how

awesome!!
Thanks, this works! I can have it in png or tiff easily, now!
Frequent Contributor
Posts: 128

Re: Merge graphs, don't know how

Hi Dan, this is the code i am using. How can I remove the grid in figure 1?
i.e. Any place I can put a nogrid option? or something else?
Thanks!

---------------------------------------------------------
ods graphics on / imagefmt=tiff;
proc logistic data=ffinal plots=roc (id=prob);
model dead(event='1')= age power factor area/nofit;
roc 'All' age power factor area;
run;
ods graphics off;
SAS Super FREQ
Posts: 925

Re: Merge graphs, don't know how

There are a couple of ways to do this. One involves editing the graph template used to create the graph in LOGISTIC. However, based on the way the LOGISTIC template is set up, you should also be able to do it tis way:

[pre]
proc template;
define style styles.nogrid;
parent=styles.listing; /* or your favorite style */
Style GraphGridLines from GraphGridLines /
displayopts="off"
;
end;
run;

ods listing style=nogrid; /* or whatever destination you're using */


[/pre]


Let me know if this works for you.

Thanks!
Dan
Frequent Contributor
Posts: 128

Re: Merge graphs, don't know how

Great Job! Dan

This is what i want!

Learn a lot from you!

Thanks!!!

Ken
Ask a Question
Discussion stats
  • 7 replies
  • 241 views
  • 0 likes
  • 3 in conversation