Data visualization with SAS programming

3 way Venn diagram

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

3 way Venn diagram

Hi,

I am trying to build a 3 way Venn diagram visualising the data below.

 

Id                       min     max  avg

Good                 12      49    25

Bad                   12      41    30

Intermediate      23     46    49

 

 

I have sourced a macro via Google and does not seem provide a solution to my issue.

 

Macro Call

%macro venn(

data =summary_exp6

,venn_diagram = 3

,cutoff = < 0.3

,Good = Treatment A

,Bad = Treatment B

,Intermediate  = Treatment C

,out_location = H:\SAS Projects

,outputfilename = Venn diagram

);

 The macro above (according to my limited SAS knowledge) will not alone create the output which I require.  I would be gratetful of any help resolving this issue.

 

Thanks !


Accepted Solutions
Solution
‎02-08-2016 04:07 AM
SAS Super FREQ
Posts: 1,078

Re: 3 way Venn diagram

I published an article on the 2-way proportional Euler diagram last year.  http://blogs.sas.com/content/graphicallyspeaking/?s=euler+diagram  Clearly the 3-way case is harder, but maybe you can get some ideas.

 

 

View solution in original post


All Replies
Contributor
Posts: 38

Re: 3 way Venn diagram

Where's the rest of the macro?
New Contributor
Posts: 4

Re: 3 way Venn diagram

That's all that I have at the moment. I do understand it forms part of a larger macro but thats what I need help with building.

 

Thanks

Super Contributor
Posts: 252

Re: 3 way Venn diagram

I have a paper on creating Venn Diagrams. As long as you have SAS 9.3 or more you can use the code. If you have the dataset created already than you only really need to use the GTL template.

 

http://support.sas.com/resources/papers/proceedings13/243-2013.pdf

Super Contributor
Posts: 252

Re: 3 way Venn diagram

What are you actually trying to plot on your venn diagram please?

Grand Advisor
Posts: 17,312

Re: 3 way Venn diagram

Here are some references with code samples. 

http://www.robslink.com/SAS/democd14/aaaindex.htm

Grand Advisor
Posts: 10,196

Re: 3 way Venn diagram

From a search on this topic I did a few years ago

 

Attachment
SAS Super FREQ
Posts: 3,390

Re: 3 way Venn diagram

You probably don't want to hear this, but Venn diagrams that consist of planar circles are poor models for showing relationships between sets.  They can be used to show QUALITATIVE relationships, but are not good for quantitative relationships.

 

It is easy to construct examples in which the Venn diagram misrepresents the quantities that are shared between sets. The simplest example with three sets is A={1} and B={2} and C={1 2}. There is no way to use circles to construct a Venn diagram that represents this state correctly. Two attempts are shown below. The attempt on the left indicates that there are elements of C that are not contained in A or B, which is wrong. The attempt on the right also misrepresents the union and intersection.

When you get to four or more sets, the problems become even worse.

 

There are other shapes that you can use to construct Venn diagrams, such as rectangles, but in general a good cross-tabulation of counts or a mosaic plot is more informative. You can use PROC FREQ to create a mosaic plot automatically.

 

Region Capture.png

Solution
‎02-08-2016 04:07 AM
SAS Super FREQ
Posts: 1,078

Re: 3 way Venn diagram

I published an article on the 2-way proportional Euler diagram last year.  http://blogs.sas.com/content/graphicallyspeaking/?s=euler+diagram  Clearly the 3-way case is harder, but maybe you can get some ideas.

 

 

New Contributor
Posts: 4

Re: 3 way Venn diagram

Thanks guys for your help. Much appreciated !!

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 9 replies
  • 660 views
  • 0 likes
  • 7 in conversation