As researchers increasingly opt for online data collection for social
network projects, they may find programming the survey and downloading
the data from that survey challenging. So, we’ve developed the following
tutorial to make the process between data collection with Qualtrics and
data analysis with
egor more seamless. If you have any
questions or suggestions please open an issue on
github or send an
While details will differ the same general logic described here can be applied to other survey platforms, as RedCap, ScoSci Survey, etc.
When conducting ego-centered network surveys some practices have proven to decrease drop-out rates and increase the quality of the collected data. Some of the items listed below apply to any kind of survey, while others are specific to ego-centered network data collection.
egor includes three template files for Qualtrics
You can download the template that best fits your needs, import it into Qualtrics and build upon it, to create your own survey. To download right-click on the link above and select “Save link as…” (or similar).
In this section we describe the logic behind the fixed-choice template, the following section describes the changes necessary to allow the participants free-choice of the number of named alters.
Ego Attributes: The ego attributes are usually collected before the name generator. You can do it after as well or both. These survey items are regular questions about the participants themselves, therefore we won’t further explain how to set this up.
Name Generator: This section can be customized, but there are two things to keep in mind. First, if you increase the number of requested alters (the template currently has slots for 5 alters), you will need to increase the number of alter attribute question blocks and alter-alter tie questions to match. Second, because this is the fixed choice template, this alter list requires that participants enter an alter for each slot to continue.
This section can be customized to change the number of questions about each alter and to change the wording and response style of each question. Like a standard survey—all other Qualtrics programming should work for the alter attribute questions. If you require more than 5 alters, you will need add as many blocks of alter attribute questions as alters listed (e.g., 10 alters listed would need 10 blocks of alter attribute questions). We recommend finalizing question wording and format in Block 1 of alter attribute questions and copying that block for as many alters as requested in the list. Then, in each block, adjust the code for the piped text so that it refers to the appropriate list slot (e.g., Block 2 of alter attribute questions should pipe the response to the second list slot from the alter list).
Here we describe survey display logic changes necessary to allow the participants to chose themselves how many alters they name. While there will always be an upper limit of alters that can be named, by selecting a very high number for this, you can make sure that the participants can name all the alters they want. At the same time a high maximum number will also lead to a significant amount of additional work for the survey creation. Also with each additional alter named the participant will have to respond to more alter attribute and alter-alter questions.
Ego Attributes: No changes needed here.
Name Generator: To give participants the option to leave some names in the alter list blank, you will have to skip/delete the Custom Validations which check that the name fields contain names.
Alter Attributes: Because this is the free choice format, you will want to display only the same number alter attribute blocks as alters listed in the alter list. Thus, you will need to employ display logic using the Survey Flow tab in Qualtrics to define the conditions of when to display each alter attribute block.\
Alter-Alter Ties. Add Display logic to each alter-alter pair question that will hide questions if one of the alters to which the question refers is left blank. We recommend preparing and finalizing one alter-alter tie question including the Display Logic and then copy this question as many times as needed and adjust only the piped text and Display Logic for each alter-alter combination.
egorobject with the code below.
qu_data <- read.csv(file = "filename.csv") # Replace file name with full data set name!
<- qu_data[3:nrow(qu_data),] qu_data # Create egoID $egoID <- 1:nrow(qu_data) qu_data library(egor) <- onefile_to_egor(egos = qu_data, e1 ID.vars = list(ego = "egoID"), attr.start.col = "A1Gender", # Name of Variable with the first alter attribute attr.end.col = "X5.5", # Name of variable with last alter attribute max.alters = 5, # Number of maximum alters that were named by participants aa.first.var = "AP1") # Name of first alter-alter variable #> Sorting data by egoID: #> Done. #> Transforming alters data to long format: #> Done. #> Transforming wide dyad data to edgelist: #> Done. #> Note: Make sure to filter out alter-alter ties with invalid weight values. #> Warning in onefile_to_egor(egos = qu_data, ID.vars = list(ego = "egoID"), : No #> netsize values provided, make sure to filter out invalid alter entries.
We need to filter out entries for alters left blank by respondents because the survey is structured so that each possible alter has an entry. This step is technically not necessary if you are certain that all respondents have named the maximum number of alters.
The logic behind this step is to first create a
logical vector that marks each alter as
(= exists) if the name cell for that alter is not empty and and as
FALSE if it is empty. Next this
is applied to the alter dataset in the
egor object to
filter out all empty alter entries.
<- alter_filter %>% e1 as_tibble() %>% arrange(.egoID) %>% select(AlterList_1:AlterList_5) %>% mutate(across(.fns = ~. != "")) %>% as.data.frame() %>% ::pivot_longer(cols = everything()) %>% tidyrpull(value) <- e1 %>% e1 activate(alter) %>% filter(alter_filter)
Similar to the alter data the alter-alter ties contain rows that represent ties between alters that might not exist. These can be filtered out by excluding all rows/ alter-alter ties with an empty weight variable.
<- e1 %>% e1 activate(aatie) %>% filter(weight != "")
e1#> # EGO data: 5 × 28 #> .egoID StartD…¹ EndDate Status IPAdd…² Progr…³ Durat…⁴ Finis…⁵ Recor…⁶ Respo…⁷ #> * <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 1 2021-03… 2021-0… Surve… "" 100 0 True 2021-0… R_2Ybp… #> 2 2 2021-03… 2021-0… Surve… "" 100 0 True 2021-0… R_3I9S… #> 3 3 2021-03… 2021-0… Surve… "" 100 0 True 2021-0… R_pggy… #> # … with 2 more rows, 18 more variables: RecipientLastName <chr>, #> # RecipientFirstName <chr>, RecipientEmail <chr>, ExternalReference <chr>, #> # LocationLatitude <chr>, LocationLongitude <chr>, DistributionChannel <chr>, #> # UserLanguage <chr>, ZipCode <chr>, AlterList_1 <chr>, AlterList_2 <chr>, #> # AlterList_3 <chr>, AlterList_4 <chr>, AlterList_5 <chr>, ID <chr>, #> # Q_TotalDuration <chr>, gc <chr>, term <chr>, and abbreviated variable names #> # ¹StartDate, ²IPAddress, ³Progress, ⁴Duration..in.seconds., ⁵Finished, … #> # ALTER data: 7 × 8 #> .altID .egoID A1Gender A1age A1rel…¹ A1Loc…² A1Loc…³ A1Close #> * <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 1 4 Choose Not to Respond Choose No… Other ad "asd" Very c… #> 2 2 4 Female 40-49 Spouse asd "asd" Not cl… #> 3 1 5 Choose Not to Respond 31-39 School asd "" Somewh… #> # … with 4 more rows, and abbreviated variable names ¹A1relation, #> # ²A1Location_1, ³A1Location_2 #> # AATIE data (active): 11 × 4 #> .egoID .srcID .tgtID weight #> * <chr> <chr> <chr> <chr> #> 1 4 1 2 Maybe #> 2 5 1 2 Yes #> 3 5 1 3 Maybe #> 4 5 1 4 No #> 5 5 1 5 Maybe #> # … with 6 more rows summary(e1) #> 5 Egos/ Ego Networks #> 7 Alters #> Min. Netsize 2 #> Average Netsize 3.5 #> Max. Netsize 5 #> Average Density 1 #> Alter survey design: #> Maximum nominations: 5