The INTErventions, Research, and Action in Cities Team (INTERACT) is a national research collaboration of scientists, urban planners, and engaged citizens uncovering how the design of our cities is shaping the health and wellbeing of Canadians (www.teaminteract.ca). INTERACT is conducting longitudinal, mixed-methods natural experiment studies in four Canadian cities, with the aim of providing evidence on the impacts of urban transformations on people’s physical activity, social connectedness, and wellbeing, and inequalities in these outcomes.
The Arbutus Greenway in Vancouver is a 9-km former rail corridor, which is being developed into a continuous walking and cycling corridor connecting South Vancouver to False Creek. Participants who lived in one of the 12 Forward Sortation Area (FSA) within 3 km of the Arbutus Greenway were eligible to participate. Exclusion criteria across all sites were being younger than 18 years old, not being able to read or write English (or English or French in Montreal) well enough to answer an online survey and any intention to move out of the region in the next two years.
Participants were recruited through social media, news media, street and community events outreach, and partner newsletters. Responses were collected between August 26th, 2020 and February 7th, 2021. In Vancouver, 194 returning participants, and 106 new participants completed the Health Questionnaire, for a total of 300 responses.
Section 1: Transportation
What is your main mode of transportation?
#transp_main_mode
var_name <- w2$transp_main_mode2
w2$var_name_f <- recode_factor(var_name, "1" = "Walking / Wheeling (with a mobility assistive device)", "2" = "Biking", "3"= "Public Transit", "4" = "Car", "5"= "Motorcycle or scooter", "6"= "Other")
var_name_f <- w2$var_name_f
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
mutate(pct = round(100*n/sum(n),2))
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat="identity") +
scale_fill_manual(values = INTERACTPaletteSet) +
guides(fill=FALSE) +
ylab("Percent") +
xlab("") +
ggtitle("") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Walking / Wheeling (with a mobility assistive device)
|
110
|
36.67
|
|
Biking
|
49
|
16.33
|
|
Public Transit
|
26
|
8.67
|
|
Car
|
111
|
37.00
|
|
Motorcycle or scooter
|
2
|
0.67
|
|
Other
|
2
|
0.67
|
How much do you enjoy using each transportation mode?
Walking
#preferred_mode_a walking
var_name <- w2$preferred_mode_a2
w2$var_name_f <- recode_factor(var_name, "1" = "1 A lot", "2" = "2", "3" = "3", "4" = "4 Not at all", "5" = "Not applicable")
var_name_f <- w2$var_name_f
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
mutate(pct = round(100*n/sum(n),2))
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat="identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("") +
ggtitle("") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
1 A lot
|
208
|
69.33
|
|
2
|
59
|
19.67
|
|
3
|
19
|
6.33
|
|
4 Not at all
|
3
|
1.00
|
|
Not applicable
|
11
|
3.67
|
Biking
#preferred_mode_b biking
var_name <- w2$preferred_mode_b
w2$var_name_f <- recode_factor(var_name, "1" = "1 A lot", "2" = "2", "3" = "3", "4" = "4 Not at all", "5" = "Not applicable")
var_name_f <- w2$var_name_f
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
mutate(pct = round(100*n/sum(n),2))
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat="identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Percent") +
xlab("") +
ggtitle("") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
1 A lot
|
115
|
38.33
|
|
2
|
50
|
16.67
|
|
3
|
47
|
15.67
|
|
4 Not at all
|
27
|
9.00
|
|
Not applicable
|
61
|
20.33
|
Public transit
#preferred_mode_c public transit
var_name <- w2$preferred_mode_c
w2$var_name_f <- recode_factor(var_name, "1" = "1 A lot", "2" = "2", "3" = "3", "4" = "4 Not at all", "5" = "Not applicable")
var_name_f <- w2$var_name_f
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
mutate(pct = round(100*n/sum(n),2))
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat="identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Percent") +
xlab("") +
ggtitle("") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
1 A lot
|
14
|
4.67
|
|
2
|
42
|
14.00
|
|
3
|
116
|
38.67
|
|
4 Not at all
|
96
|
32.00
|
|
Not applicable
|
32
|
10.67
|
Car
#preferred_mode_d car
var_name <- w2$preferred_mode_d
w2$var_name_f <- recode_factor(var_name, "1" = "1 A lot", "2" = "2", "3" = "3", "4" = "4 Not at all", "5" = "Not applicable")
var_name_f <- w2$var_name_f
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
mutate(pct = round(100*n/sum(n),2))
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat="identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Percent") +
xlab("") +
ggtitle("") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
1 A lot
|
68
|
22.67
|
|
2
|
100
|
33.33
|
|
3
|
95
|
31.67
|
|
4 Not at all
|
12
|
4.00
|
|
Not applicable
|
25
|
8.33
|
Motorcycle or scooter
#preferred_mode_e motorcycle or scooter
var_name <- w2$preferred_mode_e
w2$var_name_f <- recode_factor(var_name, "1" = "1 A lot","2" = "2", "3" = "3", "4" = "4 Not at all", "5" = "Not applicable")
var_name_f <- w2$var_name_f
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
mutate(pct = round(100*n/sum(n),2))
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat="identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Percent") +
xlab("") +
ggtitle("") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
1 A lot
|
7
|
2.33
|
|
2
|
3
|
1.00
|
|
3
|
3
|
1.00
|
|
4 Not at all
|
57
|
19.00
|
|
Not applicable
|
230
|
76.67
|
Thinking of how you felt prior to the COVID-19 pandemic, how much did you enjoy using each transportation mode?
walking
#preferred_mode_a walking
var_name <- w2$preferred_mode_prior_a2
w2$var_name_f <- recode_factor(var_name, "1" = "1 A lot", "2" = "2", "3" = "3","4" = "4 Not at all", "5" = "Not applicable")
var_name_f <- w2$var_name_f
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
mutate(pct = round(100*n/sum(n),2))
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat="identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("") +
ggtitle("") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
1 A lot
|
210
|
70.00
|
|
2
|
59
|
19.67
|
|
3
|
15
|
5.00
|
|
4 Not at all
|
3
|
1.00
|
|
Not applicable
|
13
|
4.33
|
biking
#preferred_mode_b biking
var_name <- w2$preferred_mode_prior_b
w2$var_name_f <- recode_factor(var_name, "1" = "1 A lot", "2" = "2", "3" = "3","4" = "4 Not at all", "5" = "Not applicable")
var_name_f <- w2$var_name_f
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
mutate(pct = round(100*n/sum(n),2))
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat="identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Percent") +
xlab("") +
ggtitle("") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
1 A lot
|
118
|
39.33
|
|
2
|
67
|
22.33
|
|
3
|
34
|
11.33
|
|
4 Not at all
|
18
|
6.00
|
|
Not applicable
|
63
|
21.00
|
public transit
#preferred_mode_c public transit
var_name <- w2$preferred_mode_prior_c
w2$var_name_f <- recode_factor(var_name, "1" = "1 A lot", "2" = "2", "3" = "3", "4" = "4 Not at all", "5" = "Not applicable")
var_name_f <- w2$var_name_f
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
mutate(pct = round(100*n/sum(n),2))
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat="identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Percent") +
xlab("") +
ggtitle("") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
1 A lot
|
58
|
19.33
|
|
2
|
108
|
36.00
|
|
3
|
72
|
24.00
|
|
4 Not at all
|
43
|
14.33
|
|
Not applicable
|
19
|
6.33
|
car
#preferred_mode_d car
var_name <- w2$preferred_mode_prior_d
w2$var_name_f <- recode_factor(var_name, "1" = "1 A lot", "2" = "2", "3" = "3", "4" = "4 Not at all", "5" = "Not applicable")
var_name_f <- w2$var_name_f
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
mutate(pct = round(100*n/sum(n),2))
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat="identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Percent") +
xlab("") +
ggtitle("") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
1 A lot
|
74
|
24.67
|
|
2
|
104
|
34.67
|
|
3
|
82
|
27.33
|
|
4 Not at all
|
16
|
5.33
|
|
Not applicable
|
24
|
8.00
|
motorcycle or scooter
#preferred_mode_e motorcycle or scooter
var_name <- w2$preferred_mode_prior_e
w2$var_name_f <- recode_factor(var_name, "1" = "1 A lot", "2" = "2", "3" = "3", "4" = "4 Not at all", "5" = "Not applicable")
var_name_f <- w2$var_name_f
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
mutate(pct = round(100*n/sum(n),2))
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat="identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Percent") +
xlab("") +
ggtitle("") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
1 A lot
|
6
|
2
|
|
2
|
3
|
1
|
|
3
|
3
|
1
|
|
4 Not at all
|
39
|
13
|
|
Not applicable
|
249
|
83
|
Do you have access to a car?
var_name <- w2$car_access
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPaletteYN) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Yes
|
265
|
88.33
|
|
No
|
35
|
11.67
|
Do you have access to a bicycle?
#bike_access
var_name <- w2$bike_access
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(var_name_f, y= pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPaletteYN) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Yes
|
235
|
78.33
|
|
No
|
65
|
21.67
|
On a scale of 1 to 5, with 1 being ‘very safe’ and 5 being ‘very dangerous’, overall, how safe do you think cycling is in your city?
#bike_safety
var_name <- w2$bike_safety
w2$var_name_f <- recode_factor(var_name, "1" = "Very safe", "2" = "Somewhat safe", "3" = "Neither safe nor unsafe", "4" = "Somewhat dangerous", "5" = "Very dangerous", "77" = "I don't know/prefer not to say")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Very safe
|
50
|
16.67
|
|
Somewhat safe
|
156
|
52.00
|
|
Neither safe nor unsafe
|
31
|
10.33
|
|
Somewhat dangerous
|
58
|
19.33
|
|
Very dangerous
|
3
|
1.00
|
|
I don’t know/prefer not to say
|
2
|
0.67
|
Have you ever heard of the Arbutus Greenway?
#ag_familiarty
var_name <- w2$ag_familiarity
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPaletteYN) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Yes
|
298
|
99.33
|
|
No
|
2
|
0.67
|
Do you think that the Arbutus Greenway is a good or bad idea for Vancouver? It is a…
var_name <- w2$ag_idea
w2$var_name_f <- recode_factor(var_name, "1" = "Very good idea", "2" = "Somewhat good idea", "3" = "Somewhat bad idea", "4" = "Very bad idea", "77" = "I don't know")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Very good idea
|
278
|
92.67
|
|
Somewhat good idea
|
17
|
5.67
|
|
Somewhat bad idea
|
3
|
1.00
|
|
I don’t know
|
2
|
0.67
|
Have you ever used the Arbutus Greenway?
#ag_used_ever
var_name <- w2$ag_used_ever
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPaletteYN) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Yes
|
284
|
94.67
|
|
No
|
16
|
5.33
|
How often do you typically travel by bicycle along the Arbutus Greenway during each season?
# ag_bike_freq_a
w2$ag_bike_freq_a[w2$ag_bike_freq_a==-7] <- NA
w2$ag_bike_freq_b[w2$ag_bike_freq_b==-7] <- NA
w2$ag_bike_freq_c[w2$ag_bike_freq_c==-7] <- NA
w2$ag_bike_freq_d[w2$ag_bike_freq_d==-7] <- NA
fall <- ggplot(w2, aes(x = w2$ag_bike_freq_a)) + geom_histogram (na.rm = TRUE, binwidth = 5, fill="#BF5B04") + xlab("Times in the fall") + facet_wrap(~ compare)
winter <- ggplot(w2, aes(x = w2$ag_bike_freq_b)) + geom_histogram (na.rm = TRUE, binwidth = 5, fill="#35AAF2") + xlab("Times in the winter")+ facet_wrap(~ compare)
spring <- ggplot(w2, aes(x = w2$ag_bike_freq_c)) + geom_histogram (na.rm = TRUE, binwidth = 5, fill="#76D24A") + xlab("Times in the spring")+ facet_wrap(~ compare)
summer <- ggplot(w2, aes(x = w2$ag_bike_freq_d)) + geom_histogram (na.rm = TRUE, binwidth = 5, fill="#F2B705") + xlab("Times in the summer")+ facet_wrap(~ compare)
grid.arrange(fall,winter,spring,summer)

How do you usually get to the Arbutus Greenway?
#intercept_ag_mode
w2$intercept_ag_mode2[w2$intercept_ag_mode2==-7] <- NA
var_name <- w2$intercept_ag_mode2
w2$var_name_f <- recode_factor(var_name, "1" = "Walking", "2" = "Running/Jogging", "3"= "Biking", "4" = "Public Transit", "5"= "Car", "6"= "Motorcycle or scooter", "7" ="Other")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalettecont) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Walking
|
148
|
49.33
|
|
Running/Jogging
|
14
|
4.67
|
|
Biking
|
105
|
35.00
|
|
Public Transit
|
3
|
1.00
|
|
Car
|
9
|
3.00
|
|
Other
|
5
|
1.67
|
|
NA
|
16
|
5.33
|
What is your usual reason for using the Arbutus Greenway?
# intercept_ag_reason
w2$intercept_ag_reason[w2$intercept_ag_reason==-7] <- NA
var_name <- w2$intercept_ag_reason
w2$var_name_f <- recode_factor(var_name, "1" = "For recreation", "2" = "For transportation", "3" = "Both for recreation and transportation")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPaletteYN) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
For recreation
|
106
|
35.33
|
|
For transportation
|
35
|
11.67
|
|
Both for recreation and transportation
|
143
|
47.67
|
|
NA
|
16
|
5.33
|
In your opinion, the maintenance of the Arbutus Greenway is excellent, good, fair, or poor?
## intercept_ag_maintenance
w2$intercept_ag_maintenance[w2$intercept_ag_maintenance==-7] <- NA
var_name <- w2$intercept_ag_maintenance
w2$var_name_f <- recode_factor(var_name, "1" = "Excellent", "2" = "Good", "3" = "Fair", "4" ="Poor", "77" = "I don't know")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Excellent
|
134
|
44.67
|
|
Good
|
126
|
42.00
|
|
Fair
|
20
|
6.67
|
|
Poor
|
1
|
0.33
|
|
I don’t know
|
3
|
1.00
|
|
NA
|
16
|
5.33
|
How safe do you feel travelling along the Arbutus Greenway in terms of
safety from traffic?
#intercept_ag_safety_traffic
w2$intercept_ag_safety_traffic[w2$intercept_ag_safety_traffic==-7] <- NA
var_name <- w2$intercept_ag_safety_traffic
w2$var_name_f <- recode_factor(var_name, "1" = "Very safe", "2" = "Somewhat safe", "3" = "Neither safe nor unsafe", "4" ="Somewhat unsafe", "5" = "Very unsafe" , "77" = "I don't know")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Very safe
|
186
|
62.00
|
|
Somewhat safe
|
82
|
27.33
|
|
Neither safe nor unsafe
|
9
|
3.00
|
|
Somewhat unsafe
|
6
|
2.00
|
|
Very unsafe
|
1
|
0.33
|
|
NA
|
16
|
5.33
|
personal safety?
#intercept_ag_safety_personal
w2$intercept_ag_safety_personal[w2$intercept_ag_safety_personal==-7] <- NA
w2$intercept_ag_safety_traffic[w2$intercept_ag_safety_personal==-7] <- NA
var_name <- w2$intercept_ag_safety_personal
w2$var_name_f <- recode_factor(var_name, "1" = "Very safe", "2" = "Somewhat safe", "3" = "Neither safe nor unsafe", "4" ="Somewhat unsafe", "5" = "Very unsafe" , "77" = "I don't know")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Very safe
|
191
|
63.67
|
|
Somewhat safe
|
81
|
27.00
|
|
Neither safe nor unsafe
|
7
|
2.33
|
|
Somewhat unsafe
|
4
|
1.33
|
|
I don’t know
|
1
|
0.33
|
|
NA
|
16
|
5.33
|
Are you using the Arbutus Greenway (walking, biking, etc.) more, less, or the same since spring 2017?
#intercept_ag_spring
w2$intercept_ag_spring2[w2$intercept_ag_spring2==-7] <- NA
var_name <- w2$intercept_ag_spring2
w2$var_name_f <- recode_factor(var_name, "1" = "More", "2" = "Same", "3" = "Less", "77" = "I don't know")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
More
|
137
|
45.67
|
|
Same
|
93
|
31.00
|
|
Less
|
50
|
16.67
|
|
I don’t know
|
4
|
1.33
|
|
NA
|
16
|
5.33
|
Do you plan to use the Arbutus Greenway in the future?
# intercept_ag_future
var_name <- w2$intercept_ag_future
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPaletteYN) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Yes
|
295
|
98.33
|
|
No
|
5
|
1.67
|
Would any of the following amenities encourage you to use the Arbutus Greenway more? Check ALL that apply.
New participants
*Participants could choose many options. Count is number of times option was selected.
# 1 Recycling or waste receptacles/garbage cans
# 2 Benches
# 3 Bathrooms
# 4 Lighting
# 5 Water fountains
# 6 Picnic areas
# 7 Playgrounds
# 8 Mobi stations
# 9 Public art
# 10 Shady zones
# 99 Other (Please specify)
# -7 Not applicable
#new
intercept_ag_amenities_1 <- as.numeric(table(new$intercept_ag_amenities_1[new$intercept_ag_amenities_1==1]))
intercept_ag_amenities_2 <- as.numeric(table(new$intercept_ag_amenities_2[new$intercept_ag_amenities_2==1]))
intercept_ag_amenities_3 <- as.numeric(table(new$intercept_ag_amenities_3[new$intercept_ag_amenities_3==1]))
intercept_ag_amenities_4 <- as.numeric(table(new$intercept_ag_amenities_4[new$intercept_ag_amenities_4==1]))
intercept_ag_amenities_5 <- as.numeric(table(new$intercept_ag_amenities_5[new$intercept_ag_amenities_5==1]))
intercept_ag_amenities_6 <- as.numeric(table(new$intercept_ag_amenities_6[new$intercept_ag_amenities_6==1]))
intercept_ag_amenities_7 <- as.numeric(table(new$intercept_ag_amenities_7[new$intercept_ag_amenities_7==1]))
intercept_ag_amenities_8 <- as.numeric(table(new$intercept_ag_amenities_8[new$intercept_ag_amenities_8==1]))
intercept_ag_amenities_9 <- as.numeric(table(new$intercept_ag_amenities_9[new$intercept_ag_amenities_9==1]))
intercept_ag_amenities_10 <- as.numeric(table(new$intercept_ag_amenities_10[new$intercept_ag_amenities_10==1]))
intercept_ag_amenities_99 <- as.numeric(table(new$intercept_ag_amenities_99[new$intercept_ag_amenities_99==1]))
amenities_new <- data.frame(Response = c("Recycling or waste receptacles/garbage cans",
"Benches",
"Bathrooms",
"Lighting",
"Water fountains",
"Picnic areas",
"Playgrounds",
"Mobi Stations",
"Public art",
"Shady zones",
"Other"),
Frequency= c(intercept_ag_amenities_1 ,intercept_ag_amenities_2 ,intercept_ag_amenities_3 ,intercept_ag_amenities_4 ,intercept_ag_amenities_5 ,intercept_ag_amenities_6 ,intercept_ag_amenities_7 ,intercept_ag_amenities_8 ,intercept_ag_amenities_9 ,intercept_ag_amenities_10,intercept_ag_amenities_99))
kable(amenities_new) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
Response
|
Frequency
|
Recycling or waste receptacles/garbage cans
|
46
|
Benches
|
50
|
Bathrooms
|
51
|
Lighting
|
66
|
Water fountains
|
37
|
Picnic areas
|
42
|
Playgrounds
|
18
|
Mobi Stations
|
3
|
Public art
|
45
|
Shady zones
|
37
|
Other
|
15
|
Returning participants
*Participants could choose many options. Count is number of times option was selected.
#returning
intercept_ag_amenities_1 <- as.numeric(table(ret$intercept_ag_amenities_1[ret$intercept_ag_amenities_1==1]))
intercept_ag_amenities_2 <- as.numeric(table(ret$intercept_ag_amenities_2[ret$intercept_ag_amenities_2==1]))
intercept_ag_amenities_3 <- as.numeric(table(ret$intercept_ag_amenities_3[ret$intercept_ag_amenities_3==1]))
intercept_ag_amenities_4 <- as.numeric(table(ret$intercept_ag_amenities_4[ret$intercept_ag_amenities_4==1]))
intercept_ag_amenities_5 <- as.numeric(table(ret$intercept_ag_amenities_5[ret$intercept_ag_amenities_5==1]))
intercept_ag_amenities_6 <- as.numeric(table(ret$intercept_ag_amenities_6[ret$intercept_ag_amenities_6==1]))
intercept_ag_amenities_7 <- as.numeric(table(ret$intercept_ag_amenities_7[ret$intercept_ag_amenities_7==1]))
intercept_ag_amenities_8 <- as.numeric(table(ret$intercept_ag_amenities_8[ret$intercept_ag_amenities_8==1]))
intercept_ag_amenities_9 <- as.numeric(table(ret$intercept_ag_amenities_9[ret$intercept_ag_amenities_9==1]))
intercept_ag_amenities_10 <- as.numeric(table(ret$intercept_ag_amenities_10[ret$intercept_ag_amenities_10==1]))
intercept_ag_amenities_99 <- as.numeric(table(ret$intercept_ag_amenities_99[ret$intercept_ag_amenities_99==1]))
amenities_ret <- data.frame(Response = c("Recycling or waste receptacles/garbage cans",
"Benches",
"Bathrooms",
"Lighting",
"Water fountains",
"Picnic areas",
"Playgrounds",
"Mobi Stations",
"Public art",
"Shady zones",
"Other"),
Frequency= c(intercept_ag_amenities_1 ,intercept_ag_amenities_2 ,intercept_ag_amenities_3 ,intercept_ag_amenities_4 ,intercept_ag_amenities_5 ,intercept_ag_amenities_6 ,intercept_ag_amenities_7 ,intercept_ag_amenities_8 ,intercept_ag_amenities_9 ,intercept_ag_amenities_10,intercept_ag_amenities_99))
kable(amenities_ret) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
Response
|
Frequency
|
Recycling or waste receptacles/garbage cans
|
78
|
Benches
|
90
|
Bathrooms
|
87
|
Lighting
|
93
|
Water fountains
|
64
|
Picnic areas
|
52
|
Playgrounds
|
22
|
Mobi Stations
|
12
|
Public art
|
61
|
Shady zones
|
73
|
Other
|
38
|
Section 2: Physical Activity
During the last 7 days, on how many days did you do vigorous physical activities like heavy lifting, digging, heavy construction, or climbing up stairs as part of your work? Think about only those physical activities that you did for at least 10 minutes at a time.
#work_vigpa
ggplot(w2, aes(x = w2$work_vigpa)) + geom_histogram(na.rm = TRUE, fill = "#1596FF") + xlab("N days vigorous job-related physical activity") + facet_wrap(~ compare)

kable(data.frame(Days = 0:7, N = as.numeric(table(w2$work_vigpa)), Percentage = round(as.numeric(prop.table(table(w2$work_vigpa)))*100,2))) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
Days
|
N
|
Percentage
|
0
|
241
|
80.33
|
1
|
17
|
5.67
|
2
|
7
|
2.33
|
3
|
6
|
2.00
|
4
|
9
|
3.00
|
5
|
7
|
2.33
|
6
|
2
|
0.67
|
7
|
11
|
3.67
|
How much time did you usually spend on one of those days doing vigorous physical activities as part of your work?
#work_vigpa_freq
w2$work_vigpa_freq[w2$work_vigpa_freq==-7] <- NA
ggplot(w2, aes(x = work_vigpa_freq)) + geom_histogram(na.rm = TRUE, binwidth = 20, fill= "#35AAC2") + xlab("Minutes vigorous job-related physical activity") + facet_wrap(~ compare)

summary(w2$work_vigpa_freq)
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 0.00 15.00 60.00 71.69 85.00 480.00 241
During the last 7 days, on how many days did you travel in a motor vehicle like a train, bus, car, or metro?
#travel_motor
ggplot(w2, aes(x = w2$travel_motor)) + geom_histogram(na.rm = TRUE, fill="#1596FF") + xlab("N days") + facet_wrap(~ compare)

kable(data.frame(Days = 0:7, N = as.numeric(table(w2$travel_motor)), Percentage = round(as.numeric(prop.table(table(w2$travel_motor)))*100,2))) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
Days
|
N
|
Percentage
|
0
|
38
|
12.67
|
1
|
44
|
14.67
|
2
|
52
|
17.33
|
3
|
43
|
14.33
|
4
|
36
|
12.00
|
5
|
30
|
10.00
|
6
|
22
|
7.33
|
7
|
35
|
11.67
|
How much time did you usually spend on one of those days travelling in a train, bus, car, metro, or other kind of motor vehicle?
#travel_motor_freq
w2$travel_motor_freq[w2$travel_motor_freq==-7] <- NA
ggplot(w2, aes(x = w2$travel_motor_freq)) + geom_histogram(na.rm = TRUE, binwidth = 20, fill= "#35AAC2") + xlab("Minutes travel time") + facet_wrap(~ compare)

summary(w2$travel_motor_freq)
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 0.00 30.00 40.00 52.62 60.00 600.00 38
During the last 7 days, on how many days did you bicycle for at least 10 minutes at a time to go from place to place?
#travel_bike
ggplot(w2, aes(x = w2$travel_bike)) + geom_histogram(na.rm = TRUE, fill="#1596FF") + xlab("N days")+ facet_wrap(~ compare)

kable(data.frame(Days = 0:7, N = as.numeric(table(w2$travel_bike)), Percentage = round(as.numeric(prop.table(table(w2$travel_bike)))*100,2))) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
Days
|
N
|
Percentage
|
0
|
185
|
61.67
|
1
|
33
|
11.00
|
2
|
22
|
7.33
|
3
|
21
|
7.00
|
4
|
16
|
5.33
|
5
|
12
|
4.00
|
6
|
7
|
2.33
|
7
|
4
|
1.33
|
How much time did you usually spend on one of those days to bicycle from place to place?
#travel_bike_freq
w2$travel_bike_freq[w2$travel_bike_freq==-7] <- NA
ggplot(w2, aes(x = w2$travel_bike_freq)) + geom_histogram(na.rm = TRUE, binwidth = 20, fill= "#35AAC2") + xlab("Minutes travel time") + facet_wrap(~ compare)

summary(w2$travel_bike_freq)
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 0.00 30.00 60.00 55.96 60.00 240.00 185
During the last 7 days, on how many days did you walk for at least 10 minutes at a time to go from place to place?
#travel_walk
ggplot(w2, aes(x = w2$travel_walk)) + geom_histogram(na.rm = TRUE, fill="#1596FF") + xlab("# of days in the last 7 days")+ facet_wrap(~ compare)

kable(data.frame(Days = 0:7, N = as.numeric(table(w2$travel_walk)), Percentage = round(as.numeric(prop.table(table(w2$travel_walk)))*100,2))) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
Days
|
N
|
Percentage
|
0
|
23
|
7.67
|
1
|
17
|
5.67
|
2
|
39
|
13.00
|
3
|
43
|
14.33
|
4
|
34
|
11.33
|
5
|
35
|
11.67
|
6
|
23
|
7.67
|
7
|
86
|
28.67
|
How much time did you usually spend on one of those days walking from place to place?
#travel_walk_freq
w2$travel_walk_freq[w2$travel_walk_freq==-7] <- NA
ggplot(w2, aes(x = w2$travel_walk_freq)) + geom_histogram(na.rm = TRUE, binwidth = 20, fill= "#35AAC2") + xlab("Minutes travel time") + facet_wrap(~ compare)

summary(w2$travel_walk_freq)
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 10.00 30.00 40.00 48.62 60.00 300.00 23
Not counting any walking for transportation that you have already mentioned, during the last 7 days, on how many days did you walk for at least 10 minutes at a time in your leisure time?
#leisure_walk
ggplot(w2, aes(x = w2$leisure_walk)) + geom_histogram(na.rm = TRUE, fill="#1596FF") + xlab("N days")+ facet_wrap(~ compare)

kable(data.frame(Days = 0:7, N = as.numeric(table(w2$leisure_walk)), Percentage = round(as.numeric(prop.table(table(w2$leisure_walk))*100,2)))) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
Days
|
N
|
Percentage
|
0
|
48
|
16
|
1
|
25
|
8
|
2
|
41
|
14
|
3
|
32
|
11
|
4
|
26
|
9
|
5
|
20
|
7
|
6
|
20
|
7
|
7
|
88
|
29
|
How much time did you usually spend on one of those days walking in your leisure time?
#leisure_walk_freq
w2$leisure_walk_freq[w2$leisure_walk_freq==-7] <- NA
ggplot(w2, aes(x = w2$leisure_walk_freq)) + geom_histogram(na.rm = TRUE, binwidth = 20, fill= "#35AAC2") + xlab("Minutes leisure time") + facet_wrap(~ compare)

summary(w2$leisure_walk_freq)
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 3.00 30.00 60.00 57.87 60.00 300.00 48
Think about only those physical activities that you did for at least 10 minutes at a time, not counting any activity for transportation or work that you have already mentioned. During the last 7 days, on how many days did you do vigorous physical activities like aerobics, running, fast bicycling, or fast swimming in your leisure time?
#leisure_vigpa
ggplot(w2, aes(x = leisure_vigpa)) + geom_histogram(na.rm = TRUE, fill="#1596FF") + xlab("N days")+ facet_wrap(~ compare)

kable(data.frame(Days = 0:7, N = as.numeric(table(w2$leisure_vigpa)), Percentage = round(as.numeric(prop.table(table(w2$leisure_vigpa))*100,2)))) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
Days
|
N
|
Percentage
|
0
|
139
|
46
|
1
|
30
|
10
|
2
|
35
|
12
|
3
|
37
|
12
|
4
|
20
|
7
|
5
|
22
|
7
|
6
|
10
|
3
|
7
|
7
|
2
|
How much time did you usually spend on one of those days doing vigorous physical activities in your leisure time?
#leisure_vigpa_freq
w2$leisure_vigpa_freq[w2$leisure_vigpa_freq==-7] <- NA
ggplot(w2, aes(x = leisure_vigpa_freq)) + geom_histogram(na.rm = TRUE, binwidth = 20, fill= "#35AAC2") + xlab("Minutes leisure time")

summary(w2$leisure_vigpa_freq)
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 0.00 30.00 60.00 74.38 60.00 1800.00 139
During the last 7 days, on how many days did you do moderate physical activities like bicycling at a regular pace, swimming at a regular pace, or doubles tennis in your leisure time?
#leisure_modpa
ggplot(w2, aes(x = leisure_modpa)) + geom_histogram(na.rm = TRUE, fill="#1596FF") + xlab("N days")+ facet_wrap(~ compare)

kable(data.frame(Days = 0:7, N = as.numeric(table(w2$leisure_modpa)), Percentage = round(as.numeric(prop.table(table(w2$leisure_modpa))*100,2)))) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
Days
|
N
|
Percentage
|
0
|
174
|
58
|
1
|
34
|
11
|
2
|
31
|
10
|
3
|
22
|
7
|
4
|
14
|
5
|
5
|
12
|
4
|
6
|
6
|
2
|
7
|
7
|
2
|
How much time did you usually spend on one of those days doing moderate physical activities in your leisure time?
#leisure_modpa_freq
w2$leisure_modpa_freq[w2$leisure_modpa_freq==-7] <- NA
ggplot(w2, aes(x = w2$leisure_modpa_freq)) + geom_histogram(na.rm = TRUE, binwidth = 20, fill= "#35AAC2") + xlab("Minutes leisure time") + facet_wrap(~ compare)

summary(w2$leisure_modpa_freq)
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 10.00 30.00 60.00 66.75 60.00 900.00 174
During the last 7 days, how much time did you usually spend sitting on a weekday?
#sit_weekday
ggplot(w2, aes(x = w2$sit_weekday/60)) + geom_histogram(na.rm = TRUE, binwidth = 1, fill= "#35AAC2") + xlab("Hours sitting, weekday") + facet_wrap(~ compare)

## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 20.0 240.0 360.0 387.2 495.0 960.0
During the last 7 days, how much time did you usually spend sitting on a weekend day?
#sit_weekend
ggplot(w2, aes(x = w2$sit_weekend/60)) + geom_histogram(na.rm = TRUE, binwidth = 1, fill= "#35AAC2") + xlab("Hours sitting, weekend") + facet_wrap(~ compare)

## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0 180 300 317 420 960
Section 3: General Health
How tall are you?
#height
#exclude outliers?
ggplot(w2, aes(x = w2$height)) + geom_histogram(na.rm = TRUE, binwidth = 2, fill="#76D24A") + xlab("Height (cm)") + facet_wrap(~ compare)

## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 150.0 163.0 168.0 169.5 175.0 193.0
How much do you weigh?
#weight
ggplot(w2, aes(x = w2$weight)) + geom_histogram(na.rm = TRUE, binwidth = 2, fill="#76D24A") + xlab("Weight (kg)") + facet_wrap(~ compare)

## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 45.00 60.00 68.00 71.11 80.00 141.00
In general, would you say your health is:
#sf1
var_name <- w2$sf1
w2$var_name_f <- recode_factor(var_name, "1" = "Excellent", "2" = "Very good", "3" = "Good", "4" = "Fair", "5" = "Poor")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Excellent
|
61
|
20.33
|
|
Very good
|
129
|
43.00
|
|
Good
|
87
|
29.00
|
|
Fair
|
17
|
5.67
|
|
Poor
|
6
|
2.00
|
The following questions are about activities you might do during a typical day. Does your health now limit you in these activities? If so, how much?
a. Moderate activities such as moving a table, pushing a vacuum cleaner, bowling, or playing golf
var_name <- w2$sf2
w2$var_name_f <- recode_factor(var_name, "1" = "Yes, limited a lot", "2" = "Yes, limited a little", "3" = "No, not at all")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Yes, limited a lot
|
8
|
2.67
|
|
Yes, limited a little
|
40
|
13.33
|
|
No, not at all
|
252
|
84.00
|
b. Climbing several flights of stairs
var_name <- w2$sf3
w2$var_name_f <- recode_factor(var_name, "1" = "Yes, limited a lot", "2" = "Yes, limited a little", "3" = "No, not at all")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Yes, limited a lot
|
17
|
5.67
|
|
Yes, limited a little
|
49
|
16.33
|
|
No, not at all
|
234
|
78.00
|
During the past 4 weeks, have you had any of the following problems with your work or other regular daily activities as a result of your physical health?
a. Accomplished less than you would like
#sf4
var_name <- w2$sf4
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPaletteYN) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Yes
|
72
|
24
|
|
No
|
228
|
76
|
b. Were limited in the kind of work or other activities
var_name <- w2$sf5
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPaletteYN) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Yes
|
56
|
18.67
|
|
No
|
244
|
81.33
|
During the past 4 weeks, have you had any of the following problems with your work or other regular daily activities as a result of any emotional problems (such as feeling depressed or anxious)?
a. Accomplished less than you would like
var_name <- w2$sf6
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPaletteYN) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Yes
|
111
|
37
|
|
No
|
189
|
63
|
b. Did work or activities less carefully than usual
var_name <- w2$sf7
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPaletteYN) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Yes
|
57
|
19
|
|
No
|
243
|
81
|
During the past 4 weeks, how much did pain interfere with your normal work (including work outside the home and housework)?
var_name <- w2$sf8
w2$var_name_f <- recode_factor(var_name, "1" = "Not at all", "2" = "Slightly", "3" = "Moderately", "4" = "Quite a bit", "5" = "Extremely")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Not at all
|
172
|
57.33
|
|
Slightly
|
86
|
28.67
|
|
Moderately
|
28
|
9.33
|
|
Quite a bit
|
10
|
3.33
|
|
Extremely
|
4
|
1.33
|
How much of the time during the past 4 weeks.
a. Have you felt calm and peaceful?
var_name <- w2$sf9
w2$var_name_f <- recode_factor(var_name, "1" = "All of the time", "2" = "Most of the time", "3" = "A good bit of the time", "4" = "Some of the time", "5" = "A little of the time", "6" = "None of the time")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
All of the time
|
20
|
6.67
|
|
Most of the time
|
98
|
32.67
|
|
A good bit of the time
|
77
|
25.67
|
|
Some of the time
|
71
|
23.67
|
|
A little of the time
|
25
|
8.33
|
|
None of the time
|
9
|
3.00
|
b. Did you have a lot of energy?
var_name <- w2$sf10
w2$var_name_f <- recode_factor(var_name, "1" = "All of the time", "2" = "Most of the time", "3" = "A good bit of the time", "4" = "Some of the time", "5" = "A little of the time", "6" = "None of the time")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
All of the time
|
20
|
6.67
|
|
Most of the time
|
83
|
27.67
|
|
A good bit of the time
|
74
|
24.67
|
|
Some of the time
|
76
|
25.33
|
|
A little of the time
|
32
|
10.67
|
|
None of the time
|
15
|
5.00
|
c. Have you felt downhearted and blue?
var_name <- w2$sf11
w2$var_name_f <- recode_factor(var_name, "1" = "All of the time", "2" = "Most of the time", "3" = "A good bit of the time", "4" = "Some of the time", "5" = "A little of the time", "6" = "None of the time")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
All of the time
|
5
|
1.67
|
|
Most of the time
|
17
|
5.67
|
|
A good bit of the time
|
29
|
9.67
|
|
Some of the time
|
58
|
19.33
|
|
A little of the time
|
127
|
42.33
|
|
None of the time
|
64
|
21.33
|
During the past 4 weeks, how much of the time has your physical health or emotional problems interfered with your social activities (like visiting friends, relatives, etc.)?
var_name <- w2$sf12
w2$var_name_f <- recode_factor(var_name, "1" = "All of the time", "2" = "Most of the time", "3" = "A good bit of the time", "4" = "Some of the time", "5" = "A little of the time", "6" = "None of the time")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
All of the time
|
5
|
1.67
|
|
Most of the time
|
12
|
4.00
|
|
A good bit of the time
|
18
|
6.00
|
|
Some of the time
|
37
|
12.33
|
|
A little of the time
|
49
|
16.33
|
|
None of the time
|
179
|
59.67
|
Section 4: Well-being
Thinking about your own life and personal circumstances, how satisfied are you.
t_1 <- select(w2, compare, pwb_vic_a, pwb_vic_b, pwb_vic_c, pwb_vic_d, pwb_vic_e, pwb_vic_f, pwb_vic_g, pwb_vic_h, pwb_vic_i)
t_1 <- pivot_longer(t_1,
cols = starts_with("pwb_vic_"),
names_to = "perception",
names_prefix = "pwb_vic_",
values_to = "values",
values_drop_na = TRUE)
## rename
t_1$perception[t_1$perception== "a"] <- "a. With your life as a whole?"
t_1$perception[t_1$perception== "b"] <- "b. With your standard of living?"
t_1$perception[t_1$perception== "c"] <- "c. With your health?"
t_1$perception[t_1$perception== "d"] <- "d. With what you are achieving in life?"
t_1$perception[t_1$perception== "e"] <- "e. With your personal relationships?"
t_1$perception[t_1$perception== "f"] <- "f. With how safe you feel?"
t_1$perception[t_1$perception== "g"] <- "g. With feeling part of your community?"
t_1$perception[t_1$perception== "h"] <- "h. With your future security?"
t_1$perception[t_1$perception== "i"] <- "i. With your spirituality or religion?"
## recode
t_1$values <- recode_factor(t_1$values, "10" = "10- Completely dissatisfied", "9" = "9","8" = "8","7" = "7", "6" = "6", "5" = "5", "4" = "4", "3" = "3", "2" = "2", "1" = "1- Completely satisfied")
##### Table
t_1<- t_1 %>%
group_by(compare, perception, values) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
p <- ggplot(t_1, aes(x= perception, y= pct, fill= values)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
coord_flip() +
scale_fill_manual(values = rev(INTERACTPalettecont11)) +
ylab("Percent") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

In general, I consider myself:
#gwb_a
var_name <- w2$gwb_a
w2$var_name_f <- recode_factor(var_name, "1" = "1- Not a very happy person", "2" = "2", "3" = "3", "4" = "4", "5" = "5", "6" = "6", "7" = "7- A very happy person")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTfade) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
1- Not a very happy person
|
4
|
1.33
|
|
2
|
6
|
2.00
|
|
3
|
7
|
2.33
|
|
4
|
24
|
8.00
|
|
5
|
64
|
21.33
|
|
6
|
126
|
42.00
|
|
7- A very happy person
|
69
|
23.00
|
Compared with most of my peers, I consider myself:
#gwb_b
var_name <- w2$gwb_b
w2$var_name_f <- recode_factor(var_name, "1" = "1- Less happy", "2" = "2", "3" = "3", "4" = "4", "5" = "5", "6" = "6","7" = "7- More happy")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTfade) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
1- Less happy
|
7
|
2.33
|
|
2
|
6
|
2.00
|
|
3
|
17
|
5.67
|
|
4
|
39
|
13.00
|
|
5
|
88
|
29.33
|
|
6
|
100
|
33.33
|
|
7- More happy
|
43
|
14.33
|
Some people are generally very happy. They enjoy life regardless of what is going on, getting the most out of everything. To what extent does this characterization describe you?
#gwb_c
var_name <- w2$gwb_c
w2$var_name_f <- recode_factor(var_name, "1" = "1- Not at all", "2" = "2", "3" = "3", "4" = "4", "5" = "5", "6" = "6","7" = "7- A great deal")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTfade) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
1- Not at all
|
11
|
3.67
|
|
2
|
14
|
4.67
|
|
3
|
19
|
6.33
|
|
4
|
46
|
15.33
|
|
5
|
68
|
22.67
|
|
6
|
92
|
30.67
|
|
7- A great deal
|
50
|
16.67
|
Some people are generally not very happy. Although they are not depressed, they never seem as happy as they might be. To what extent does this characterization describe you?
#gwb_d
var_name <- w2$gwb_d
w2$var_name_f <- recode_factor(var_name, "1" = "1- Not at all", "2" = "2", "3" = "3", "4" = "4", "5" = "5", "6" = "6", "7" = "7- A great deal")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTfade) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
1- Not at all
|
103
|
34.33
|
|
2
|
65
|
21.67
|
|
3
|
41
|
13.67
|
|
4
|
32
|
10.67
|
|
5
|
30
|
10.00
|
|
6
|
18
|
6.00
|
|
7- A great deal
|
11
|
3.67
|
The next questions are about how you feel about different aspects of your life. For each one, tell us how often you feel that way.
a. How often do you feel that you lack companionship?
#loneliness_a
var_name <- w2$loneliness_a
w2$var_name_f <- recode_factor(var_name, "1" = "Hardly ever", "2" = "Some of the time", "3" = "Often")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = rev(INTERACTshorterfade3)) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Hardly ever
|
163
|
54.33
|
|
Some of the time
|
98
|
32.67
|
|
Often
|
39
|
13.00
|
b. How often do you feel left out?
var_name <- w2$loneliness_b
w2$var_name_f <- recode_factor(var_name, "1" = "Hardly ever", "2" = "Some of the time", "3" = "Often")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = rev(INTERACTshorterfade3)) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Hardly ever
|
164
|
54.67
|
|
Some of the time
|
109
|
36.33
|
|
Often
|
27
|
9.00
|
c. How often do you feel isolated from others?
#loneliness_c
var_name <- w2$loneliness_c
w2$var_name_f <- recode_factor(var_name, "1" = "Hardly ever", "2" = "Some of the time", "3" = "Often")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = rev(INTERACTshorterfade3)) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Hardly ever
|
148
|
49.33
|
|
Some of the time
|
112
|
37.33
|
|
Often
|
40
|
13.33
|
Section 5: Social Participation
How often do you.
a. Say hello to a neighbour?
#spat_a
#per week
ggplot(w2, aes(x = w2$spat_a/52.1429)) +
geom_histogram(binwidth = 1, na.rm = TRUE, fill="#1596FF") + xlab("Times per week") + facet_wrap( ~ compare)

summary(w2$spat_a/52.1429)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.000 1.995 3.989 3.920 6.981 7.000
b. Stop and have a chat with a neighbour?
#spat_b
#per week
ggplot(w2, aes(x = w2$spat_b/52.1429)) +
geom_histogram(binwidth = 1, na.rm = TRUE, fill="#1596FF") + xlab("Times per week")+ facet_wrap( ~ compare)

summary(w2$spat_b/52.1429)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.0000 0.4603 0.9973 2.2027 3.9890 6.9808
c. Visit a neighbour, or receive a visit from a neighbour?
#spat_c
#per week
ggplot(w2, aes(x = w2$spat_c/52.1429)) +
geom_histogram(binwidth = 1, na.rm = TRUE, fill="#1596FF") + xlab("Times per week")+ facet_wrap( ~ compare)

summary(w2$spat_c/52.1429)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.00000 0.00000 0.01918 0.62808 0.92055 6.98082
d. Go somewhere (e.g., to a shop; to a restaurant), together with a neighbour?
#spat_d
#per week
ggplot(w2, aes(x = w2$spat_d/52.1429)) +
geom_histogram(binwidth = 1, na.rm = TRUE, fill="#1596FF") + xlab("Times per week")+ facet_wrap( ~ compare)

summary(w2$spat_d/52.1429)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.00000 0.00000 0.00000 0.32015 0.07671 6.98082
e. Ask help/advice from or do you help/give advice to a neighbour yourself?
#spat_e
#per week
ggplot(w2, aes(x = w2$spat_e/52.1429)) +
geom_histogram(binwidth = 1, na.rm = TRUE, fill="#1596FF") + xlab("Times per week")+ facet_wrap( ~ compare)

summary(w2$spat_e/52.1429)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.0000 0.0000 0.2301 0.6105 0.9205 6.9808
Thinking about your neighbourhood, how would you rate the following statements?
a. This is a close-knit neighbourhood
# plot spat2_a
var_name <- w2$spat2_a
w2$var_name_f <- recode_factor(var_name, "1"="Strongly disagree", "2"="Somewhat disagree", "3"="Neither agree or disagree", "4"="Somewhat agree", "5"= "Strongly agree")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = rev(INTERACTPalette3)) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Strongly disagree
|
41
|
13.67
|
|
Somewhat disagree
|
42
|
14.00
|
|
Neither agree or disagree
|
117
|
39.00
|
|
Somewhat agree
|
78
|
26.00
|
|
Strongly agree
|
22
|
7.33
|
b. People generally do not get along
# plot spat2_b
var_name <- w2$spat2_b
w2$var_name_f <- recode_factor(var_name, "1"="Strongly disagree", "2"="Somewhat disagree", "3"="Neither agree or disagree", "4"="Somewhat agree", "5"= "Strongly agree")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = rev(INTERACTPalette3)) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Strongly disagree
|
108
|
36.00
|
|
Somewhat disagree
|
96
|
32.00
|
|
Neither agree or disagree
|
72
|
24.00
|
|
Somewhat agree
|
20
|
6.67
|
|
Strongly agree
|
4
|
1.33
|
c. People are willing to help neighbours
# plot spat2_c
var_name <- w2$spat2_c
w2$var_name_f <- recode_factor(var_name, "1"="Strongly disagree", "2"="Somewhat disagree", "3"="Neither agree or disagree", "4"="Somewhat agree", "5"= "Strongly agree")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = rev(INTERACTPalette3)) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Strongly disagree
|
9
|
3.00
|
|
Somewhat disagree
|
22
|
7.33
|
|
Neither agree or disagree
|
71
|
23.67
|
|
Somewhat agree
|
143
|
47.67
|
|
Strongly agree
|
55
|
18.33
|
d. People do not share same values
var_name <- w2$spat2_d
w2$var_name_f <- recode_factor(var_name, "1"="Strongly disagree", "2"="Somewhat disagree", "3"="Neither agree or disagree", "4"="Somewhat agree", "5"= "Strongly agree")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = rev(INTERACTPalette3)) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Strongly disagree
|
47
|
15.67
|
|
Somewhat disagree
|
81
|
27.00
|
|
Neither agree or disagree
|
129
|
43.00
|
|
Somewhat agree
|
35
|
11.67
|
|
Strongly agree
|
8
|
2.67
|
e. People can be trusted
# plot spat2_e
var_name <- w2$spat2_e
w2$var_name_f <- recode_factor(var_name, "1"="Strongly disagree", "2"="Somewhat disagree", "3"="Neither agree or disagree", "4"="Somewhat agree", "5"= "Strongly agree")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = rev(INTERACTPalette3)) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Strongly disagree
|
5
|
1.67
|
|
Somewhat disagree
|
20
|
6.67
|
|
Neither agree or disagree
|
63
|
21.00
|
|
Somewhat agree
|
143
|
47.67
|
|
Strongly agree
|
69
|
23.00
|
If you lost a wallet or purse that contained two hundred dollars, how likely is it to be returned with the money in it, if it was found:
a. By someone who lives close by? Would it be:
#spat3_a
var_name <- w2$spat3_a
w2$var_name_f <- recode_factor(var_name, "1"="Very likely", "2"="Somewhat likely", "3"="Not at all likely", "77"="I don't know")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Very likely
|
127
|
42.33
|
|
Somewhat likely
|
123
|
41.00
|
|
Not at all likely
|
16
|
5.33
|
|
I don’t know
|
34
|
11.33
|
b. By a complete stranger? Would it be:
#spat3_b
var_name <- w2$spat3_b
w2$var_name_f <- recode_factor(var_name, "1"="Very likely", "2"="Somewhat likely", "3"="Not at all likely", "77"="I don't know")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Very likely
|
14
|
4.67
|
|
Somewhat likely
|
128
|
42.67
|
|
Not at all likely
|
97
|
32.33
|
|
I don’t know
|
61
|
20.33
|
How many close friends do you have (that is, people who are not your relatives, but who you feel at ease with, can talk to about what is on your mind, or call on for help)?
#confide
ggplot(w2, aes(x = w2$confide)) +
geom_histogram(binwidth = 1, na.rm = TRUE, fill="#1596FF") + xlab("Times per week")+ facet_wrap( ~ compare)

## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.000 3.000 5.000 7.363 10.000 50.000
Here are some questions about your satisfaction with the neighbourhood in which you live. Please indicate your satisfaction with each item.How satisfied are you with…
a. your neighbourhood as a good place to live?
#neighb_a
var_name <- w2$neighb_a
w2$var_name_f <- recode_factor(var_name, "1" = "Strongly satisfied", "2" = "Satisfied", "3" = "Neither satisfied nor dissatisfied", "4" = "Dissatisfied", "5" = "Strongly dissatisfied")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Strongly satisfied
|
171
|
57.00
|
|
Satisfied
|
108
|
36.00
|
|
Neither satisfied nor dissatisfied
|
10
|
3.33
|
|
Dissatisfied
|
10
|
3.33
|
|
Strongly dissatisfied
|
1
|
0.33
|
b. the number of people you know in your neighbourhood?
#neighb_b
var_name <- w2$neighb_b
w2$var_name_f <- recode_factor(var_name, "1" = "Strongly satisfied", "2" = "Satisfied", "3" = "Neither satisfied nor dissatisfied", "4" = "Dissatisfied", "5" = "Strongly dissatisfied")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Strongly satisfied
|
45
|
15.00
|
|
Satisfied
|
107
|
35.67
|
|
Neither satisfied nor dissatisfied
|
88
|
29.33
|
|
Dissatisfied
|
48
|
16.00
|
|
Strongly dissatisfied
|
12
|
4.00
|
c. the ethnic diversity of your neighbourhood?
#neighb_c
var_name <- w2$neighb_c
w2$var_name_f <- recode_factor(var_name, "1" = "Strongly satisfied", "2" = "Satisfied", "3" = "Neither satisfied nor dissatisfied", "4" = "Dissatisfied", "5" = "Strongly dissatisfied")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Strongly satisfied
|
39
|
13.00
|
|
Satisfied
|
105
|
35.00
|
|
Neither satisfied nor dissatisfied
|
105
|
35.00
|
|
Dissatisfied
|
38
|
12.67
|
|
Strongly dissatisfied
|
13
|
4.33
|
d. your neighbourhood as a good place to raise children
#neighb_d
var_name <- w2$neighb_d
w2$var_name_f <- recode_factor(var_name, "1" = "Strongly satisfied", "2" = "Satisfied", "3" = "Neither satisfied nor dissatisfied", "4" = "Dissatisfied", "5" = "Strongly dissatisfied")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Strongly satisfied
|
98
|
32.67
|
|
Satisfied
|
116
|
38.67
|
|
Neither satisfied nor dissatisfied
|
61
|
20.33
|
|
Dissatisfied
|
16
|
5.33
|
|
Strongly dissatisfied
|
9
|
3.00
|
Section 7: Neighbourhood Selection
Before moving into your current dwelling, when you were looking for a neighbourhood to live in, to what extent were the following characteristics important? Please report your perspectives, even if the neighbourhood where you currently live does not have these characteristics
a. Good access to public transportation
#neigh_pref_a
var_name <- w2$neigh_pref_a
w2$var_name_f <- recode_factor(var_name, "1" = "Very important", "2" = "Somewhat important", "3" = "Not very important", "4" = "Not important at all", "77" = "I don't know")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTshortfade) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Very important
|
155
|
51.67
|
|
Somewhat important
|
100
|
33.33
|
|
Not very important
|
28
|
9.33
|
|
Not important at all
|
13
|
4.33
|
|
I don’t know
|
4
|
1.33
|
b. Sufficient parks and green spaces
var_name <- w2$neigh_pref_b
w2$var_name_f <- recode_factor(var_name, "1" = "Very important", "2" = "Somewhat important", "3" = "Not very important", "4" = "Not important at all", "77" = "I don't know")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTshortfade) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Very important
|
179
|
59.67
|
|
Somewhat important
|
99
|
33.00
|
|
Not very important
|
15
|
5.00
|
|
Not important at all
|
3
|
1.00
|
|
I don’t know
|
4
|
1.33
|
c. Sufficient shops and services
#neigh_pref_c
var_name <- w2$neigh_pref_c
w2$var_name_f <- recode_factor(var_name, "1" = "Very important", "2" = "Somewhat important", "3" = "Not very important", "4" = "Not important at all", "77" = "I don't know")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTshortfade) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Very important
|
172
|
57.33
|
|
Somewhat important
|
111
|
37.00
|
|
Not very important
|
13
|
4.33
|
|
Not important at all
|
2
|
0.67
|
|
I don’t know
|
2
|
0.67
|
d. Proximity to doctors, a pharmacy or other health services
var_name <- w2$neigh_pref_d
w2$var_name_f <- recode_factor(var_name, "1" = "Very important", "2" = "Somewhat important", "3" = "Not very important", "4" = "Not important at all", "77" = "I don't know")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTshortfade) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Very important
|
71
|
23.67
|
|
Somewhat important
|
124
|
41.33
|
|
Not very important
|
76
|
25.33
|
|
Not important at all
|
27
|
9.00
|
|
I don’t know
|
2
|
0.67
|
e. A good knowledge of the neighbourhood
var_name <- w2$neigh_pref_e
w2$var_name_f <- recode_factor(var_name, "1" = "Very important", "2" = "Somewhat important", "3" = "Not very important", "4" = "Not important at all", "77" = "I don't know")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTshortfade) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Very important
|
62
|
20.67
|
|
Somewhat important
|
142
|
47.33
|
|
Not very important
|
70
|
23.33
|
|
Not important at all
|
17
|
5.67
|
|
I don’t know
|
9
|
3.00
|
f. Presence of relatives, friends or acquaintances
#neigh_pref_f
var_name <- w2$neigh_pref_f
w2$var_name_f <- recode_factor(var_name, "1" = "Very important", "2" = "Somewhat important", "3" = "Not very important", "4" = "Not important at all", "77" = "I don't know")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTshortfade) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Very important
|
34
|
11.33
|
|
Somewhat important
|
87
|
29.00
|
|
Not very important
|
102
|
34.00
|
|
Not important at all
|
70
|
23.33
|
|
I don’t know
|
7
|
2.33
|
g. A neighbourhood where it is pleasant to walk
#neigh_pref_g
var_name <- w2$neigh_pref_g
w2$var_name_f <- recode_factor(var_name, "1" = "Very important", "2" = "Somewhat important", "3" = "Not very important", "4" = "Not important at all", "77" = "I don't know")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTshortfade) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Very important
|
190
|
63.33
|
|
Somewhat important
|
91
|
30.33
|
|
Not very important
|
12
|
4.00
|
|
Not important at all
|
4
|
1.33
|
|
I don’t know
|
3
|
1.00
|
h. A neighbourhood where it is practical to move around by car (ease of parking, low traffic, good access by car)
#neigh_pref_h
var_name <- w2$neigh_pref_h
w2$var_name_f <- recode_factor(var_name, "1" = "Very important", "2" = "Somewhat important", "3" = "Not very important", "4" = "Not important at all", "77" = "I don't know")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTshortfade) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Very important
|
61
|
20.33
|
|
Somewhat important
|
102
|
34.00
|
|
Not very important
|
73
|
24.33
|
|
Not important at all
|
57
|
19.00
|
|
I don’t know
|
7
|
2.33
|
i. Presence of good schools
#neigh_pref_i
var_name <- w2$neigh_pref_i
w2$var_name_f <- recode_factor(var_name, "1" = "Very important", "2" = "Somewhat important", "3" = "Not very important", "4" = "Not important at all", "77" = "I don't know")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTshortfade) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Very important
|
69
|
23.00
|
|
Somewhat important
|
64
|
21.33
|
|
Not very important
|
45
|
15.00
|
|
Not important at all
|
102
|
34.00
|
|
I don’t know
|
20
|
6.67
|
Section 8: COVID-19 - most closed phase
The following questions are about your activities and how you felt during the most closed phase of the COVID-19 lockdown.
During the most closed phase of the COVID-19 lockdown, compared to your typical habits prior to the COVID-19 pandemic, how many trips per week did you make?
#cov_con_trips
ggplot(w2, aes(x= cov_con_trips)) + geom_bar(na.rm = TRUE,fill="#76D24A", binwidth = 1) + xlab("Number of trips per week") + facet_wrap( ~ compare)

summary(w2$cov_con_trips)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.000 1.000 3.000 4.513 6.000 40.000
During the most closed phase of the COVID-19 lockdown, did you make trips for the following activities?
t_1 <- select(w2, compare, cov_con_triptype_a, cov_con_triptype_b, cov_con_triptype_c, cov_con_triptype_d, cov_con_triptype_e, cov_con_triptype_f)
t_1 <- pivot_longer(t_1,
cols = starts_with("cov_con_triptype_"),
names_to = "perception",
names_prefix = "cov_con_triptype_",
values_to = "values",
values_drop_na = TRUE)
## rename
t_1$perception[t_1$perception== "a"] <- "Work"
t_1$perception[t_1$perception== "b"] <- "School"
t_1$perception[t_1$perception== "c"] <- "Groceries"
t_1$perception[t_1$perception== "d"] <- "Medical trips"
t_1$perception[t_1$perception== "e"] <- "Care-taking"
t_1$perception[t_1$perception== "f"] <- "Social, entertainment, eating out"
t_1$perception[t_1$perception== "g"] <- "Recreation / exercise"
## recode
t_1$values <- recode_factor(t_1$values, "1" = "Yes", "2" = "No")
##### Table
t_1<- t_1 %>%
group_by(compare, perception, values) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
p <- ggplot(t_1, aes(x= perception, y= pct, fill= values)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
coord_flip() +
scale_fill_manual(values = INTERACTPaletteYN) +
ylab("Percent") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
perception
|
values
|
n
|
pct
|
|
Care-taking
|
Yes
|
32
|
10.67
|
|
Care-taking
|
No
|
268
|
89.33
|
|
Groceries
|
Yes
|
274
|
91.33
|
|
Groceries
|
No
|
26
|
8.67
|
|
Medical trips
|
Yes
|
108
|
36.00
|
|
Medical trips
|
No
|
192
|
64.00
|
|
School
|
Yes
|
9
|
3.00
|
|
School
|
No
|
291
|
97.00
|
|
Social, entertainment, eating out
|
Yes
|
43
|
14.33
|
|
Social, entertainment, eating out
|
No
|
257
|
85.67
|
|
Work
|
Yes
|
73
|
24.33
|
|
Work
|
No
|
227
|
75.67
|
During the most closed phase of the COVID-19 lockdown, did you use the following modes of transportation in a typical week more than, less than,or the same as you did prior to the COVID-19 pandemic?
t_1 <- select(w2, compare, cov_con_mode_a, cov_con_mode_b, cov_con_mode_c, cov_con_mode_d)
t_1 <- pivot_longer(t_1,
cols = starts_with("cov_con_mode_"),
names_to = "perception",
names_prefix = "cov_con_mode_",
values_to = "values",
values_drop_na = TRUE)
## rename
t_1$perception[t_1$perception== "a"] <- "Driving"
t_1$perception[t_1$perception== "b"] <- "Cycling"
t_1$perception[t_1$perception== "c"] <- "Walking"
t_1$perception[t_1$perception== "d"] <- "Public Transit"
## recode
t_1$values <- recode_factor(t_1$values, "1" = "Less", "2" = "Same as before COVID-19", "3" = "More")
##### Table
t_1<- t_1 %>%
group_by(compare, perception, values) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
p <- ggplot(t_1, aes(x= perception, y= pct, fill= values)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
coord_flip() +
scale_fill_manual(values = rev(INTERACTshorterfade3)) +
ylab("Percent") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
perception
|
values
|
n
|
pct
|
|
Cycling
|
Less
|
110
|
36.67
|
|
Cycling
|
Same as before COVID-19
|
130
|
43.33
|
|
Cycling
|
More
|
60
|
20.00
|
|
Driving
|
Less
|
179
|
59.67
|
|
Driving
|
Same as before COVID-19
|
71
|
23.67
|
|
Driving
|
More
|
50
|
16.67
|
|
Public Transit
|
Less
|
250
|
83.33
|
|
Public Transit
|
Same as before COVID-19
|
47
|
15.67
|
|
Public Transit
|
More
|
3
|
1.00
|
|
Walking
|
Less
|
59
|
19.67
|
|
Walking
|
Same as before COVID-19
|
94
|
31.33
|
|
Walking
|
More
|
147
|
49.00
|
During the most closed phase of the COVID-19 lockdown, were you using the Arbutus Greenway less than, more than, or the same as you did prior to the COVID-19 pandemic?
#cov_con_aag
var_name <- w2$cov_con_aag
w2$var_name_f <- recode_factor(var_name, "1" = "Less", "2" = "Same as before COVID-19", "3" = "More")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = rev(INTERACTshorterfade3)) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Less
|
106
|
35.33
|
|
Same as before COVID-19
|
124
|
41.33
|
|
More
|
70
|
23.33
|
Please select all the reasons explaining why you used the Arbutus Greenway more during the most closed phase of the COVID-19 lockdown.
*Participants could choose many options. Count is number of times option was selected.
#cov_con_aag_more
# 1 Staying active
# 2 To meet up with people at a distance
# 3 Felt safe despite COVID-19
# 4 Nearby walking destination
# 5 Felt safe from traffic
# 99 Other (please specify)
cov_con_aag_more_1 <- as.numeric(table(w2$cov_con_aag_more_1[w2$cov_con_aag_more_1==1]))
cov_con_aag_more_2 <- as.numeric(table(w2$cov_con_aag_more_2[w2$cov_con_aag_more_2==1]))
cov_con_aag_more_3 <- as.numeric(table(w2$cov_con_aag_more_3[w2$cov_con_aag_more_3==1]))
cov_con_aag_more_4 <- as.numeric(table(w2$cov_con_aag_more_4[w2$cov_con_aag_more_4==1]))
cov_con_aag_more_5 <- as.numeric(table(w2$cov_con_aag_more_5[w2$cov_con_aag_more_5==1]))
cov_con_aag_more <- data.frame(Response = c("Staying active", "To meet up with people at a distance", "Felt safe despite COVID-19", "Nearby walking destination", "Felt safe from traffic"),
Frequence = c(cov_con_aag_more_1, cov_con_aag_more_2, cov_con_aag_more_3, cov_con_aag_more_4, cov_con_aag_more_5))
kable(cov_con_aag_more) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
Response
|
Frequence
|
Staying active
|
66
|
To meet up with people at a distance
|
17
|
Felt safe despite COVID-19
|
42
|
Nearby walking destination
|
49
|
Felt safe from traffic
|
37
|
Please select all the reasons explaining why you used the Arbutus Greenway less during the most closed phase of the COVID-19 lockdown.
*Participants could choose many options. Count is number of times option was selected.
#cov_con_aag_more
# 1 Used other outdoor spaces instead
# 2 Too crowded
# 3 Didn’t feel safe because of COVID-19
# 4 Too far away
# 5 Didn’t feel safe from traffic
# 6 Other
cov_con_aag_less_1 <- as.numeric(table(w2$cov_con_aag_less_1[w2$cov_con_aag_less_1==1]))
cov_con_aag_less_2 <- as.numeric(table(w2$cov_con_aag_less_2[w2$cov_con_aag_less_2==1]))
cov_con_aag_less_3 <- as.numeric(table(w2$cov_con_aag_less_3[w2$cov_con_aag_less_3==1]))
cov_con_aag_less_4 <- as.numeric(table(w2$cov_con_aag_less_4[w2$cov_con_aag_less_4==1]))
cov_con_aag_less_5 <- as.numeric(table(w2$cov_con_aag_less_5[w2$cov_con_aag_less_5==1]))
cov_con_aag_less <- data.frame(Response = c("Used other outdoor spaces instead",
"Too crowded",
"Didn’t feel safe because of COVID-19",
"Too far away",
"Didn’t feel safe from traffic"),
Frequence = c(cov_con_aag_less_1,
cov_con_aag_less_2,
cov_con_aag_less_3,
cov_con_aag_less_4,
cov_con_aag_less_5))
kable(cov_con_aag_less) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
Response
|
Frequence
|
Used other outdoor spaces instead
|
42
|
Too crowded
|
51
|
Didn’t feel safe because of COVID-19
|
41
|
Too far away
|
12
|
Didn’t feel safe from traffic
|
1
|
During the most closed phase of the COVID-19 lockdown, how satisfied were you with your level of physical activity?
var_name <- w2$cov_con_pa
w2$var_name_f <- recode_factor(var_name, "1" = "Very satisfied",
"2" = "Somewhat satisfied",
"3" = "Neutral",
"4" = "Somewhat dissatisfied",
"5" = "Very dissatisfied")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Very satisfied
|
64
|
21.33
|
|
Somewhat satisfied
|
92
|
30.67
|
|
Neutral
|
15
|
5.00
|
|
Somewhat dissatisfied
|
83
|
27.67
|
|
Very dissatisfied
|
46
|
15.33
|
During the most closed phase of the COVID-19 lockdown, how satisfied were you with your ability to connect with others?
var_name <- w2$cov_con_social
w2$var_name_f <- recode_factor(var_name, "1" = "Very satisfied",
"2" = "Somewhat satisfied",
"3" = "Neutral",
"4" = "Somewhat dissatisfied",
"5" = "Very dissatisfied")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Very satisfied
|
18
|
6.00
|
|
Somewhat satisfied
|
71
|
23.67
|
|
Neutral
|
34
|
11.33
|
|
Somewhat dissatisfied
|
121
|
40.33
|
|
Very dissatisfied
|
56
|
18.67
|
During the most closed phase of the COVID-19 lockdown, how would you have rated your overall well-being?
var_name <- w2$cov_con_wb
w2$var_name_f <- recode_factor(var_name, "0" = "0. As bad as it could be",
"1" = "1",
"2" = "2",
"3" = "3",
"4" = "4",
"5" = "5",
"6" = "6",
"7" = "7",
"8" = "8",
"9" = "9",
"10" = "10. As good as it could be")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = rev(INTERACTfade)) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
- As bad as it could be
|
4
|
1.33
|
|
1
|
1
|
0.33
|
|
2
|
12
|
4.00
|
|
3
|
25
|
8.33
|
|
4
|
23
|
7.67
|
|
5
|
42
|
14.00
|
|
6
|
30
|
10.00
|
|
7
|
47
|
15.67
|
|
8
|
46
|
15.33
|
|
9
|
35
|
11.67
|
|
- As good as it could be
|
35
|
11.67
|
Section 9: COVID-19 Current context
The following questions are about your activities and how you feel now in the current context.
In the current context, how many trips do you make per week?
#cov_decon_trips
ggplot(w2, aes(x= cov_decon_trips)) + geom_bar(na.rm = TRUE,fill="#76D24A", binwidth = 1) + xlab("Number of trips per week") + facet_wrap( ~ compare)

summary(w2$cov_decon_trips)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.00 4.00 7.00 8.73 12.00 40.00
In the current context, do you make trips for the following activities?
t_1 <- select(w2, compare, cov_decon_triptype_a, cov_decon_triptype_b, cov_decon_triptype_c, cov_decon_triptype_d, cov_decon_triptype_e, cov_decon_triptype_f)
t_1 <- pivot_longer(t_1,
cols = starts_with("cov_decon_triptype_"),
names_to = "perception",
names_prefix = "cov_decon_triptype_",
values_to = "values",
values_drop_na = TRUE)
## rename
t_1$perception[t_1$perception== "a"] <- "Work"
t_1$perception[t_1$perception== "b"] <- "School"
t_1$perception[t_1$perception== "c"] <- "Groceries"
t_1$perception[t_1$perception== "d"] <- "Medical trips"
t_1$perception[t_1$perception== "e"] <- "Care-taking"
t_1$perception[t_1$perception== "f"] <- "Social, entertainment, eating out"
t_1$perception[t_1$perception== "g"] <- "Recreation / exercise"
## recode
t_1$values <- recode_factor(t_1$values, "1" = "Yes", "2" = "No")
##### Table
t_1<- t_1 %>%
group_by(compare, perception, values) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
p <- ggplot(t_1, aes(x= perception, y= pct, fill= values)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
coord_flip() +
scale_fill_manual(values = INTERACTPaletteYN) +
ylab("Percent") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
perception
|
values
|
n
|
pct
|
|
Care-taking
|
Yes
|
40
|
13.33
|
|
Care-taking
|
No
|
260
|
86.67
|
|
Groceries
|
Yes
|
287
|
95.67
|
|
Groceries
|
No
|
13
|
4.33
|
|
Medical trips
|
Yes
|
173
|
57.67
|
|
Medical trips
|
No
|
127
|
42.33
|
|
School
|
Yes
|
28
|
9.33
|
|
School
|
No
|
272
|
90.67
|
|
Social, entertainment, eating out
|
Yes
|
151
|
50.33
|
|
Social, entertainment, eating out
|
No
|
149
|
49.67
|
|
Work
|
Yes
|
104
|
34.67
|
|
Work
|
No
|
196
|
65.33
|
In the current context, do you use the following modes of transportation less than, more than, or the same as you did prior to the COVID-19 pandemic?
t_1 <- select(w2, compare, cov_decon_mode_a, cov_decon_mode_b, cov_decon_mode_c, cov_decon_mode_d)
t_1 <- pivot_longer(t_1,
cols = starts_with("cov_decon_mode_"),
names_to = "perception",
names_prefix = "cov_decon_mode_",
values_to = "values",
values_drop_na = TRUE)
## rename
t_1$perception[t_1$perception== "a"] <- "Driving"
t_1$perception[t_1$perception== "b"] <- "Cycling"
t_1$perception[t_1$perception== "c"] <- "Walking"
t_1$perception[t_1$perception== "d"] <- "Public Transit"
## recode
t_1$values <- recode_factor(t_1$values, "1" = "Less", "2" = "Same as before COVID-19", "3" = "More")
##### Table
t_1<- t_1 %>%
group_by(compare, perception, values) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
p <- ggplot(t_1, aes(x= perception, y= pct, fill= values)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
coord_flip() +
scale_fill_manual(values = rev(INTERACTshorterfade3)) +
ylab("Percent") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
perception
|
values
|
n
|
pct
|
|
Cycling
|
Less
|
75
|
25.00
|
|
Cycling
|
Same as before COVID-19
|
173
|
57.67
|
|
Cycling
|
More
|
52
|
17.33
|
|
Driving
|
Less
|
130
|
43.33
|
|
Driving
|
Same as before COVID-19
|
109
|
36.33
|
|
Driving
|
More
|
61
|
20.33
|
|
Public Transit
|
Less
|
229
|
76.33
|
|
Public Transit
|
Same as before COVID-19
|
66
|
22.00
|
|
Public Transit
|
More
|
5
|
1.67
|
|
Walking
|
Less
|
42
|
14.00
|
|
Walking
|
Same as before COVID-19
|
119
|
39.67
|
|
Walking
|
More
|
139
|
46.33
|
In the current context, have you been using the Arbutus Greenway less than, more than, or the same as you did prior to the COVID-19 pandemic?
#cov_decon_aag
var_name <- w2$cov_decon_aag
w2$var_name_f <- recode_factor(var_name, "1" = "Less", "2" = "Same as before COVID-19", "3" = "More")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = rev(INTERACTshorterfade3)) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Less
|
88
|
29.33
|
|
Same as before COVID-19
|
139
|
46.33
|
|
More
|
73
|
24.33
|
Please select all the reasons explaining why you use the Arbutus Greenway more now than prior to the COVID-19 pandemic.
*Participants could choose many options. Count is number of times option was selected.
# 1 Staying active
# 2 To meet up with people at a distance
# 3 Felt safe despite COVID-19
# 4 Nearby walking destination
# 5 Felt safe from traffic
# 99 Other (please specify)
cov_decon_aag_more_1 <- as.numeric(table(w2$cov_decon_aag_more_1[w2$cov_decon_aag_more_1==1]))
cov_decon_aag_more_2 <- as.numeric(table(w2$cov_decon_aag_more_2[w2$cov_decon_aag_more_2==1]))
cov_decon_aag_more_3 <- as.numeric(table(w2$cov_decon_aag_more_3[w2$cov_decon_aag_more_3==1]))
cov_decon_aag_more_4 <- as.numeric(table(w2$cov_decon_aag_more_4[w2$cov_decon_aag_more_4==1]))
cov_decon_aag_more_5 <- as.numeric(table(w2$cov_decon_aag_more_5[w2$cov_decon_aag_more_5==1]))
cov_decon_aag_more <- data.frame(Response = c("Staying active", "To meet up with people at a distance", "Felt safe despite COVID-19", "Nearby walking destination", "Felt safe from traffic"),
Frequence = c(cov_decon_aag_more_1, cov_decon_aag_more_2, cov_decon_aag_more_3, cov_decon_aag_more_4, cov_decon_aag_more_5))
kable(cov_decon_aag_more) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
Response
|
Frequence
|
Staying active
|
67
|
To meet up with people at a distance
|
22
|
Felt safe despite COVID-19
|
34
|
Nearby walking destination
|
51
|
Felt safe from traffic
|
35
|
Please select all the reasons explaining why you use the Arbutus Greenway less now than prior to the COVID-19 pandemic.
*Participants could choose many options. Count is number of times option was selected.
cov_decon_aag_less_1 <- as.numeric(table(w2$cov_decon_aag_less_1[w2$cov_decon_aag_less_1==1]))
cov_decon_aag_less_2 <- as.numeric(table(w2$cov_decon_aag_less_2[w2$cov_decon_aag_less_2==1]))
cov_decon_aag_less_3 <- as.numeric(table(w2$cov_decon_aag_less_3[w2$cov_decon_aag_less_3==1]))
cov_decon_aag_less_4 <- as.numeric(table(w2$cov_decon_aag_less_4[w2$cov_decon_aag_less_4==1]))
cov_decon_aag_less_5 <- as.numeric(table(w2$cov_decon_aag_less_5[w2$cov_decon_aag_less_5==1]))
cov_decon_aag_less <- data.frame(Response = c("Used other outdoor spaces instead",
"Too crowded",
"Didn’t feel safe because of COVID-19",
"Too far away",
"Didn’t feel safe from traffic"),
Frequence = c(cov_decon_aag_less_1,
cov_decon_aag_less_2,
cov_decon_aag_less_3,
cov_decon_aag_less_4,
cov_decon_aag_less_5))
kable(cov_decon_aag_less) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
Response
|
Frequence
|
Used other outdoor spaces instead
|
37
|
Too crowded
|
39
|
Didn’t feel safe because of COVID-19
|
27
|
Too far away
|
12
|
Didn’t feel safe from traffic
|
3
|
In the current context, how satisfied are you with your level of physical activity?
var_name <- w2$cov_decon_pa
w2$var_name_f <- recode_factor(var_name, "1" = "Very satisfied",
"2" = "Somewhat satisfied",
"3" = "Neutral",
"4" = "Somewhat dissatisfied",
"5" = "Very dissatisfied")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Very satisfied
|
63
|
21.00
|
|
Somewhat satisfied
|
125
|
41.67
|
|
Neutral
|
18
|
6.00
|
|
Somewhat dissatisfied
|
66
|
22.00
|
|
Very dissatisfied
|
28
|
9.33
|
In the current context, how satisfied are you with your ability to connect with others?
var_name <- w2$cov_decon_social
w2$var_name_f <- recode_factor(var_name, "1" = "Very satisfied",
"2" = "Somewhat satisfied",
"3" = "Neutral",
"4" = "Somewhat dissatisfied",
"5" = "Very dissatisfied")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalette3) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Very satisfied
|
27
|
9.00
|
|
Somewhat satisfied
|
92
|
30.67
|
|
Neutral
|
45
|
15.00
|
|
Somewhat dissatisfied
|
109
|
36.33
|
|
Very dissatisfied
|
27
|
9.00
|
In the current context, how would you rate your overall well-being?
var_name <- w2$cov_decon_wb
w2$var_name_f <- recode_factor(var_name, "0" = "0. As bad as it could be",
"1" = "1",
"2" = "2",
"3" = "3",
"4" = "4",
"5" = "5",
"6" = "6",
"7" = "7",
"8" = "8",
"9" = "9",
"10" = "10. As good as it could be")
var_name_f <- w2$var_name_f
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = rev(INTERACTfade)) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
- As bad as it could be
|
2
|
0.67
|
|
1
|
2
|
0.67
|
|
2
|
5
|
1.67
|
|
3
|
14
|
4.67
|
|
4
|
19
|
6.33
|
|
5
|
29
|
9.67
|
|
6
|
37
|
12.33
|
|
7
|
54
|
18.00
|
|
8
|
65
|
21.67
|
|
9
|
35
|
11.67
|
|
- As good as it could be
|
38
|
12.67
|
Section 10: Demographics
What is your current gender identity?
#gender
var_name <- w2$gender
w2$var_name_f <- recode_factor(var_name, "1"="Man",
"2"="Woman",
"3"="Trans man",
"4"="Trans woman",
"5"="Genderqueer/Gender non-conforming",
"6"="Different identity")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPaletteSet) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Man
|
97
|
32.33
|
|
Woman
|
199
|
66.33
|
|
Genderqueer/Gender non-conforming
|
3
|
1.00
|
|
Different identity
|
1
|
0.33
|
What sex were you assigned at birth?
*Asked only to new participants
# Sex
var_name <- w2$sex
w2$var_name_f <- recode_factor(var_name, "1"="Male",
"2"="Female",
"3"="Other")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPaletteSet) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Male
|
94
|
31.33
|
|
Female
|
201
|
67.00
|
|
Other
|
1
|
0.33
|
|
NA
|
4
|
1.33
|
What is your marital status? Are you…
#marital_status
var_name <- w2$marital_status
w2$var_name_f <- recode_factor(var_name, "1" = "Single", "2" = "Married/commonlaw", "3" = "Separated/divorced", "4" = "Widowed")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPaletteSet) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Single
|
64
|
21.33
|
|
Married/commonlaw
|
189
|
63.00
|
|
Separated/divorced
|
36
|
12.00
|
|
Widowed
|
11
|
3.67
|
Do you have children?
#children
var_name <- w2$children
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPaletteYN) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Yes
|
166
|
55.33
|
|
No
|
134
|
44.67
|
How many children do you have?
#living_children
w2$living_children[w2$living_children==-7] <- NA
ggplot(w2, aes(x= living_children)) + geom_bar(na.rm = TRUE,fill="#76D24A", binwidth = 1) + xlab("Number of children") + facet_grid(~ compare)

summary(w2$living_children)
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 1.000 2.000 2.000 2.157 3.000 6.000 134
What is your current living arrangement? Do you live
Participants could choose multiple answers
#living_arrange
w2$living_arrange_1[w2$living_arrange_1==-7] <- NA
var_name <- w2$living_arrange_1
w2$var_name_f <- recode_factor(var_name, "1" = "Alone", "0" = "With other people")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPaletteYN) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Alone
|
84
|
28
|
|
With other people
|
216
|
72
|
# Create a vector with variable names
response = paste0("living_arrange_", 2:7)
# Empty vector to stor output
living_arrange_prop <- c()
# Calculate univariate proportions
for(i in response){
living_arrange_prop[i] <- sum(w2[,i]) / nrow(w2)
}
# Transform
living_arrange_prop <- as.data.frame(living_arrange_prop)
living_arrange_prop$Response <- c("With a spouse (or partner)","With children","With grandchildren","With relatives or siblings?", "With friends", "With other people")
living_arrange_prop$plot<- factor(living_arrange_prop$Response, living_arrange_prop$Response)
ggplot(living_arrange_prop, aes(x = plot, y = living_arrange_prop)) + geom_bar(stat = "identity", fill = "#76D24A") + xlab("") + ylab("Percentage of participants who selected this answer") + theme(axis.text.x = element_text(size=12, angle=0, vjust=.6)) + scale_x_discrete(labels = function(plot) str_wrap(plot, width = 10))

living_arrange_prop$living_arrange_prop <- round(living_arrange_prop$living_arrange_prop*100,2)
living_arrange_prop <- setcolorder(living_arrange_prop, c("Response", "living_arrange_prop"))
colnames(living_arrange_prop) <- c("Response", "Percentage of participants who selected this answer")
living_arrange_prop <- living_arrange_prop[-c(3)]
kable(living_arrange_prop) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
|
Response
|
Percentage of participants who selected this answer
|
living_arrange_2
|
With a spouse (or partner)
|
63.67
|
living_arrange_3
|
With children
|
27.33
|
living_arrange_4
|
With grandchildren
|
0.67
|
living_arrange_5
|
With relatives or siblings?
|
3.00
|
living_arrange_6
|
With friends
|
2.67
|
living_arrange_7
|
With other people
|
2.67
|
How many children under the age of 16 live in your household?
#children_household
p <- ggplot(w2, aes(x = children_household)) +
geom_bar(na.rm = TRUE,fill="#76D24A", binwidth = 1) +
xlab("Number of children under 16 in household") +
facet_wrap(~ compare)
plot(p)

summary(w2$children_household)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.0000 0.0000 0.0000 0.2133 0.0000 3.0000
How many adults aged 16 or older live in your household including yourself?
ggplot(w2, aes(x= adults_household)) + geom_bar(na.rm = TRUE,fill="#76D24A", binwidth = 1) + xlab("Number of adults in household") + facet_wrap(~ compare)

summary(w2$adults_household)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1.000 1.000 2.000 2.057 2.000 20.000
Thinking about where you live now, are you
*Note: Question only asked to new (n=106) and moved participants (n=17) at w2, reporting w1 data for returning participants
#house_tenure
w2$house_tenure[w2$house_tenure==-7] <- NA
var_name <- w2$house_tenure
w2$var_name_f <- recode_factor(var_name, "1" = "An owner", "2" = "A tenant", "3" = "Resident in a relative or friend's home", "4" = "Resident other than in a relative or friend's home", "5" = "Other", "6" = "I don't know")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPaletteSet) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_grid(~compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
An owner
|
190
|
63.33
|
|
A tenant
|
90
|
30.00
|
|
Resident in a relative or friend’s home
|
6
|
2.00
|
|
Resident other than in a relative or friend’s home
|
1
|
0.33
|
|
Other
|
10
|
3.33
|
|
NA
|
3
|
1.00
|
In what type of dwelling do you currently live? Is it:
*Note: Question only asked to new (n=106) and moved participants (n=17) at w2, reporting w1 data for returning participants
#dwelling_type
w2$dwelling_type[w2$dwelling_type==-7] <- NA
var_name <- w2$dwelling_type
w2$var_name_f <- recode_factor(var_name, "1" = "Single detached house", "2" = "Semi-detached house", "3" = "Row house", "4" = "An apartment (or condo) in a duplex or triplex", "5" = "Apartment (or condo) in building with fewer than 5 storeys", "6" = "Apartment (or condo) in building with more than 5 storeys", "7" = "Mobile home/movable dwelling", "8" = "Senior's home", "9" = "Other", "77" = "NA")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPaletteSet) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response")+
facet_grid(~compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Single detached house
|
101
|
33.67
|
|
Semi-detached house
|
12
|
4.00
|
|
Row house
|
16
|
5.33
|
|
An apartment (or condo) in a duplex or triplex
|
12
|
4.00
|
|
Apartment (or condo) in building with fewer than 5 storeys
|
101
|
33.67
|
|
Apartment (or condo) in building with more than 5 storeys
|
44
|
14.67
|
|
Senior’s home
|
1
|
0.33
|
|
Other
|
8
|
2.67
|
|
NA
|
2
|
0.67
|
|
NA
|
3
|
1.00
|
When did you move to your current residence?
*Note: Question only asked to new (n=106) and moved participants (n=17) at w2, reporting w1 data for returning participants
#residence
w2$residence[w2$residence==""] <- NA
residence <- as.integer(format(as.Date(w2$residence),"%Y"))
time <- 2021 - residence
ggplot(w2, aes(x = time)) + geom_histogram(na.rm=TRUE, binwidth = 1, fill="#76D24A") + xlab("Years since moving to current residence") + facet_grid(~compare)

## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 0.00 5.00 14.00 15.96 23.00 71.00 3
Were you born in Canada?
*Note: Question only asked to new participants at w2 (n=106), reporting w1 data for returning participants
#born_can
var_name <- w2$born_can
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPaletteYN) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Yes
|
213
|
71.00
|
|
No
|
83
|
27.67
|
|
NA
|
4
|
1.33
|
When did you move to Canada?
*Note: Question only asked to new participants at w2 or(n=106), reporting w1 data for returning participants Question asked only to those not born in Canada (n=83)
#move_can
w2$move_can[w2$move_can==-7] <- NA
ggplot(w2, aes(x = w2$move_can)) + geom_histogram (na.rm=TRUE, binwidth = 1, fill="#76D24A") + xlab("Year of move to Canada")

## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 1948 1966 1980 1981 1998 2019 217
To which ethnic or cultural group(s) do you belong? (Check all that apply)
*Note: Question only asked to new participants at w2 or(n=106), reporting w1 data for returning participants
var_name <- w2$group
w2$var_name_f <- as.factor(var_name)
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPaletteSet) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Asian
|
24
|
8.00
|
|
Black
|
1
|
0.33
|
|
Caucasian
|
236
|
78.67
|
|
Latin American
|
5
|
1.67
|
|
Other
|
10
|
3.33
|
|
Mixed identity
|
13
|
4.33
|
|
NA
|
11
|
3.67
|
Which category best describes your annual household income, taking into account all sources of income?
#w2$income[w2$income==-7] <- NA
var_name <- w2$income
w2$var_name_f <- recode_factor(var_name, "1" = "No income", "2" = "$1 to $9,999", "3" = "$10,000 to $14,999", "4" = "$15,000 to $19,999", "5" = "$20,000 to $29,999", "6" = "$30,000 to $39,999", "7" = "$40,000 to $49,999", "8" = "$50,000 to $99,999", "9" = "$100,000 to $149,999", "10" = " $150,000 to $199,999", "11" = "$200,000 or more", "77" = "Don't know/prefer no answer", "-7" = "NA")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = rev(INTERACTfade)) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
$1 to $9,999
|
1
|
0.33
|
|
$10,000 to $14,999
|
2
|
0.67
|
|
$15,000 to $19,999
|
5
|
1.67
|
|
$20,000 to $29,999
|
11
|
3.67
|
|
$30,000 to $39,999
|
10
|
3.33
|
|
$40,000 to $49,999
|
17
|
5.67
|
|
$50,000 to $99,999
|
68
|
22.67
|
|
$100,000 to $149,999
|
48
|
16.00
|
|
$150,000 to $199,999
|
36
|
12.00
|
|
$200,000 or more
|
50
|
16.67
|
|
Don’t know/prefer no answer
|
52
|
17.33
|
To what extent does this annual household income allow you to satisfy your household’s needs?
#income_needs
var_name <- w2$income_needs
w2$var_name_f <- recode_factor(var_name, "1" = "Very well", "2" = "Well", "3" = "Not so well", "4" = "Not at all", "77" = "Don't know/prefer no answer")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTshortfade) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Very well
|
154
|
51.33
|
|
Well
|
111
|
37.00
|
|
Not so well
|
29
|
9.67
|
|
Don’t know/prefer no answer
|
6
|
2.00
|
What are your houshold’s total monthly housing costs?
This includes rent payments, mortgage payments, property taxes, condominium fees, and utility payments, like heating, water and electricity. If you live with roommates, please only include your share of the housing costs.
#housing costs
w2$housing_cost[w2$housing_cost==-7] <- NA
# ggplot(t_1, aes(x = housing_cost)) + geom_histogram (na.rm =TRUE, binwidth = 1, fill="#76D24A") + xlab ("Monthly housing costs") + facet_wrap(~ compare)
summary(w2$housing_cost)
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 75 1015 1805 3570 3000 200000 97
What is your highest education level?
#education
var_name <- w2$education
w2$var_name_f <- recode_factor(var_name, "1" = "Primary/Elementary school", "2" = "Secondary school", "3" = "Trade/Technical school or college diploma", "4" = "University degree", "5" = "Graduate degree", "77" ="I don't know/Prefer not to answer")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPaletteSet) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Secondary school
|
21
|
7.00
|
|
Trade/Technical school or college diploma
|
34
|
11.33
|
|
University degree
|
107
|
35.67
|
|
Graduate degree
|
137
|
45.67
|
|
I don’t know/Prefer not to answer
|
1
|
0.33
|
What is your current employment status?
#employment
var_name <- w2$employment
w2$var_name_f <- recode_factor(var_name, "1" = "Retired and not working", "2" = "Employed full-time", "3" = "Employed part-time", "4" = "Unemployed and looking for work", "5" = "Unemployed and not looking for work", "6" ="Other" )
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPaletteSet) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Retired and not working
|
91
|
30.33
|
|
Employed full-time
|
114
|
38.00
|
|
Employed part-time
|
46
|
15.33
|
|
Unemployed and looking for work
|
12
|
4.00
|
|
Unemployed and not looking for work
|
9
|
3.00
|
|
Other
|
28
|
9.33
|
How has the COVID-19 pandemic impacted your job?
w2$employment_covid_1[w2$employment_covid_1==0] <- 2
w2$employment_covid_2[w2$employment_covid_2==0] <- 2
w2$employment_covid_3[w2$employment_covid_3==0] <- 2
w2$employment_covid_4[w2$employment_covid_4==0] <- 2
w2$employment_covid_5[w2$employment_covid_5==0] <- 2
w2$employment_covid_6[w2$employment_covid_6==0] <- 2
w2$employment_covid_7[w2$employment_covid_7==0] <- 2
w2$employment_covid_8[w2$employment_covid_8==0] <- 2
w2$employment_covid_9[w2$employment_covid_9==0] <- 2
w2$employment_covid_10[w2$employment_covid_10==0] <- 2
w2$employment_covid_99[w2$employment_covid_99==0] <- 2
t_1 <- select(w2, compare, employment_covid_1,employment_covid_2, employment_covid_3, employment_covid_4, employment_covid_5, employment_covid_6, employment_covid_7, employment_covid_8, employment_covid_9, employment_covid_10)
t_1 <- pivot_longer(t_1,
cols = starts_with("employment_covid_"),
names_to = "feature",
names_prefix = "employment_covid_",
values_to = "values",
values_drop_na = TRUE)
t_1$values <- recode_factor(t_1$values, "1" = "Yes", "2" = "No", "77" = "I don't know")
## rename
t_1$feature[t_1$feature== "1"] <- "I work from home."
t_1$feature[t_1$feature== "2"] <- "I work partly from home, partly at my normal workplace"
t_1$feature[t_1$feature== "3"] <- "I continue to work at my normal place of work."
t_1$feature[t_1$feature== "4"] <- "My paid work #hours have been reduced."
t_1$feature[t_1$feature== "5"] <- "My hourly rate has been reduced"
t_1$feature[t_1$feature== "6"] <- "My paid work hours have increased"
t_1$feature[t_1$feature== "7"] <- "My hourly rate has increased."
t_1$feature[t_1$feature== "8"] <- "My job has been deemed essential by the government."
t_1$feature[t_1$feature== "9"] <- "I lost my job"
t_1$feature[t_1$feature== "10"] <-"I have started a new job"
t_1<- t_1 %>%
group_by(compare, feature, values) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
p <- ggplot(t_1, aes(x= feature, y= pct, fill= values)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
coord_flip() +
scale_fill_manual(values = INTERACTPaletteYN) +
ylab("Percent") +
xlab("Response") +
facet_wrap(~ compare) +
scale_x_discrete(labels = function(feature) str_wrap(feature, width = 30))
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
feature
|
values
|
n
|
pct
|
|
I continue to work at my normal place of work.
|
Yes
|
38
|
12.67
|
|
I continue to work at my normal place of work.
|
No
|
262
|
87.33
|
|
I have started a new job
|
Yes
|
5
|
1.67
|
|
I have started a new job
|
No
|
295
|
98.33
|
|
I lost my job
|
Yes
|
13
|
4.33
|
|
I lost my job
|
No
|
287
|
95.67
|
|
I work from home.
|
Yes
|
75
|
25.00
|
|
I work from home.
|
No
|
225
|
75.00
|
|
I work partly from home, partly at my normal workplace
|
Yes
|
46
|
15.33
|
|
I work partly from home, partly at my normal workplace
|
No
|
254
|
84.67
|
|
My hourly rate has been reduced
|
Yes
|
3
|
1.00
|
|
My hourly rate has been reduced
|
No
|
297
|
99.00
|
|
My hourly rate has increased.
|
Yes
|
6
|
2.00
|
|
My hourly rate has increased.
|
No
|
294
|
98.00
|
|
My job has been deemed essential by the government.
|
Yes
|
25
|
8.33
|
|
My job has been deemed essential by the government.
|
No
|
275
|
91.67
|
|
My paid work #hours have been reduced.
|
Yes
|
26
|
8.67
|
|
My paid work #hours have been reduced.
|
No
|
274
|
91.33
|
|
My paid work hours have increased
|
Yes
|
6
|
2.00
|
|
My paid work hours have increased
|
No
|
294
|
98.00
|
Which of the following best describes your usual work schedule at your current job?
#shift
w2$shift[w2$shift==-7] <- NA
var_name <- w2$shift
w2$var_name_f <- recode_factor(var_name, "1" = "A regular daytime schedule or shift.", "2" = "A regular evening shift ", "3" = "A regular night shift", "4" = "A rotating shift, a split shift, or an irregular schedule", "5" = "On call or casual", "6" ="Other")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPalettecont) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
A regular daytime schedule or shift.
|
127
|
42.33
|
|
A regular evening shift
|
2
|
0.67
|
|
A rotating shift, a split shift, or an irregular schedule
|
18
|
6.00
|
|
On call or casual
|
8
|
2.67
|
|
Other
|
5
|
1.67
|
|
NA
|
140
|
46.67
|
Do you use a mobility aid when you walk?
#aid
var_name <- w2$aid
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No")
var_name_f <- w2$var_name_f
##### Table
t_1 <- w2 %>%
group_by(compare, var_name_f) %>%
dplyr::summarise(n = n()) %>%
dplyr:: mutate(pct = round(100*n/sum(n),2))
##### Figure
p <- ggplot(t_1, aes(x = var_name_f, y = pct, fill = var_name_f)) + theme(axis.text.x = element_text(angle=0, vjust = .6)) +
geom_bar(stat= "identity") +
scale_fill_manual(values = INTERACTPaletteYN) +
guides(fill=FALSE) +
ylab("Count") +
xlab("Response") +
facet_wrap(~ compare)
plot(p)

kable(t_1) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare
|
var_name_f
|
n
|
pct
|
|
Yes
|
4
|
1.33
|
|
No
|
296
|
98.67
|
# 1 Cane
# 2 Walker
# 3 Scooter
# 4 Wheelchair
# 5 Other (Please specify)
# -7 Not applicable
# table(w2$aid_type_txt)
Type <- c("Cane", "Walker", "Guide dog", "Poles")
Count <- c("1", "1", "1", "2")
summaryaid_type <- data.frame(Type, Count)
kable(summaryaid_type) %>% kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
Type
|
Count
|
Cane
|
1
|
Walker
|
1
|
Guide dog
|
1
|
Poles
|
2
|