knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
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 email.
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 surveys:
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.
{width="700"}
egor
egor
object with the code below.qu_data <- read.csv(system.file("qualtrics", "qualtrics_responses.csv", package = "egor"))
qu_data <- read.csv(file = "filename.csv") # Replace file name with full data set name!
qu_data <- qu_data[3:nrow(qu_data),] # Create egoID qu_data$egoID <- 1:nrow(qu_data) library(egor) e1 <- onefile_to_egor(egos = qu_data, 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
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 TRUE
(= exists) if the name cell for that alter is not empty and and as FALSE
if it is empty. Next this logical vector
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() %>% tidyr::pivot_longer(cols = everything()) %>% pull(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 != "")
egor
object. e1
summary(e1)
egor
.Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.