I need to compare four different classifications of products and find the common codes between them and then make venn diagram. . Any idea how to start.?
=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Javier Data (resumen). HsOECD & HsFriends HsOECD & HSApec HsOECD & HsFriends & HSApec ans all possibles combination s
|
Administrator
|
Search this group for Cartesian.
http://spssx-discussion.1045642.n5.nabble.com/template/NamlServlet.jtp?macro=search_page&node=1068821&query=Cartesian Review and report back. Javier Meneses wrote > I need to compare four different classifications of products and find the > common codes between them and then make venn diagram. . Any idea how to > start.? > > Javier > > Data (resumen). > HsOECD & HsFriends > HsOECD & HSApec > HsOECD & HsFriends & HSApec ans all possibles combination s > HS Code OECD HS Code Friends HS Code Apec HS Code OMC HS Code EPP > 841410 840420 842139 840420 050900 > 841430 840490 902610 840490 121110 > 841440 840510 841989 840999 121120 > 841480 841410 840490 841410 121190 > 841490 841430 841960 841430 130110 > 842139 841440 840420 841440 130120 > 842199 841459 902620 841459 130190 > 252100 841480 902680 841480 130219 > 252220 841490 902690 841490 140190 > 281610 841960 902750 841960 140310 > 701990 841989 902780 841989 140390 > 841960 842139 902790 842139 140410 > 841989 902610 903180 847989 150510 > > ===================== > To manage your subscription to SPSSX-L, send a message to > LISTSERV@.UGA > (not to SPSSX-L), with no body text except the > command. To leave the list, send the command > SIGNOFF SPSSX-L > For a list of commands to manage subscriptions, send the command > INFO REFCARD ----- Please reply to the list and not to my personal email. Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/ ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
In reply to this post by Javier Meneses
There are many Venn diagram packages available via Python or R programmability, but, unfortunately, most of these packages, including the best ones, are difficult to install. Here is an example using an R package that is easy to install, but you need R and the R Essentials. It has a mediocre interface, and the output is not the best, but it works. I have gone up to three sets. For five, you would extend the pattern as shown and call the function draw.quintuple.venn instead of draw.triple.venn. First I define the data and then install the necessary R package. data list list/HS_code_OECD HS_code_Friends HS_Code_Apec HS_Code_OMC HS_Code_EPP (5F8.0). begin data 841410 840420 842139 840420 050900 841430 840490 902610 840490 121110 841440 840510 841989 840999 121120 841480 841410 840490 841410 121190 841490 841430 841960 841430 130110 842139 841440 840420 841440 130120 842199 841459 902620 841459 130190 252100 841480 902680 841480 130219 252220 841490 902690 841490 140190 281610 841960 902750 841960 140310 701990 841989 902780 841989 140390 841960 842139 902790 842139 140410 841989 902610 903180 847989 150510 end data. dataset name data. list. begin program r. install.packages("VennDiagram") end program. Then I calculate the sizes of all the simple sets, the two way intersections, and the three way intersections and plot the diagrams. begin program r. library(VennDiagram) d = spssdata.GetDataFromSPSS() area1=length(d[[1]]) area2=length(d[[2]]) area3=length(d[[2]]) area4=length(d[[2]]) area5=length(d[[2]]) n12 = length(intersect(d[[1]],d[[2]])) n23 = length(intersect(d[[2]], d[[3]])) n13 = length(intersect(d[[1]], d[[3]])) n123 = length(intersect(d[[1]], intersect(d[[2]], d[[3]]))) labels=c("HS_code_OECD", "HS_code_Friends", "HS_Code_Apec") plt = draw.triple.venn(area1, area2, area3, n12, n23, n13, n123, labels) grid.draw(plt) grid.newpage() end program. HTH On Wed, May 22, 2019 at 1:59 PM javier meneses <[hidden email]> wrote:
|
I'd like to suggest R package Vennerable which is old but good. Personally I would solve this directly in R. Mario Giesel Munich, Germany
Am Donnerstag, 23. Mai 2019, 00:12:09 MESZ hat Jon Peck <[hidden email]> Folgendes geschrieben:
There are many Venn diagram packages available via Python or R programmability, but, unfortunately, most of these packages, including the best ones, are difficult to install. Here is an example using an R package that is easy to install, but you need R and the R Essentials. It has a mediocre interface, and the output is not the best, but it works. I have gone up to three sets. For five, you would extend the pattern as shown and call the function draw.quintuple.venn instead of draw.triple.venn. First I define the data and then install the necessary R package. data list list/HS_code_OECD HS_code_Friends HS_Code_Apec HS_Code_OMC HS_Code_EPP (5F8.0). begin data 841410 840420 842139 840420 050900 841430 840490 902610 840490 121110 841440 840510 841989 840999 121120 841480 841410 840490 841410 121190 841490 841430 841960 841430 130110 842139 841440 840420 841440 130120 842199 841459 902620 841459 130190 252100 841480 902680 841480 130219 252220 841490 902690 841490 140190 281610 841960 902750 841960 140310 701990 841989 902780 841989 140390 841960 842139 902790 842139 140410 841989 902610 903180 847989 150510 end data. dataset name data. list. begin program r. install.packages("VennDiagram") end program. Then I calculate the sizes of all the simple sets, the two way intersections, and the three way intersections and plot the diagrams. begin program r. library(VennDiagram) d = spssdata.GetDataFromSPSS() area1=length(d[[1]]) area2=length(d[[2]]) area3=length(d[[2]]) area4=length(d[[2]]) area5=length(d[[2]]) n12 = length(intersect(d[[1]],d[[2]])) n23 = length(intersect(d[[2]], d[[3]])) n13 = length(intersect(d[[1]], d[[3]])) n123 = length(intersect(d[[1]], intersect(d[[2]], d[[3]]))) labels=c("HS_code_OECD", "HS_code_Friends", "HS_Code_Apec") plt = draw.triple.venn(area1, area2, area3, n12, n23, n13, n123, labels) grid.draw(plt) grid.newpage() end program. HTH On Wed, May 22, 2019 at 1:59 PM javier meneses <[hidden email]> wrote:
|
As far as I can see, there is no R package by the name Vennerable on CRAN. R has venn, venneuler, VennDiagram, and vennplot. I used VennDiagram and sent the OP some code improving the appearance over what I posted, but trying some of the other packages I ran into installation complexities such as requiring a JRE as well as some mysterious failures - particularly with venneuler On Thu, May 23, 2019 at 4:04 AM Mario Giesel <[hidden email]> wrote:
|
Am Donnerstag, 23. Mai 2019, 15:19:50 MESZ hat Jon Peck <[hidden email]> Folgendes geschrieben:
As far as I can see, there is no R package by the name Vennerable on CRAN. R has venn, venneuler, VennDiagram, and vennplot. I used VennDiagram and sent the OP some code improving the appearance over what I posted, but trying some of the other packages I ran into installation complexities such as requiring a JRE as well as some mysterious failures - particularly with venneuler On Thu, May 23, 2019 at 4:04 AM Mario Giesel <[hidden email]> wrote:
|
Thanks, but this is the kind of setup problem I was trying to avoid. The github doc says This package needs a couple of BioConductor packages. Something like This package may make it to CRAN one day, but it isn't there now so the easiest way to install it is with the Finally you can actually install it with
On Thu, May 23, 2019 at 9:40 AM Mario Giesel <[hidden email]> wrote:
|
Sorry for inconvenience, Jon. I never tried it from within SPSS. It sounds really nasty. Mario Giesel Munich, Germany
Am Donnerstag, 23. Mai 2019, 18:30:14 MESZ hat Jon Peck <[hidden email]> Folgendes geschrieben:
Thanks, but this is the kind of setup problem I was trying to avoid. The github doc says This package needs a couple of BioConductor packages. Something like This package may make it to CRAN one day, but it isn't there now so the easiest way to install it is with the Finally you can actually install it with
On Thu, May 23, 2019 at 9:40 AM Mario Giesel <[hidden email]> wrote:
|
This was all done from RStudio, although the result would have been the same running from SPSS. On Thu, May 23, 2019 at 2:14 PM Mario Giesel <[hidden email]> wrote:
|
OK, Jon. This code worked for me on a totally new PC: ----------------------------------------------------------- if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install("graph") BiocManager::install("RBGL") install.packages("reshape") install.packages("Vennerable", repos="http://R-Forge.R-project.org") library(Vennerable) fruits <- c('Apples', ' Pears', 'Bananas') # Circle names freqabs <- c(50,100,25,50,150,75,40,35) # Absolute Frequencies for diagram segments freqrel <- round(freqabs/sum(freqabs) *100, digits=1) # Percentages Circle3_abs <- Venn(SetNames = fruits, Weight = freqabs) # Venn-Diagramm absolute Circle3_rel <- Venn(SetNames = fruits, Weight = freqrel) # Venn-Diagramm relative plot(Circle3_abs) # Venn-Diagramm absolute frequencies plot(Circle3_rel) # Venn-Diagramm relative frequencies ----------------------------------------------------------- Mario Giesel Munich, Germany
Am Donnerstag, 23. Mai 2019, 22:26:00 MESZ hat Jon Peck <[hidden email]> Folgendes geschrieben:
This was all done from RStudio, although the result would have been the same running from SPSS. On Thu, May 23, 2019 at 2:14 PM Mario Giesel <[hidden email]> wrote:
|
Too bad that the installation instructions on GitHub don't use the code you posted. Your code worked for me, although I had already gotten the dependencies worked out. But it appears that this package does not handle five sets as the OP requested. Anyway, the OP has found a nice solution using the Python matplotlib_venn package, which is included in the Anaconda Python 3 distribution (but not the Python 2 version, it appears). I didn't want to suggest that originally because of the installation issues, but with the package included in Anaconda, these are moot. And matplotlib_venn produces pretty nice diagrams - but still not for five sets. There is pyvenn, which does up to six, and some others. Of course, with a lot of sets, the diagrams are not very readable. On Fri, May 24, 2019 at 2:56 AM Mario Giesel <[hidden email]> wrote:
|
The author claims: "The package implements a variant of the Edwards construction, which can in principle
generate Venn diagrams on an arbitrary number of sets n. The currently implemented
algorithm only computes up to 8 sets for the classic construction." (p. 14) I haven't tried it as it seems very hard to understand the output if you have more than 4 sets. Mario Giesel Munich, Germany
Am Freitag, 24. Mai 2019, 19:53:25 MESZ hat Jon Peck <[hidden email]> Folgendes geschrieben:
Too bad that the installation instructions on GitHub don't use the code you posted. Your code worked for me, although I had already gotten the dependencies worked out. But it appears that this package does not handle five sets as the OP requested. Anyway, the OP has found a nice solution using the Python matplotlib_venn package, which is included in the Anaconda Python 3 distribution (but not the Python 2 version, it appears). I didn't want to suggest that originally because of the installation issues, but with the package included in Anaconda, these are moot. And matplotlib_venn produces pretty nice diagrams - but still not for five sets. There is pyvenn, which does up to six, and some others. Of course, with a lot of sets, the diagrams are not very readable. On Fri, May 24, 2019 at 2:56 AM Mario Giesel <[hidden email]> wrote:
|
In reply to this post by Javier Meneses
Note please that to get all combinations of elements from a set you
can use macro !allcomb
(see collection MATRIX-END MATRIX functions of my page http://www.spsstools.net/en/KO-spssmacros). In your situation a set is your five lists, element is a list. If all lists are of equal length (as in your example) then using the function is most convenient. Upon getting combinations, one can then easily examine each and find which values are common between elements (lists) forming a combination. This, however tells nothing about how to plot a Venn diagram in SPSS. 22.05.2019 22:59, javier meneses пишет:
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Free forum by Nabble | Edit this page |