You can create a Venn diagram with up to 5 potentially overlapping sets. A Venn diagram illustrates relationships between and among two or more variables using intersecting circles. The diagram is intuitive to interpret but struggles with complicated data sets.
It is important to note that Venn diagrams can only perfectly depict the intersection of three or fewer variables. Any more and the diagram becomes an approximation.
This article describes how to create a Venn Diagram like the one below from a set of at least two binary variables.
Requirements
At least two variables with data stored in a binary format (1's and 0's).
Method
- Go to Create > Charts > Visualization > Exotic > Venn.
- Under Inputs > DATA SOURCE > Variables in 'Data' select the variables or variable set you want to use for the visualization.
- OPTIONAL: Under Chart, you can make additional modifications, such as adjust the color palette and font.
Options
The following is an explanation of the options available in the Object Inspector for this specific visualization. Refer to Visualization Options for general chart formatting options.
Inputs
Data source
The input data can come in the following forms:
- Binary indicator variables (Variables or a Question/Variable set) where the variables indicate which cases are included in which sets.
- Table or pasted data of binary indicators (zero or one) with the cases along the rows and sets along the columns.
- R Output that contains nested lists indicating the various set overlaps, as shown in the example below.
Chart
DATA LABELS
- Data label font size The font size of the labels drawn within the circles.
- Show as percentages Computes percentages when the data is provided as binary variables.
HOVER
- Number Type How the numbers appear when the user hovers their mouse over them (Automatic, Percentages, Number).
- Decimal places. The maximum number of decimal places to show.
Technical details
- Minimizes sum of squared residuals to find the best overlap. Where no diagram appears, it is likely that there is a problem with the inputs.
- If resizing a Venn diagram, it is necessary to press the Calculate button to have it redraw.
- It is important to note that Venn diagrams can only perfectly depict the intersection of three or fewer variables. Any more and the diagram becomes an approximation.
Acknowledgments
The Venn diagram is computed using the R package d3vennR by Kenton Russell, which is in turn based on R d3.js by Ben Frederickson.