csss 569 visualizing data and models
play

CSSS 569 Visualizing Data and Models Lab 8: Visualizing Relational - PowerPoint PPT Presentation

CSSS 569 Visualizing Data and Models Lab 8: Visualizing Relational Data Kai Ping (Brian) Leung Department of Political Science, UW March 2, 2020 Prerequisite The following packages are required for this lab: packages <- c


  1. CSSS 569 Visualizing Data and Models Lab 8: Visualizing Relational Data Kai Ping (Brian) Leung Department of Political Science, UW March 2, 2020

  2. Prerequisite ◮ The following packages are required for this lab: packages <- c ("tidygraph", "ggraph", "reshape2", "cluster", "circlize") install.packages (packages)

  3. Introduction: Relational data ◮ Map of sciences (Bollen et al. 2009)

  4. Introduction: Relational data ◮ Network data create many challenges for visualization

  5. Introduction: Relational data ◮ Network data create many challenges for visualization ◮ Cursed by high dimensionality

  6. Introduction: Relational data ◮ Network data create many challenges for visualization ◮ Cursed by high dimensionality ◮ Network diagrams usually result in hairballs or spaghetti balls. . .

  7. Introduction: Relational data ◮ Network data create many challenges for visualization ◮ Cursed by high dimensionality ◮ Network diagrams usually result in hairballs or spaghetti balls. . . ◮ The main takeaway of this lab is actually to seek alternative visualization methods whenever possible

  8. Examples in today’s lab ◮ Florentine families and the rise of Medici: network diagram ● Castellani ● ● Barbadori Peruzzi Strozzi ● ● Acciaiuoli Ridolfi ● ● ● Medici Bischeri ● ● ● Salviati Pazzi Tornabuoni Guadagni ● Albizzi ● ● Lamberteschi Pucci Ginori ● ●

  9. Examples in today’s lab ◮ Global migration data: heat map ◮ Additional tricks: making NA s explicit; cluster analysis Destination South−Eastern Asia Northern America Southern Europe Northern Europe Central America Western Europe Southern Africa Eastern Europe Northern Africa Western Africa South America Southern Asia Eastern Africa Western Asia Middle Africa Eastern Asia Central Asia Caribbean Oceania Southern Asia Western Asia South−Eastern Asia Central America Eastern Asia Western Africa Migration flow Eastern Africa 100000 or more Northern Africa Caribbean 50000 − 100000 Origin South America 10000 − 50000 Northern Europe Northern America 5000 − 10000 Middle Africa 1000 − 5000 Oceania Southern Africa Central Asia Eastern Europe Southern Europe Western Europe

  10. Examples in today’s lab ◮ Global migration data: chord diagram 0 1.4e+07 2 e + 0 6 7 + 0 4 Africa . 2 e e + 0 1 6 0 7 + 6e+06 Western Asia 1 e 8e+06 8e+06 6e+06 1e+07 4e+06 Eastern Asia 0 2 e 2e+06 + 0 6 0 0 Eastern Europe & Central Asia 2 e 1.2e+07 + 0 6 4e+06 1 e + 0 7 0 Southern Asia 8e+06 2e+06 6e+06 4e+06 Europe 4e+06 6 0 + e 6 2e+06 8e+06 0 7 0 + e 1 O c e a 0 n 0 i a Latin America 2e+06 6e+06 & Caribbean 4e+06 4e+06 Northern America 0 2 e + 0 6

  11. Introduction: Relational data ◮ The science of networks is incredibly interdisciplinary:

  12. Introduction: Relational data ◮ The science of networks is incredibly interdisciplinary: ◮ Computer science (e.g. World Wide Web)

  13. Introduction: Relational data ◮ The science of networks is incredibly interdisciplinary: ◮ Computer science (e.g. World Wide Web) ◮ Biology (e.g. protein-protein interaction networks)

  14. Introduction: Relational data ◮ The science of networks is incredibly interdisciplinary: ◮ Computer science (e.g. World Wide Web) ◮ Biology (e.g. protein-protein interaction networks) ◮ Engineering (e.g. electrical grid networks)

  15. Introduction: Relational data ◮ The science of networks is incredibly interdisciplinary: ◮ Computer science (e.g. World Wide Web) ◮ Biology (e.g. protein-protein interaction networks) ◮ Engineering (e.g. electrical grid networks) ◮ Epidemiology (e.g. disease transmission networks)

  16. Introduction: Relational data ◮ The science of networks is incredibly interdisciplinary: ◮ Computer science (e.g. World Wide Web) ◮ Biology (e.g. protein-protein interaction networks) ◮ Engineering (e.g. electrical grid networks) ◮ Epidemiology (e.g. disease transmission networks) ◮ Economics (e.g. networks of interlocking directorates)

  17. Introduction: Relational data ◮ The science of networks is incredibly interdisciplinary: ◮ Computer science (e.g. World Wide Web) ◮ Biology (e.g. protein-protein interaction networks) ◮ Engineering (e.g. electrical grid networks) ◮ Epidemiology (e.g. disease transmission networks) ◮ Economics (e.g. networks of interlocking directorates) ◮ Sociology (e.g. networks of LGBT groups; social media)

  18. Introduction: Relational data ◮ The science of networks is incredibly interdisciplinary: ◮ Computer science (e.g. World Wide Web) ◮ Biology (e.g. protein-protein interaction networks) ◮ Engineering (e.g. electrical grid networks) ◮ Epidemiology (e.g. disease transmission networks) ◮ Economics (e.g. networks of interlocking directorates) ◮ Sociology (e.g. networks of LGBT groups; social media) ◮ Political science (e.g. political elite networks)

  19. Introduction: Relational data ◮ The science of networks is incredibly interdisciplinary: ◮ Computer science (e.g. World Wide Web) ◮ Biology (e.g. protein-protein interaction networks) ◮ Engineering (e.g. electrical grid networks) ◮ Epidemiology (e.g. disease transmission networks) ◮ Economics (e.g. networks of interlocking directorates) ◮ Sociology (e.g. networks of LGBT groups; social media) ◮ Political science (e.g. political elite networks) ◮ In this lab, I want you to think more genericalyl about relational data

  20. Introduction: Relational data ◮ The science of networks is incredibly interdisciplinary: ◮ Computer science (e.g. World Wide Web) ◮ Biology (e.g. protein-protein interaction networks) ◮ Engineering (e.g. electrical grid networks) ◮ Epidemiology (e.g. disease transmission networks) ◮ Economics (e.g. networks of interlocking directorates) ◮ Sociology (e.g. networks of LGBT groups; social media) ◮ Political science (e.g. political elite networks) ◮ In this lab, I want you to think more genericalyl about relational data ◮ More specifically, any data whose unit of observation is dyadic

  21. Introduction: Relational data ◮ The science of networks is incredibly interdisciplinary: ◮ Computer science (e.g. World Wide Web) ◮ Biology (e.g. protein-protein interaction networks) ◮ Engineering (e.g. electrical grid networks) ◮ Epidemiology (e.g. disease transmission networks) ◮ Economics (e.g. networks of interlocking directorates) ◮ Sociology (e.g. networks of LGBT groups; social media) ◮ Political science (e.g. political elite networks) ◮ In this lab, I want you to think more genericalyl about relational data ◮ More specifically, any data whose unit of observation is dyadic ◮ Examples: Migration flow data, or import/export data, between countries. . .

  22. Introduction: Relational data ◮ Two basic elements:

  23. Introduction: Relational data ◮ Two basic elements: ◮ Nodes (or vertices)

  24. Introduction: Relational data ◮ Two basic elements: ◮ Nodes (or vertices) ◮ Links (or edges)

  25. Introduction: Relational data ◮ Two basic elements: ◮ Nodes (or vertices) ◮ Links (or edges) ◮ Two ways to represent relational data:

  26. Introduction: Relational data ◮ Two basic elements: ◮ Nodes (or vertices) ◮ Links (or edges) ◮ Two ways to represent relational data: ◮ Matrix (or adjacency matrix)

  27. Introduction: Relational data ◮ Two basic elements: ◮ Nodes (or vertices) ◮ Links (or edges) ◮ Two ways to represent relational data: ◮ Matrix (or adjacency matrix) ◮ Long data frame(or edge list)

  28. Introduction: Relational data ◮ Two basic elements: ◮ Nodes (or vertices) ◮ Links (or edges) ◮ Two ways to represent relational data: ◮ Matrix (or adjacency matrix) ◮ Long data frame(or edge list) ◮ Example with the marriage network of Florentine families

  29. Example 1: Florentine families and the rise of Medici ◮ Marriage ties between Florentine familes in early 15th century ◮ From Padget & Ansell (1993) ● Castellani ● ● Barbadori Strozzi Peruzzi ● ● Acciaiuoli Ridolfi ● ● ● Medici Bischeri ● ● ● Salviati Pazzi Tornabuoni Guadagni ● Albizzi ● ● Lamberteschi Pucci Ginori ● ●

  30. Example 1: Florentine families and the rise of Medici ◮ Represent relational data with matrix (or adjacency matrix) ## Acciaiuoli Albizzi Barbadori Bischeri Castellani Ginori Guadagni ## Acciaiuoli 0 0 0 0 0 0 0 ## Albizzi 0 0 0 0 0 1 1 ## Barbadori 0 0 0 0 1 0 0 ## Bischeri 0 0 0 0 0 0 1 ## Castellani 0 0 1 0 0 0 0 ## Ginori 0 1 0 0 0 0 0 ## Guadagni 0 1 0 1 0 0 0 ## Lamberteschi 0 0 0 0 0 0 1 ## Medici 1 1 1 0 0 0 0 ## Pazzi 0 0 0 0 0 0 0 ## Peruzzi 0 0 0 1 1 0 0 ## Pucci 0 0 0 0 0 0 0 ## Ridolfi 0 0 0 0 0 0 0 ## Salviati 0 0 0 0 0 0 0 ## Strozzi 0 0 0 1 1 0 0 ## Tornabuoni 0 0 0 0 0 0 1

Recommend


More recommend