2.1 Main questionnaire
2.1.1 Please indicate on the map your place of residence
home_location <- locations[locations$location_category == 1, ]
## version ggmap
van_aoi <- st_bbox(home_location)
names(van_aoi) <- c("left", "bottom", "right", "top")
van_aoi[["left"]] <- van_aoi[["left"]] - .07
van_aoi[["right"]] <- van_aoi[["right"]] + .07
van_aoi[["top"]] <- van_aoi[["top"]] + .01
van_aoi[["bottom"]] <- van_aoi[["bottom"]] - .01
bm <- get_stadiamap(van_aoi, zoom = 11, maptype = "stamen_toner_lite") %>%
ggmap(extent = "device")
bm + geom_sf(data = st_jitter(home_location, .008), inherit.aes = FALSE, color = "blue", size = 1.8, alpha = .3)

NB: Home locations have been randomly shifted from their original position to protect privacy.
# Number of participants by municipalites
home_by_municipalites <- st_join(home_location, municipalities["NAME"])
home_by_mun_cnt <- as.data.frame(home_by_municipalites) %>%
group_by(NAME) %>%
dplyr::count() %>%
arrange(desc(n), NAME)
home_by_mun_cnt$Shape <- NULL
kable(home_by_mun_cnt, caption = "Number of participants by municipalities") %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
| NAME | n |
|---|---|
| Vancouver | 48 |
| Surrey | 1 |
2.1.2 Are you currently working?
# extract and recode
.work <- veritas_main[c("interact_id", "working")] %>% dplyr::rename(working_code = working)
.work$working <- factor(ifelse(.work$working_code == 1, "1 [Yes]",
ifelse(.work$working_code == 2, "2 [No]", "N/A")
))
# histogram of answers
ggplot(data = .work) +
geom_histogram(aes(x = working), stat = "count") +
scale_x_discrete(labels = function(lbl) str_wrap(lbl, width = 20)) +
labs(x = "working")

.work_cnt <- .work %>%
group_by(working) %>%
dplyr::count() %>%
arrange(working)
kable(.work_cnt, caption = "Currently working") %>%
kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
| working | n |
|---|---|
| 1 [Yes] | 40 |
| 2 [No] | 9 |
2.1.3 Do you work…
# extract and recode
.work <- veritas_main[c("interact_id", "working_home")] %>% dplyr::rename(working_code = working_home)
.work$working <- factor(ifelse(.work$working_code == 1, "1 [From home only]",
ifelse(.work$working_code == 2, "2 [Both from home and away from home]",
ifelse(.work$working_code == 3, "3 [Away from home only]", "N/A"))
))
# histogram of answers
ggplot(data = .work) +
geom_histogram(aes(x = working), stat = "count") +
scale_x_discrete(labels = function(lbl) str_wrap(lbl, width = 20)) +
labs(x = "working")

.work_cnt <- .work %>%
group_by(working) %>%
dplyr::count() %>%
arrange(working)
kable(.work_cnt, caption = "I work...") %>%
kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
| working | n |
|---|---|
| 1 [From home only] | 2 |
| 2 [Both from home and away from home] | 26 |
| 3 [Away from home only] | 12 |
| N/A | 9 |
2.1.4 Where do you work?
work_location <- locations[locations$location_category == 3, ]
bm + geom_sf(data = work_location, inherit.aes = FALSE, color = "blue", size = 1.8, alpha = .3)

2.1.5 Are you currently a registered student?
# extract and recode
.study <- veritas_main[c("interact_id", "studying")] %>% dplyr::rename(studying_code = studying)
.study$studying <- factor(ifelse(.study$studying_code == 1, "1 [Yes]",
ifelse(.study$studying_code == 2, "2 [No]", "N/A")
))
# histogram of answers
ggplot(data = .study) +
geom_histogram(aes(x = studying), stat = "count") +
scale_x_discrete(labels = function(lbl) str_wrap(lbl, width = 20)) +
labs(x = "Studying")

.study_cnt <- .study %>%
group_by(studying) %>%
dplyr::count() %>%
arrange(studying)
kable(.study_cnt, caption = "Currently studying") %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
| studying | n |
|---|---|
| 1 [Yes] | 12 |
| 2 [No] | 37 |
2.1.6 Do you study…
# extract and recode
.work <- veritas_main[c("interact_id", "studying_home")] %>% dplyr::rename(studying_code = studying_home)
.work$studying <- factor(ifelse(.work$studying_code == 1, "1 [From home only]",
ifelse(.work$studying_code == 2, "2 [Both from home and away from home]",
ifelse(.work$studying_code == 3, "3 [Away from home only]", "N/A"))
))
# histogram of answers
ggplot(data = .work) +
geom_histogram(aes(x = studying), stat = "count") +
scale_x_discrete(labels = function(lbl) str_wrap(lbl, width = 20)) +
labs(x = "studying")

.work_cnt <- .work %>%
group_by(studying) %>%
dplyr::count() %>%
arrange(studying)
kable(.work_cnt, caption = "I study...") %>%
kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
| studying | n |
|---|---|
| 1 [From home only] | 4 |
| 2 [Both from home and away from home] | 6 |
| 3 [Away from home only] | 2 |
| N/A | 37 |
2.1.7 Where do you study?
study_location <- locations[locations$location_category == 4, ]
bm + geom_sf(data = study_location, inherit.aes = FALSE, color = "blue", size = 1.8, alpha = .3)

2.1.8 Did you go food shopping at least once in the past month?
# extract and recode
.transp <- veritas_main[c("interact_id", "shopping")] %>% dplyr::rename(shopping_code = shopping)
.transp$shopping <- factor(ifelse(.transp$shopping_code == 1, "1 [Yes]",
ifelse(.transp$shopping_code == 2, "2 [No]", "N/A")
))
# histogram of answers
ggplot(data = .transp) +
geom_histogram(aes(x = shopping), stat = "count") +
scale_x_discrete(labels = function(lbl) str_wrap(lbl, width = 20)) +
labs(x = "shopping")

.transp_cnt <- .transp %>%
group_by(shopping) %>%
dplyr::count() %>%
arrange(shopping)
kable(.transp_cnt) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
| shopping | n |
|---|---|
| 1 [Yes] | 49 |
2.1.9 Please list the places where you shopped for food in the past month
The following location types are grouped under this question:
- Grocery store
- Market
- Bakery
- Specialty store
- Convenience store
- Other shopping location
NB Contrary to previous waves, SAQ/liquor store is not listed among the choices.
shop_lut <- data.frame(
location_category_code = c(5, 6, 7, 8, 9, 10),
location_category = factor(c(
" 5 [Supermarket]",
" 6 [Public/farmer’s market]",
" 7 [Bakery]",
" 8 [Specialty food store]",
" 9 [Convenience store/Dépanneur]",
"10 [Liquor store/SAQ]"
))
)
shop_location <- locations[locations$location_category %in% shop_lut$location_category_code, ] %>%
dplyr::rename(location_category_code = location_category) %>%
inner_join(shop_lut, by = "location_category_code")
# map
bm + geom_sf(data = shop_location, inherit.aes = FALSE, aes(color = location_category), size = 1.5, alpha = .3) +
scale_color_brewer(palette = "Accent") +
theme(legend.position = "bottom", legend.text = element_text(size = 8), legend.title = element_blank())

# compute number of shopping locations by category
ggplot(data = shop_location) +
geom_histogram(aes(x = location_category), stat = "count") +
scale_x_discrete(labels = function(lbl) str_wrap(lbl, width = 20)) +
labs(x = "Shopping locations by categories")

.location_category_cnt <- as.data.frame(shop_location[c("location_category")]) %>%
group_by(location_category) %>%
dplyr::count() %>%
arrange(location_category)
kable(.location_category_cnt, caption = "Shopping locations by categories") %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
| location_category | n |
|---|---|
| 5 [Supermarket] | 112 |
| 6 [Public/farmer’s market] | 17 |
| 7 [Bakery] | 8 |
| 8 [Specialty food store] | 6 |
| 9 [Convenience store/Dépanneur] | 6 |
# compute statistics on shopping locations by participants and categories
# > one needs to account for participants who did not report location for some categories
.loc_iid_category_cnt <- as.data.frame(shop_location[c("interact_id", "location_category")]) %>%
group_by(interact_id, location_category) %>%
dplyr::count()
# (cont'd) simulate SQL JOIN TABLE ON TRUE to build list of all combination iid/shopping categ
.dummy <- data_frame(
interact_id = character(),
location_category = character()
)
for (iid in as.vector(veritas_main$interact_id)) {
.dmy <- data_frame(
interact_id = as.character(iid),
location_category = shop_lut$location_category
)
.dummy <- rbind(.dummy, .dmy)
}
# (cont'd) find iid/categ combination without match in veritas locations
.no_shop_iid <- dplyr::setdiff(.dummy, .loc_iid_category_cnt[c("location_category", "interact_id")]) %>%
mutate(n = 0)
.loc_iid_category_cnt <- bind_rows(.loc_iid_category_cnt, .no_shop_iid)
.location_category_cnt <- .loc_iid_category_cnt %>%
group_by(location_category) %>%
dplyr::summarise(min = min(n), mean = round(mean(n), 2), median = median(n), max = max(n)) %>%
arrange(location_category)
kable(.location_category_cnt, caption = "Number of shopping locations by participant and category") %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
| location_category | min | mean | median | max |
|---|---|---|---|---|
| 5 [Supermarket] | 1 | 2.29 | 2 | 6 |
| 6 [Public/farmer’s market] | 0 | 0.35 | 0 | 2 |
| 7 [Bakery] | 0 | 0.16 | 0 | 2 |
| 8 [Specialty food store] | 0 | 0.12 | 0 | 2 |
| 9 [Convenience store/Dépanneur] | 0 | 0.12 | 0 | 1 |
| 10 [Liquor store/SAQ] | 0 | 0.00 | 0 | 0 |
2.1.10 Did you visit places to receive services at least once in the past month?
# extract and recode
.transp <- veritas_main[c("interact_id", "services")] %>% dplyr::rename(services_code = services)
.transp$services <- factor(ifelse(.transp$services_code == 1, "1 [Yes]",
ifelse(.transp$services_code == 2, "2 [No]", "N/A")
))
# histogram of answers
ggplot(data = .transp) +
geom_histogram(aes(x = services), stat = "count") +
scale_x_discrete(labels = function(lbl) str_wrap(lbl, width = 20)) +
labs(x = "services")

.transp_cnt <- .transp %>%
group_by(services) %>%
dplyr::count() %>%
arrange(services)
kable(.transp_cnt) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
| services | n |
|---|---|
| 1 [Yes] | 39 |
| 2 [No] | 10 |
2.1.11 Please list the places where you received services in the past month
The following location types are grouped under this question:
- Bank
- Hair salon/barbershop
- Post office
- Drugstore
- Doctor/healthcare provider
- Other service location
serv_lut <- data.frame(
location_category_code = c(11, 12, 13, 14, 15),
location_category = factor(c(
"11 [Bank]",
"12 [Hair salon/barbershop]",
"13 [Post office]",
"14 [Drugstore]",
"15 [Doctor/healthcare provider]"
))
)
serv_location <- locations[locations$location_category %in% serv_lut$location_category_code, ] %>%
dplyr::rename(location_category_code = location_category) %>%
inner_join(serv_lut, by = "location_category_code")
# map
bm + geom_sf(data = serv_location, inherit.aes = FALSE, aes(color = location_category), size = 1.5, alpha = .3) +
scale_color_brewer(palette = "Accent") +
theme(legend.position = "bottom", legend.text = element_text(size = 8), legend.title = element_blank())

# compute number of shopping locations by category
ggplot(data = serv_location) +
geom_histogram(aes(x = location_category), stat = "count") +
scale_x_discrete(labels = function(lbl) str_wrap(lbl, width = 20)) +
labs(x = "Service locations by categories")

.location_category_cnt <- as.data.frame(serv_location[c("location_category")]) %>%
group_by(location_category) %>%
dplyr::count() %>%
arrange(location_category)
kable(.location_category_cnt, caption = "service locations by categories") %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
| location_category | n |
|---|---|
| 11 [Bank] | 11 |
| 12 [Hair salon/barbershop] | 17 |
| 13 [Post office] | 6 |
| 14 [Drugstore] | 20 |
| 15 [Doctor/healthcare provider] | 25 |
# compute statistics on shopping locations by participants and categories
# > one needs to account for participants who did not report location for some categories
.loc_iid_category_cnt <- as.data.frame(serv_location[c("interact_id", "location_category")]) %>%
group_by(interact_id, location_category) %>%
dplyr::count()
# (cont'd) simulate SQL JOIN TABLE ON TRUE
.dummy <- data_frame(
interact_id = character(),
location_category = character()
)
for (iid in as.vector(veritas_main$interact_id)) {
.dmy <- data_frame(
interact_id = as.character(iid),
location_category = serv_lut$location_category
)
.dummy <- rbind(.dummy, .dmy)
}
# (cont'd) find iid/categ combination without match in veritas locations
.no_serv_iid <- dplyr::setdiff(.dummy, .loc_iid_category_cnt[c("location_category", "interact_id")]) %>%
mutate(n = 0)
.loc_iid_category_cnt <- bind_rows(.loc_iid_category_cnt, .no_serv_iid)
.location_category_cnt <- .loc_iid_category_cnt %>%
group_by(location_category) %>%
dplyr::summarise(min = min(n), mean = round(mean(n), 2), median = median(n), max = max(n)) %>%
arrange(location_category)
kable(.location_category_cnt, caption = "Number of service locations by participant and category") %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
| location_category | min | mean | median | max |
|---|---|---|---|---|
| 11 [Bank] | 0 | 0.22 | 0 | 1 |
| 12 [Hair salon/barbershop] | 0 | 0.35 | 0 | 1 |
| 13 [Post office] | 0 | 0.12 | 0 | 1 |
| 14 [Drugstore] | 0 | 0.41 | 0 | 2 |
| 15 [Doctor/healthcare provider] | 0 | 0.51 | 0 | 3 |
2.1.12 Did you visit someone at their home at least once in the past month?
# extract and recode
.transp <- veritas_main[c("interact_id", "visiting_new0_w3")] %>% dplyr::rename(visiting_new0_w3_code = visiting_new0_w3)
.transp$visiting_new0_w3 <- factor(ifelse(.transp$visiting_new0_w3_code == 1, "1 [Yes]",
ifelse(.transp$visiting_new0_w3_code == 2, "2 [No]", "N/A")
))
# histogram of answers
ggplot(data = .transp) +
geom_histogram(aes(x = visiting_new0_w3), stat = "count") +
scale_x_discrete(labels = function(lbl) str_wrap(lbl, width = 20)) +
labs(x = "visiting_new0_w3")

.transp_cnt <- .transp %>%
group_by(visiting_new0_w3) %>%
dplyr::count() %>%
arrange(visiting_new0_w3)
kable(.transp_cnt) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
| visiting_new0_w3 | n |
|---|---|
| 1 [Yes] | 35 |
| 2 [No] | 14 |
2.1.13 Please list the places you visited someone in the past month
visit_location <- locations[locations$location_category == 26, ]
bm + geom_sf(data = st_jitter(visit_location), inherit.aes = FALSE, color = "blue", size = 1.8, alpha = .3)

NB: Visiting locations have been randomly shifted from their original position to protect privacy.
2.1.14 Are there other places you visited in the past month that we have not mentioned?
# extract and recode
.transp <- veritas_main[c("interact_id", "other_w3")] %>% dplyr::rename(other_w3_code = other_w3)
.transp$other_w3 <- factor(ifelse(.transp$other_w3_code == 1, "1 [Yes]",
ifelse(.transp$other_w3_code == 2, "2 [No]", "N/A")
))
# histogram of answers
ggplot(data = .transp) +
geom_histogram(aes(x = other_w3), stat = "count") +
scale_x_discrete(labels = function(lbl) str_wrap(lbl, width = 20)) +
labs(x = "other_w3")

.transp_cnt <- .transp %>%
group_by(other_w3) %>%
dplyr::count() %>%
arrange(other_w3)
kable(.transp_cnt) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
| other_w3 | n |
|---|---|
| 1 [Yes] | 28 |
| 2 [No] | 21 |
2.1.15 Please list the places you visited in the past month
other_location <- locations[locations$location_category == 25, ]
bm + geom_sf(data = other_location, inherit.aes = FALSE, color = "blue", size = 1.8, alpha = .3)

2.1.16 Now, we will ask you questions about the people around you.
# compute statistics on people / participant
# > one needs to account for participants who did not report any group
.pl_iid_cnt <- as.data.frame(people[c("interact_id")]) %>%
group_by(interact_id) %>%
dplyr::count()
# (cont'd) find iid combination without match in veritas group
.no_pl_iid <- anti_join(veritas_main[c("interact_id")], .pl_iid_cnt, by = "interact_id") %>%
mutate(n = 0)
.pl_iid_cnt <- bind_rows(.pl_iid_cnt, .no_pl_iid)
kable(t(as.matrix(summary(.pl_iid_cnt$n))),
caption = "Number of people per participant",
digits = 1
) %>%
kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
| Min. | 1st Qu. | Median | Mean | 3rd Qu. | Max. |
|---|---|---|---|---|---|
| 0 | 3 | 4 | 6.6 | 10 | 24 |
ggplot(data = .pl_iid_cnt) +
geom_histogram(aes(x = n, y = stat(count)), position = "dodge") +
labs(x = "Social network size", fill = element_blank())

2.1.16.1 Please list the people with whom you live
# extract number of household people / participant
.n_household <- household %>% dplyr::count(interact_id)
.n_people <- people %>% dplyr::count(interact_id)
.n_people_imp <- left_join(veritas_main[c("interact_id")], .n_people, by = "interact_id") %>%
left_join(.n_household, by = "interact_id") %>%
mutate_all(~ replace(., is.na(.), 0)) %>%
dplyr::rename(n_people = n.x, n_household = n.y) %>%
mutate(pct = 100 * n_household / n_people)
kable(t(as.matrix(summary(.n_people_imp$n_household))),
caption = "Number of people in household per participant",
digits = 1
) %>%
kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
| Min. | 1st Qu. | Median | Mean | 3rd Qu. | Max. |
|---|---|---|---|---|---|
| 0 | 0 | 1 | 1.4 | 2 | 5 |
kable(t(as.matrix(summary(.n_people_imp$pct))),
caption = "% of people in household among social contact per participant",
digits = 1
) %>%
kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
| Min. | 1st Qu. | Median | Mean | 3rd Qu. | Max. | NA’s |
|---|---|---|---|---|---|---|
| 0 | 0 | 20.7 | 35.9 | 54.2 | 100 | 1 |
2.1.16.2 Please list the people with whom you discuss important matters with (in person, or virtually)
# extract number of important people / participant
.n_important <- important %>% dplyr::count(interact_id)
.n_people <- people %>% dplyr::count(interact_id)
.n_people_imp <- left_join(veritas_main[c("interact_id")], .n_people, by = "interact_id") %>%
left_join(.n_important, by = "interact_id") %>%
mutate_all(~ replace(., is.na(.), 0)) %>%
dplyr::rename(n_people = n.x, n_important = n.y) %>%
mutate(pct = 100 * n_important / n_people)
kable(t(as.matrix(summary(.n_people_imp$n_important))),
caption = "Number of important people per participant",
digits = 1
) %>%
kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
| Min. | 1st Qu. | Median | Mean | 3rd Qu. | Max. |
|---|---|---|---|---|---|
| 0 | 2 | 3 | 4.6 | 6 | 24 |
kable(t(as.matrix(summary(.n_people_imp$pct))),
caption = "% of important people among social contact per participant",
digits = 1
) %>%
kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
| Min. | 1st Qu. | Median | Mean | 3rd Qu. | Max. | NA’s |
|---|---|---|---|---|---|---|
| 0 | 53.4 | 84.5 | 74.3 | 100 | 100 | 1 |





























2.2.5 Social indicators: Alexandre Naud’s toolbox
See Alex’s document for a more comprehensive presentation of the social indicators.
2.2.5.1 Number of people in the network (
people_degree)2.2.5.2 Simmelian Brokerage (
simmelian)2.2.5.3 Number of people with whom the participant like to socialize (
socialize_size)2.2.5.4 Number of people with whom the participant discuss important matters (
important_size)