The final activity for each learning lab provides space to work with data and to reflect on how the concepts and techniques introduced in each lab might apply to your own research.

To earn a badge for each lab, you are required to respond to a set of prompts for two parts: 

Part I: Reflect and Plan

Use your institutional library, Google Scholar, or search engine of your choice to locate a research article, presentation, or resource that applies social network analysis to an educational context or topic of interest. More specifically, locate a network study that makes use of sociograms to visualize relational data. You are also welcome to select one of the research papers listed in the essential readings that may have piqued your interest.

  1. Provide an APA citation for your selected study.

    McKay, Grygiel, P., & Karwowski, M. (2017). Connected to create: A social network analysis of friendship ties and creativity. Psychology of Aesthetics, Creativity, and the Arts, 11(3), 284–294. https://doi.org/10.1037/aca0000117

  2. Who are the network’s actors and how are they represented visually?

    • McKay, Grygiel, and Karwowski (2017) examined friendship ties among high school and elementary students across two studies. The actors were the students, and the nodes representing each student was visually depicted as dots within a traditional sociogram. The authors included three (3) sociograms of varying density.
  3. What ties connect these actors and how are they represented visually?

    • The researchers included all ties, indegree and outdegree ties in their analyses. They represented the bidirectional ties with two-way arrows between nodes, but they also represented mutual connections with thicker lines and directional connections with thinner lines (depending on which graph the reader looked at).
  4. Why were these relations of interest to the researcher?

    • The researchers were interested examining how friendship ties and creativity are related. Based on the homophily hypothesis, they “predicted friendship ties would more likely occur between people similar to each other on creativity-related attributes,” and “also predicted students would be more likely to report friendship ties with peers who have higher creativity scores in general.”
  5. Finally, what makes this collection of actors a social network?

    • The actors were situated within a school and within classrooms.

Draft a research question for a population you may be interested in studying, or that would be of interest to educational researchers, and that would require the collection of relational data and answer the following questions:

RQ1: In what ways do connections among FIRST Lego League team members contribute to individual members’ domain learning in robotics knowledge and skills? In creative problem-solving?

RQ2: How do the connections among established FIRST Lego League teams and novice FIRST Lego League teams within the Cultivating Creative Coders (3C) program change over time?

RQ3: Are there group differences? Does density and centrality within the FLL network relate to higher learning gains depending on component or clique?

  1. What relational data would need to be collected?

    • FIRST Lego League team members’ ties and between teams ties.
  2. For what reason would relational data need to be collected in order to address this question?

    • Since my research questions are inherently about the ties between FLL team members and other teams, I would need relational data to express the presence and strength of those relationships. Self-report is only one way to collect that information; I can also use GoReact data as a verification strategy and code the “connections” between members at staged events within the program.

Explain the analytical level at which these data would need to be collected and analyzed.

RQ1: I would use the ties/edges to describe the patterns among and between the FLL teams.

RQ2: I would use examine the centrality and density of the ties among and between FLL teams over the duration of the “intervention” (i.e., Cultivating Creative Coders program).

RQ3: I would use descriptive data from the density and centrality metrics of the FLL teams and their members as correlates.

  1. How does this differ from the ways in which individual or group behavior is typically conceptualized and modeled in conventional educational research?

    SNA is different than traditional measures of individual or group behavior because it prioritizes a visual representation of the relationships over other outputs (e.g., APA-formatted data tables). It focuses on the network as a whole powered by blending edges and nodes (modeled quantitatively).

Part II: Data Product

The final step in the workflow/process is sharing the results of your analysis with wider audience. Krumm et al. @krumm2018 have outlined the following 3-step process for communicating with education stakeholders findings from an analysis:

  1. Select. Communicating what one has learned involves selecting among those analyses that are most important and most useful to an intended audience, as well as selecting a form for displaying that information, such as a graph or table in static or interactive form, i.e. a “data product.”

  2. Polish. After creating initial versions of data products, research teams often spend time refining or polishing them, by adding or editing titles, labels, and notations and by working with colors and shapes to highlight key points.

  3. Narrate. Writing a narrative to accompany the data products involves, at a minimum, pairing a data product with its related research question, describing how best to interpret the data product, and explaining the ways in which the data product helps answer the research question and might be used to inform new analyses or a “change idea” for improving student learning.

For your first SNA badge, your goal is to distill the analysis from our case study into a simple “data product” designed to illustrate a key finding from our analysis. For the purposes of this task, imagine that your audience consists of teachers and school leaders who have limited background in SNA and adapt the following steps accordingly:

  1. Select. Select the teacher and/or student sociogram we created in the case study, or create an entirely new sociogram if so motivated, to share with teacher and school leaders.

  2. Polish. Refine this sociogram a little more to help illustrate an interesting aspect about the network of classroom friendships reported by teachers and/or students.

  3. Narrate. Write a brief narrative to accompany your visualization and/or table describing how best to interpret the data product and how it might why it might be informative or useful to your intended audience.

I highly recommend creating a new R script in your lab-1 folder to complete this task. When your code is ready to share, use the code chunk below to share the all the code necessary to create your data product.

## ----load-tidyverse---------------------------------------------------------
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.2     ✔ readr     2.1.4
## ✔ forcats   1.0.0     ✔ stringr   1.5.0
## ✔ ggplot2   3.4.2     ✔ tibble    3.2.1
## ✔ lubridate 1.9.2     ✔ tidyr     1.3.0
## ✔ purrr     1.0.1     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
## ----load-packages----------------------------------------------------------
# Megan Atha
# SNA Learning Lab 1

# install.packages(readxl)
library(tidygraph)
## 
## Attaching package: 'tidygraph'
## 
## The following object is masked from 'package:stats':
## 
##     filter
library(ggraph)
library(readxl)




## ----student-data-----------------------------------------------------------
student_friends <- read_excel("data/student-reported-friends.xlsx", 
                              col_names = FALSE)
## New names:
## • `` -> `...1`
## • `` -> `...2`
## • `` -> `...3`
## • `` -> `...4`
## • `` -> `...5`
## • `` -> `...6`
## • `` -> `...7`
## • `` -> `...8`
## • `` -> `...9`
## • `` -> `...10`
## • `` -> `...11`
## • `` -> `...12`
## • `` -> `...13`
## • `` -> `...14`
## • `` -> `...15`
## • `` -> `...16`
## • `` -> `...17`
## • `` -> `...18`
## • `` -> `...19`
## • `` -> `...20`
## • `` -> `...21`
## • `` -> `...22`
## • `` -> `...23`
## • `` -> `...24`
## • `` -> `...25`
## • `` -> `...26`
## • `` -> `...27`
## ----inspect-students-------------------------------------------------------
student_friends
## # A tibble: 27 × 27
##     ...1  ...2  ...3  ...4  ...5  ...6  ...7  ...8  ...9 ...10 ...11 ...12 ...13
##    <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
##  1     0     1     0     1     1     1     1     1     1     0     0     1     0
##  2     1     0     0     0     1     0     0     0     0     1     1     0     0
##  3     1     0     0     1     0     0     0     1     0     1     0     0     0
##  4     1     0     0     0     0     0     0     0     0     0     0     1     0
##  5     1     1     0     1     0     1     1     1     1     0     1     1     1
##  6     1     0     0     0     1     0     0     0     1     0     1     1     1
##  7     1     0     1     1     0     0     0     0     1     0     0     0     1
##  8     1     0     1     1     1     0     1     0     1     1     1     0     1
##  9     1     0     0     0     0     1     1     0     0     0     1     0     1
## 10     1     1     1     1     1     0     1     1     0     0     1     1     1
## # ℹ 17 more rows
## # ℹ 14 more variables: ...14 <dbl>, ...15 <dbl>, ...16 <dbl>, ...17 <dbl>,
## #   ...18 <dbl>, ...19 <dbl>, ...20 <dbl>, ...21 <dbl>, ...22 <dbl>,
## #   ...23 <dbl>, ...24 <dbl>, ...25 <dbl>, ...26 <dbl>, ...27 <dbl>
## ----assign-names-----------------------------------------------------------
rownames(student_friends) <- 1:27
## Warning: Setting row names on a tibble is deprecated.
colnames(student_friends) <- 1:27


## ----view-students----------------------------------------------------------
student_friends
## # A tibble: 27 × 27
##      `1`   `2`   `3`   `4`   `5`   `6`   `7`   `8`   `9`  `10`  `11`  `12`  `13`
##  * <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
##  1     0     1     0     1     1     1     1     1     1     0     0     1     0
##  2     1     0     0     0     1     0     0     0     0     1     1     0     0
##  3     1     0     0     1     0     0     0     1     0     1     0     0     0
##  4     1     0     0     0     0     0     0     0     0     0     0     1     0
##  5     1     1     0     1     0     1     1     1     1     0     1     1     1
##  6     1     0     0     0     1     0     0     0     1     0     1     1     1
##  7     1     0     1     1     0     0     0     0     1     0     0     0     1
##  8     1     0     1     1     1     0     1     0     1     1     1     0     1
##  9     1     0     0     0     0     1     1     0     0     0     1     0     1
## 10     1     1     1     1     1     0     1     1     0     0     1     1     1
## # ℹ 17 more rows
## # ℹ 14 more variables: `14` <dbl>, `15` <dbl>, `16` <dbl>, `17` <dbl>,
## #   `18` <dbl>, `19` <dbl>, `20` <dbl>, `21` <dbl>, `22` <dbl>, `23` <dbl>,
## #   `24` <dbl>, `25` <dbl>, `26` <dbl>, `27` <dbl>
## ----student-attributes-----------------------------------------------------

student_attributes <- read_excel("data/student-attributes.xlsx")

student_attributes
## # A tibble: 27 × 5
##       id gender achievement gender_num achievement_num
##    <dbl> <chr>  <chr>            <dbl>           <dbl>
##  1     1 female high                 1               1
##  2     2 male   average              0               2
##  3     3 female average              1               2
##  4     4 male   high                 0               1
##  5     5 female average              1               2
##  6     6 female average              1               2
##  7     7 female high                 1               1
##  8     8 female average              1               2
##  9     9 female high                 1               1
## 10    10 male   low                  0               3
## # ℹ 17 more rows
## ----import-teacher---------------------------------------------------------
# YOUR CODE HERE
teacher_friends <- read_excel("data/teacher-reported-friends.xlsx",
                              col_names = FALSE)
## New names:
## • `` -> `...1`
## • `` -> `...2`
## • `` -> `...3`
## • `` -> `...4`
## • `` -> `...5`
## • `` -> `...6`
## • `` -> `...7`
## • `` -> `...8`
## • `` -> `...9`
## • `` -> `...10`
## • `` -> `...11`
## • `` -> `...12`
## • `` -> `...13`
## • `` -> `...14`
## • `` -> `...15`
## • `` -> `...16`
## • `` -> `...17`
## • `` -> `...18`
## • `` -> `...19`
## • `` -> `...20`
## • `` -> `...21`
## • `` -> `...22`
## • `` -> `...23`
## • `` -> `...24`
## • `` -> `...25`
## • `` -> `...26`
## • `` -> `...27`
rownames(teacher_friends) <- 1:27
## Warning: Setting row names on a tibble is deprecated.
colnames(teacher_friends) <- 1:27

teacher_friends
## # A tibble: 27 × 27
##      `1`   `2`   `3`   `4`   `5`   `6`   `7`   `8`   `9`  `10`  `11`  `12`  `13`
##  * <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
##  1     0     0     0     1     0     0     0     0     0     0     0     1     0
##  2     0     0     1     0     0     0     0     1     0     1     0     0     0
##  3     0     1     0     0     0     0     0     1     0     1     0     0     0
##  4     0     0     0     0     0     0     0     0     0     0     0     0     0
##  5     1     0     0     0     0     0     0     0     0     0     0     1     1
##  6     0     0     0     0     0     0     0     0     0     0     0     0     1
##  7     0     0     0     0     0     0     0     0     0     0     0     0     1
##  8     0     1     1     0     0     0     0     0     0     1     0     0     0
##  9     0     0     0     0     0     0     0     0     0     0     1     0     0
## 10     0     1     1     0     0     0     0     1     0     0     0     0     0
## # ℹ 17 more rows
## # ℹ 14 more variables: `14` <dbl>, `15` <dbl>, `16` <dbl>, `17` <dbl>,
## #   `18` <dbl>, `19` <dbl>, `20` <dbl>, `21` <dbl>, `22` <dbl>, `23` <dbl>,
## #   `24` <dbl>, `25` <dbl>, `26` <dbl>, `27` <dbl>
## ----convert-network--------------------------------------------------------
student_network <- as_tbl_graph(student_friends, 
                                directed = TRUE)


## ----student-network--------------------------------------------------------
student_network
## # A tbl_graph: 27 nodes and 287 edges
## #
## # An undirected multigraph with 2 components
## #
## # A tibble: 27 × 1
##   name 
##   <chr>
## 1 1    
## 2 2    
## 3 3    
## 4 4    
## 5 5    
## 6 6    
## # ℹ 21 more rows
## #
## # A tibble: 287 × 3
##    from    to weight
##   <int> <int>  <dbl>
## 1     1     1     13
## 2     1     2      3
## 3     1     3      2
## # ℹ 284 more rows
## ---------------------------------------------------------------------------
student_edges <- student_network |>
  activate(edges) |>
  as_tibble()

student_edges
## # A tibble: 287 × 3
##     from    to weight
##    <int> <int>  <dbl>
##  1     1     1     13
##  2     1     2      3
##  3     1     3      2
##  4     1     4      2
##  5     1     5     11
##  6     1     6      3
##  7     1     7      3
##  8     1     8      7
##  9     1     9      6
## 10     1    10      9
## # ℹ 277 more rows
## ----function_help, eval=FALSE----------------------------------------------
## ?tbl_graph


## ----create-edgelist--------------------------------------------------------
student_network <- tbl_graph(edges = student_edges, # specifies edges
                             nodes = student_attributes, # specifies nodes
                             directed = TRUE) # specifies directionality

student_network
## # A tbl_graph: 27 nodes and 287 edges
## #
## # A directed multigraph with 2 components
## #
## # A tibble: 27 × 5
##      id gender achievement gender_num achievement_num
##   <dbl> <chr>  <chr>            <dbl>           <dbl>
## 1     1 female high                 1               1
## 2     2 male   average              0               2
## 3     3 female average              1               2
## 4     4 male   high                 0               1
## 5     5 female average              1               2
## 6     6 female average              1               2
## # ℹ 21 more rows
## #
## # A tibble: 287 × 3
##    from    to weight
##   <int> <int>  <dbl>
## 1     1     1     13
## 2     1     2      3
## 3     1     3      2
## # ℹ 284 more rows
## ----teacher-network--------------------------------------------------------
# YOUR CODE HERE

teacher_network <- as_tbl_graph(teacher_friends,
                                directed = TRUE)

teacher_edges <- teacher_network |>
  activate(edges) |>
  as_tibble()

teacher_network <- tbl_graph(edges = teacher_edges, 
                             nodes = student_attributes, 
                             directed = TRUE)

teacher_network
## # A tbl_graph: 27 nodes and 70 edges
## #
## # A directed multigraph with 9 components
## #
## # A tibble: 27 × 5
##      id gender achievement gender_num achievement_num
##   <dbl> <chr>  <chr>            <dbl>           <dbl>
## 1     1 female high                 1               1
## 2     2 male   average              0               2
## 3     3 female average              1               2
## 4     4 male   high                 0               1
## 5     5 female average              1               2
## 6     6 female average              1               2
## # ℹ 21 more rows
## #
## # A tibble: 70 × 3
##    from    to weight
##   <int> <int>  <dbl>
## 1     1     1      3
## 2     1     5      2
## 3     1    12      1
## # ℹ 67 more rows
## ----plot-network-----------------------------------------------------------
plot(student_network)

## ----auto-graph-------------------------------------------------------------
autograph(student_network)

## ----student-sociogram------------------------------------------------------
autograph(student_network,
          node_label = id,
          node_colour = gender)

## ----teacher-sociogram------------------------------------------------------
# YOUR CODE HERE
plot(teacher_network)

## ----ggraph-----------------------------------------------------------------
ggraph(student_network)
## Using "stress" as default layout

## ----add-nodes--------------------------------------------------------------
# YOUR CODE HERE
ggraph(student_network) +
  geom_node_point()
## Using "stress" as default layout

## ----add-layout-------------------------------------------------------------
ggraph(student_network, layout = "fr") +
  geom_node_point()

## ----add-color--------------------------------------------------------------
ggraph(student_network, layout = "stress") + 
geom_node_point(aes(color = gender,
                    size = local_size()))

## ----add-labels-------------------------------------------------------------
ggraph(student_network, layout = "stress") + 
  geom_node_point(aes(size = local_size(),
                      color = gender)) +
  geom_node_text(aes(label = id,
                     size = local_size()),
                 repel = TRUE)

## ---------------------------------------------------------------------------
ggraph(student_network, layout = "stress") + 
  geom_node_point(aes(size = local_size(),
                      color = gender)) +
  geom_node_text(aes(label = id),
                 repel=TRUE) +
  geom_edge_link()
## Warning: Using the `size` aesthetic in this geom was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` in the `default_aes` field and elsewhere instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.

## ----tweak-edges------------------------------------------------------------
ggraph(student_network, layout = "stress") + 
  geom_node_point(aes(size = local_size(),
                      color = gender)) +
  geom_node_text(aes(label = id),
                 repel=TRUE) +
  geom_edge_link(arrow = arrow(length = unit(1, 'mm')), 
                 end_cap = circle(3, 'mm'),
                 start_cap = circle(3, 'mm'),
                 alpha = .2)

## ----add-theme--------------------------------------------------------------
ggraph(student_network, layout = "stress") + 
  geom_edge_link(arrow = arrow(length = unit(1, 'mm')), 
                 end_cap = circle(3, 'mm'),
                 start_cap = circle(3, 'mm'),
                 alpha = .1) +
  geom_node_point(aes(size = local_size(),
                      color = gender)) +
  geom_node_text(aes(label = id),
                 repel=TRUE) +
  theme_graph()

## ----your-sociogram---------------------------------------------------------
# YOUR CODE HERE
ggraph(student_network, layout = 'dendrogram', circular = TRUE) + 
  geom_edge_diagonal() + 
  geom_node_point(aes(filter = leaf)) + 
  coord_fixed() +
   geom_node_point(aes(size = local_size(),
                      color = gender))
## Multiple parents. Unfolding graph

Narrative

To be honest, I played around a lot (too much) with the fancy layouts offered in the hyperlinks. In doing so, I created a not-so-great visual representation of the dataset for the purposes outlined in the task. I chose to use a “dendogram” layout with a “leaf” setting for the node points. This ultimately created a beautiful flower-looking representation color-coded by gender as the original code had. The problem with this approach was that I sacrificed interpretability for jazzy aesthetics.

This task asked me to interpret the results. This representation shows a female with a large local size at the center of the flower; initially, I thought this was presumably the teacher. But, I never read the teacher data into the code, so this central node is one highly connected student. Spinning out from that person are what appears to be 26 edges to 26 nodes (the other students). The petals of the network were varying sizes according to the number of directional connections were made with each of the individual 27 students. So, one petal might have been formed by 10 ties while a different petal was formed by 8 ties or less.

In reality, I would NOT choose this layout for the purposes of this study, but for the purposes of learning how to find and use other layouts, my mission was accomplished.

To receive credit for this assignment and earn your first SNA LASER Badge, you will first need to knit and publish this page to Posit Cloud. Next, share the link to published webpage under one of the Badge Artifact columns on the 2023 LASER Scholar Information and Documents spreadsheet: https://go.ncsu.edu/laser-sheet. Once your instructor has checked your link, you will be provided a physical version of the badge pictured at the top of this document!