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 Saskatoon study evaluates the impacts of a Bus Rapid Transit system (BRT) along three major roadways. Participants who rode the bus at least once in a typical month 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 and partner newsletters. In Saskatoon, 110 returning participants, and 155 new participants completed the Health Questionnaire, for a total of 265 responses. Responses were collected from September 17th, 2020 to February 7th, 2021.

Section 1: Transportation

Which Saskatoon Transit Go Pass do you own?

var_name <- w2$sask_bus_pass
w2$var_name_f <- recode_factor(var_name, "1" = "Monthly adult pass", 
                                                "2" = "Eco Pass", 
                                                "3"= "UPass", 
                                                "4" = "Student Pass", 
                                                "5" = "Discounted Pass", 
                                                "6" = "Low Income Pass", 
                                                "7" = "I do not use a Go pass, I use a multi-use pass", 
                                                "8" ="I do not use a Go pass, I use cash", 
                                                "9" = "I do not currently ride the bus")
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=90, 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
Monthly adult pass 21 7.92
Eco Pass 13 4.91
UPass 32 12.08
Student Pass 25 9.43
Discounted Pass 6 2.26
Low Income Pass 11 4.15
I do not use a Go pass, I use a multi-use pass 55 20.75
I do not use a Go pass, I use cash 24 9.06
I do not currently ride the bus 78 29.43

On a scale of 1 to 4, with 1 being ‘very safe and 4 being ’very unsafe’, overall, how safe do you think traveling by bus is in your city?

var_name <- w2$bus_safe
w2$var_name_f <- recode_factor(var_name, "1" = "Very Safe", 
                                                "2" = "Somewhat Safe", 
                                                "3" = "Somewhat Unsafe", 
                                                "4" = "Very Unsafe", 
                                                "77" = "I don't know")


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
Very Safe 86 32.45
Somewhat Safe 135 50.94
Somewhat Unsafe 34 12.83
Very Unsafe 7 2.64
I don’t know 3 1.13

On a scale of 1 to 4, with 1 being ‘very reliable’ and 4 being ‘very unreliable’, overall, how reliable do you think traveling by bus is in your city?

var_name <- w2$bus_reliable
w2$var_name_f <- recode_factor(var_name, "1" = "Very Reliable", 
                                                "2" = "Somewhat Reliable", 
                                                "3" = "Somewhat Unreliable", 
                                                "4" = "Very Unreliable", 
                                                "77" = "I don't know")
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
Very Reliable 42 15.85
Somewhat Reliable 134 50.57
Somewhat Unreliable 65 24.53
Very Unreliable 19 7.17
I don’t know 5 1.89

On a scale of 1 to 4, with 1 being ‘very convenient’ and 4 being very inconvenient’, overall, how convenient do you think traveling by bus is in your city?

var_name <- w2$bus_convenient
w2$var_name_f <- recode_factor(var_name, "1" = "Very convenient", 
                                                "2" = "Somewhat convenient", 
                                                "3" = "Somewhat inconvenient", 
                                                "4" = "Very inconvenient", 
                                                "77" = "I don't know")
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
Very convenient 21 7.92
Somewhat convenient 113 42.64
Somewhat inconvenient 89 33.58
Very inconvenient 38 14.34
I don’t know 4 1.51

How often do you typically travel by bus during each season?

Fall

ggplot(w2, aes(x =  bus_freq_a
)) + geom_histogram(na.rm = TRUE,bins = 10, fill = "#E5364D") + xlab("Days in Fall") +
  theme(axis.text.x = element_text(angle = 30, hjust = 1))

summary(w2$bus_freq_a)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00    3.00   26.00   31.11   65.00   91.00

Winter

ggplot(w2, aes(x =  bus_freq_b
)) + geom_histogram(na.rm = TRUE,bins = 10, fill = "#1596FF") + xlab("Days in Winter") +
  theme(axis.text.x = element_text(angle = 30, hjust = 1))

summary(w2$bus_freq_b)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00    3.00   26.00   33.35   65.00   91.00

Spring

ggplot(w2, aes(x =  bus_freq_c
)) + geom_histogram(na.rm = TRUE,bins = 10, fill = "#76D24A") + xlab("Days in Spring") +
  theme(axis.text.x = element_text(angle = 30, hjust = 1))

summary(w2$bus_freq_c)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00    0.00   15.00   27.44   52.00   91.00

Summer

ggplot(w2, aes(x =  bus_freq_d
)) + geom_histogram(na.rm = TRUE,bins = 10, fill = "#FFD21F") + xlab("Days in Summer") +
  theme(axis.text.x = element_text(angle = 30, hjust = 1))

summary(w2$bus_freq_d)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00    0.00    6.00   22.66   45.00   91.00

Do you currently travel on any of the following streets when you travel by bus in Saskatoon?

a. 8th street

var_name <- w2$saskroads_a
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "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()) %>%
            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("Percent") +
      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 137 51.70
No 119 44.91
I don’t know 9 3.40

b. 22nd street

var_name <- w2$saskroads_b
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "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()) %>%
            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("Percent") +
      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 78 29.43
No 171 64.53
I don’t know 16 6.04

c. College Drive

var_name <- w2$saskroads_c
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "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()) %>%
            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("Percent") +
      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 152 57.36
No 99 37.36
I don’t know 14 5.28

d. Preston Avenue

var_name <- w2$saskroads_d
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "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()) %>%
            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("Percent") +
      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 125 47.17
No 127 47.92
I don’t know 13 4.91

e. Attridge Drive

var_name <- w2$saskroads_e
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "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()) %>%
            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("Percent") +
      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 40 15.09
No 205 77.36
I don’t know 20 7.55

f. Warman Rd

var_name <- w2$saskroads_f
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "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()) %>%
            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("Percent") +
      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 37 13.96
No 208 78.49
I don’t know 20 7.55

g. Idylwyld Dr N

var_name <- w2$saskroads_g
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "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()) %>%
            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("Percent") +
      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 58 21.89
No 193 72.83
I don’t know 14 5.28

h. 3rd Avenue N

var_name <- w2$saskroads_h
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "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()) %>%
            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("Percent") +
      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 90 33.96
No 157 59.25
I don’t know 18 6.79

i. Broadway Avenue

var_name <- w2$saskroads_i
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "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()) %>%
            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("Percent") +
      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 122 46.04
No 130 49.06
I don’t know 13 4.91

How much would you agree with the following statement: “I would like to travel by bus in Saskatoon more than I do now”?

var_name <- w2$sask_bus_more
w2$var_name_f <- recode_factor(var_name, "1" = "Strongly agree", 
                                                "2" = "Somewhat agree", 
                                                "3" = "Somewhat disagree", 
                                                "4" = "Strongly disagree", 
                                                "77" = "I don't know")
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 = INTERACTshortfade) +
  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
Strongly agree 79 29.81
Somewhat agree 107 40.38
Somewhat disagree 39 14.72
Strongly disagree 29 10.94
I don’t know 11 4.15

How much more likely would you be to travel by bus more if?

a. the bus on the main part of your route ran every 10 minutes or less?

var_name <- w2$bus_moti_a
w2$var_name_f <- recode_factor(var_name, "1" = "Much more likely", 
                                                "2" = "Somewhat more likely", 
                                                "3" = "Not at all more likely", 
                                                "77" = "I don't know")
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 = INTERACTshorterfade) +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("") +
      ggtitle("") +  
  facet_wrap(~ compare)
plot(p)

#### b. the bus route took you closer to your destination?

var_name <- w2$bus_moti_b
w2$var_name_f <- recode_factor(var_name, "1" = "Much more likely", 
                                                "2" = "Somewhat more likely", 
                                                "3" = "Not at all more likely", 
                                                "77" = "I don't know")
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 = INTERACTshorterfade) +
  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
Much more likely 142 53.58
Somewhat more likely 80 30.19
Not at all more likely 36 13.58
I don’t know 7 2.64

c. the bus and shelters were cleaner and in better condition?

var_name <- w2$bus_moti_c
w2$var_name_f <- recode_factor(var_name, "1" = "Much more likely", 
                                                "2" = "Somewhat more likely", 
                                                "3" = "Not at all more likely", 
                                                "77" = "I don't know")
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 = INTERACTshorterfade) +
  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
Much more likely 108 40.75
Somewhat more likely 89 33.58
Not at all more likely 58 21.89
I don’t know 10 3.77

d. the buses were on time and transfers were more reliable?

var_name <- w2$bus_moti_d
w2$var_name_f <- recode_factor(var_name, "1" = "Much more likely", 
                                                "2" = "Somewhat more likely", 
                                                "3" = "Not at all more likely", 
                                                "77" = "I don't know")
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 = INTERACTshorterfade) +
  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
Much more likely 179 67.55
Somewhat more likely 58 21.89
Not at all more likely 21 7.92
I don’t know 7 2.64

e. the cost of bus passes or fare was lower?

var_name <- w2$bus_moti_e
w2$var_name_f <- recode_factor(var_name, "1" = "Much more likely", 
                                                "2" = "Somewhat more likely", 
                                                "3" = "Not at all more likely", 
                                                "77" = "I don't know")
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 = INTERACTshorterfade) +
  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
Much more likely 97 36.60
Somewhat more likely 84 31.70
Not at all more likely 73 27.55
I don’t know 11 4.15

Other

print(w2$bus_moti_f_txt[w2$bus_moti_f_txt!= ""])
##  [1] "more and more frequent buses available on weekends"                                                                                                                                                         
##  [2] "If there was no COVID"                                                                                                                                                                                      
##  [3] "If there wasn't Covid"                                                                                                                                                                                      
##  [4] "More professional Drivers"                                                                                                                                                                                  
##  [5] "solar powered heated bus shelters would make the difference"                                                                                                                                                
##  [6] "If they were lit , would be great if they had a security guard..."                                                                                                                                          
##  [7] "Covid has thrown a wrench in my travel plans."                                                                                                                                                              
##  [8] "It took less time to take the bus than to walk"                                                                                                                                                             
##  [9] "More direct routes with less transfers"                                                                                                                                                                     
## [10] "Covid19 Pandemic is over"                                                                                                                                                                                   
## [11] "If COVID-19 and close contact on buses was not a concern."                                                                                                                                                  
## [12] "Travelling by bus is not economic for me as I have my own vehicle I use to get around the city."                                                                                                            
## [13] "If I lived along a decent transit line"                                                                                                                                                                     
## [14] "Bus were safe from risk of COVID-19 infection"                                                                                                                                                              
## [15] "If grad.students had bus pass in Summer"                                                                                                                                                                    
## [16] "Covid ends"                                                                                                                                                                                                 
## [17] "evening service to my area after 6 PM was more frequent"                                                                                                                                                    
## [18] "Different bus routes that have the same start and end points run at staggered intervals"                                                                                                                    
## [19] "Mandatory masks were enforced"                                                                                                                                                                              
## [20] "There wasn't the threat of COVID"                                                                                                                                                                           
## [21] "Running a bit later"                                                                                                                                                                                        
## [22] "The routes were faster and more efficientcien"                                                                                                                                                              
## [23] "If it were safer"                                                                                                                                                                                           
## [24] "With a growing city time on transfers need to be increased"                                                                                                                                                 
## [25] "If there wasn't a Covid-19 outbreak in our city"                                                                                                                                                            
## [26] "Travel times were shorter"                                                                                                                                                                                  
## [27] "the pandemic was over, and I was physically back in my office"                                                                                                                                              
## [28] "Once COVID is done"                                                                                                                                                                                         
## [29] "I would ride the bus more if it didn't have to go to the central bus terminal before going to my destination (Pacific Heights to Exhibition)."                                                              
## [30] "Bus system took into account busier times of day. There have been many times when the bus was too full and it was easier to walk the 30-45 minutes than take the chance that the next bus would have space."
## [31] "During COVID if I were confident that everyone would be wearing a mask."                                                                                                                                    
## [32] "If there were more buses going from my area to the university in a timely or express manner"                                                                                                                
## [33] "If it didn’t take so long to get across city"                                                                                                                                                               
## [34] "Safer"                                                                                                                                                                                                      
## [35] "Better route in Brighton area"                                                                                                                                                                              
## [36] "there are few bus route options in the city"                                                                                                                                                                
## [37] "There was better security (there are a lot of creepy people)"                                                                                                                                               
## [38] "Heated central terminals, it's 2020 ffs"                                                                                                                                                                    
## [39] "transfers were minimal"                                                                                                                                                                                     
## [40] "Bus had free wifi and winter shelters"
print(w2$bus_moti_g_txt[w2$bus_moti_g_txt!= ""])
##  [1] "each stop having heated seats or protection from wind"                 
##  [2] "If I was vaccinated for COVID"                                         
##  [3] "If everyone consistently wore masks properly"                          
##  [4] "right now I will not travel more / at all by bus due to Covid concerns"
##  [5] "If they were heated and were more of a shelter from the weather"       
##  [6] "The bus routes included circle drive routes"                           
##  [7] "Operating earlier and later"                                           
##  [8] "Route out to the new Costco area"                                      
##  [9] "the bus shelters are not adequate for the winter"                      
## [10] "Bus hubs or large stops were close to amenities"

Rank the following in order of how much they would influence your decision to use the bus.

1 as least important, 7 as most important #### a. the bus on the main part of your route ran every 10 minutes or less?

var_name <- w2$bus_moti_rank_a
w2$var_name_f <- as.factor(var_name)
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 = INTERACTPalettecont) +
  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 85 32.08
2 35 13.21
3 28 10.57
4 29 10.94
5 16 6.04
6 26 9.81
7 46 17.36

b. the bus route took you closer to your destination?

var_name <- w2$bus_moti_rank_b
w2$var_name_f <- as.factor(var_name)
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 = INTERACTPalettecont) +
  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 38 14.34
2 53 20.00
3 43 16.23
4 37 13.96
5 32 12.08
6 27 10.19
7 35 13.21

c. the bus and shelters were cleaner and in better condition?

var_name <- w2$bus_moti_rank_c
w2$var_name_f <- as.factor(var_name)
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 = INTERACTPalettecont) +
  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 24 9.06
2 17 6.42
3 39 14.72
4 68 25.66
5 66 24.91
6 23 8.68
7 28 10.57

d. the buses were on time and transfers were more reliable?

var_name <- w2$bus_moti_rank_d
w2$var_name_f <- as.factor(var_name)
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 = INTERACTPalettecont) +
  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 54 20.38
2 54 20.38
3 41 15.47
4 29 10.94
5 20 7.55
6 23 8.68
7 44 16.60

e. the cost of bus passes or fare was lower?

var_name <- w2$bus_moti_rank_e
w2$var_name_f <- as.factor(var_name)
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 = INTERACTPalettecont) +
  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 41 15.47
2 27 10.19
3 37 13.96
4 57 21.51
5 53 20.00
6 19 7.17
7 31 11.70

Place the slider between the following features of a future bus system, based on how important they are to you, with the slider closer to the more important feature.

Greater frequency of buses [=0] / Bus stops closer to destination [=100]

ggplot(w2,
       aes(x = bus_moti_slider 
       )) + geom_histogram(na.rm = TRUE, bins = 15, fill= "#76D24A")  + xlab("Rank") + facet_grid( ~ compare)

summary(w2$bus_moti_slider)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00   18.00   35.00   43.09   70.00  100.00

Do you think Saskatoon Transit Service today is:

a. Reliable

var_name <- w2$sask_bus_now_a
w2$var_name_f <- recode_factor(var_name, "1" = "Very", 
                                                "2" = "Moderately", 
                                                "3" = "Slightly", 
                                                "4" = "Not at all",
                                                "77" = "I don't know")
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 = INTERACTshortfade) +
  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
Very 28 10.57
Moderately 141 53.21
Slightly 60 22.64
Not at all 26 9.81
I don’t know 10 3.77

b. Clean

var_name <- w2$sask_bus_now_b
w2$var_name_f <- recode_factor(var_name, "1" = "Very", 
                                                "2" = "Moderately", 
                                                "3" = "Slightly", 
                                                "4" = "Not at all",
                                                "77" = "I don't know")
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 = INTERACTshortfade) +
  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
Very 43 16.23
Moderately 125 47.17
Slightly 69 26.04
Not at all 15 5.66
I don’t know 13 4.91

c. Safe

var_name <- w2$sask_bus_now_c
w2$var_name_f <- recode_factor(var_name, "1" = "Very", 
                                                "2" = "Moderately", 
                                                "3" = "Slightly", 
                                                "4" = "Not at all",
                                                "77" = "I don't know")
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 = INTERACTshortfade) +
  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
Very 75 28.30
Moderately 118 44.53
Slightly 47 17.74
Not at all 14 5.28
I don’t know 11 4.15

d. Convenient

var_name <- w2$sask_bus_now_d
w2$var_name_f <- recode_factor(var_name, "1" = "Very", 
                                                "2" = "Moderately", 
                                                "3" = "Slightly", 
                                                "4" = "Not at all",
                                                "77" = "I don't know")
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 = INTERACTshortfade) +
  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
Very 18 6.79
Moderately 86 32.45
Slightly 102 38.49
Not at all 50 18.87
I don’t know 9 3.40

e. Too expensive

var_name <- w2$sask_bus_now_e
w2$var_name_f <- recode_factor(var_name, "1" = "Very", 
                                                "2" = "Moderately", 
                                                "3" = "Slightly", 
                                                "4" = "Not at all",
                                                "77" = "I don't know")
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 = INTERACTshortfade) +
  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
Very 30 11.32
Moderately 62 23.40
Slightly 88 33.21
Not at all 60 22.64
I don’t know 25 9.43

f. Too cheap

var_name <- w2$sask_bus_now_f
w2$var_name_f <- recode_factor(var_name, "1" = "Very", 
                                                "2" = "Moderately", 
                                                "3" = "Slightly", 
                                                "4" = "Not at all",
                                                "77" = "I don't know")
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 = INTERACTshortfade) +
  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
Very 3 1.13
Moderately 11 4.15
Slightly 21 7.92
Not at all 199 75.09
I don’t know 31 11.70

g. Professional

var_name <- w2$sask_bus_now_g
w2$var_name_f <- recode_factor(var_name, "1" = "Very", 
                                                "2" = "Moderately", 
                                                "3" = "Slightly", 
                                                "4" = "Not at all",
                                                "77" = "I don't know")
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 = INTERACTshortfade) +
  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
Very 52 19.62
Moderately 103 38.87
Slightly 72 27.17
Not at all 19 7.17
I don’t know 19 7.17

h. Environmentally friendly

var_name <- w2$sask_bus_now_h
w2$var_name_f <- recode_factor(var_name, "1" = "Very", 
                                                "2" = "Moderately", 
                                                "3" = "Slightly", 
                                                "4" = "Not at all",
                                                "77" = "I don't know")
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 = INTERACTshortfade) +
  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
Very 48 18.11
Moderately 90 33.96
Slightly 77 29.06
Not at all 19 7.17
I don’t know 31 11.70

Have you ever heard of the Bus Rapid Transit (BRT) Corridors in Saskatoon?

var_name <- w2$brt_familiarity
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "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()) %>%
            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("Percent") +
      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 180 67.92
No 85 32.08

Do you think that the Bus Rapid Transit (BRT) corridors are a good or bad idea for Saskatoon? It is

var_name <- w2$brt_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

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 = INTERACTshortfade) +
  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
Very good idea 135 50.94
Somewhat good idea 108 40.75
Somewhat bad idea 8 3.02
Very bad idea 6 2.26
I don’t know 8 3.02

Do you think the BRT will be good for:

a. The Environment

var_name <- w2$brt_good_a
w2$var_name_f <- recode_factor(var_name, "1" = "Very good", 
                                                "2" = "Somewhat good", 
                                                "3" = "Somewhat bad", 
                                                "4" = "Very bad",
                                                "77" = "I don't know")
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 = INTERACTshortfade) +
  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
Very good 84 31.70
Somewhat good 110 41.51
Somewhat bad 25 9.43
Very bad 7 2.64
I don’t know 39 14.72

b. Increasing access to transportation

var_name <- w2$brt_good_b
w2$var_name_f <- recode_factor(var_name, "1" = "Very good", 
                                                "2" = "Somewhat good", 
                                                "3" = "Somewhat bad", 
                                                "4" = "Very bad",
                                                "77" = "I don't know")
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 = INTERACTshortfade) +
  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
Very good 163 61.51
Somewhat good 75 28.30
Somewhat bad 7 2.64
Very bad 4 1.51
I don’t know 16 6.04

c. Making Saskatoon a vibrant city

var_name <- w2$brt_good_c
w2$var_name_f <- recode_factor(var_name, "1" = "Very good", 
                                                "2" = "Somewhat good", 
                                                "3" = "Somewhat bad", 
                                                "4" = "Very bad",
                                                "77" = "I don't know")
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 = INTERACTshortfade) +
  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
Very good 104 39.25
Somewhat good 110 41.51
Somewhat bad 10 3.77
Very bad 6 2.26
I don’t know 35 13.21

d. Tourism

var_name <- w2$brt_good_d
w2$var_name_f <- recode_factor(var_name, "1" = "Very good", 
                                                "2" = "Somewhat good", 
                                                "3" = "Somewhat bad", 
                                                "4" = "Very bad",
                                                "77" = "I don't know")
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 = INTERACTshortfade) +
  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
Very good 87 32.83
Somewhat good 107 40.38
Somewhat bad 12 4.53
Very bad 6 2.26
I don’t know 53 20.00

e. Reducing traffic congestion

var_name <- w2$brt_good_e
w2$var_name_f <- recode_factor(var_name, "1" = "Very good", 
                                                "2" = "Somewhat good", 
                                                "3" = "Somewhat bad", 
                                                "4" = "Very bad",
                                                "77" = "I don't know")
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 = INTERACTshortfade) +
  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
Very good 113 42.64
Somewhat good 95 35.85
Somewhat bad 21 7.92
Very bad 10 3.77
I don’t know 26 9.81

f. Health

var_name <- w2$brt_good_f
w2$var_name_f <- recode_factor(var_name, "1" = "Very good", 
                                                "2" = "Somewhat good", 
                                                "3" = "Somewhat bad", 
                                                "4" = "Very bad",
                                                "77" = "I don't know")
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 = INTERACTshortfade) +
  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
Very good 70 26.42
Somewhat good 115 43.40
Somewhat bad 12 4.53
Very bad 5 1.89
I don’t know 63 23.77

g. Local business

var_name <- w2$brt_good_g
w2$var_name_f <- recode_factor(var_name, "1" = "Very good", 
                                                "2" = "Somewhat good", 
                                                "3" = "Somewhat bad", 
                                                "4" = "Very bad",
                                                "77" = "I don't know")
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 = INTERACTshortfade) +
  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
Very good 104 39.25
Somewhat good 99 37.36
Somewhat bad 13 4.91
Very bad 8 3.02
I don’t know 41 15.47

Will you likely travel by bus more than you currently do once the Bus Rapid Transit (BRT) corridors are in place?

var_name <- w2$brt_bus_more
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "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()) %>%
            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("Percent") +
      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 206 77.74
No 59 22.26

Do you currently have a valid driver’s license?

var_name <- w2$license
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "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()) %>%
            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("Percent") +
      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 80.38
No 52 19.62

Do you have access to a car?

var_name <- w2$car_access
w2$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "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()) %>%
            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("Percent") +
      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 203 76.6
No 62 23.4

How do you most often access a vehicle?

My household owns a vehicle

w2$cars_access_where_1[w2$cars_access_where_1==0] <- 2
w2$cars_access_where_1[w2$cars_access_where_1==-7] <- NA

var_name <- w2$cars_access_where_1
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()) %>%
            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("Percent") +
      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 187 70.57
No 16 6.04
NA 62 23.40

I borrow a friend’s or relative’s vehicle

w2$cars_access_where_2[w2$cars_access_where_2==0] <- 2
w2$cars_access_where_2[w2$cars_access_where_2==-7] <- NA

var_name <- w2$cars_access_where_2
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()) %>%
            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("Percent") +
      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 13 4.91
No 190 71.70
NA 62 23.40

I am a member of a car-sharing program (Saskatoon CarShare Co-op, etc.)

w2$cars_access_where_3[w2$cars_access_where_3==0] <- 2
w2$cars_access_where_3[w2$cars_access_where_3==-7] <- NA

var_name <- w2$cars_access_where_3
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()) %>%
            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("Percent") +
      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 5 1.89
No 198 74.72
NA 62 23.40

How many cars, trucks, or vans are kept in your household?

w2$cars_household[w2$cars_household==-7] <- NA

var_name <- w2$cars_household
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()) %>%
            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", fill= "#1596FF") +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 93 35.09
2 67 25.28
3 16 6.04
4 7 2.64
5 3 1.13
6 1 0.38
NA 78 29.43

How much do you enjoy using each transportation 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("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 127 47.92
2 79 29.81
3 32 12.08
4 Not at all 12 4.53
Not applicable 15 5.66

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 79 29.81
2 54 20.38
3 39 14.72
4 Not at all 47 17.74
Not applicable 46 17.36

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 34 12.83
2 73 27.55
3 86 32.45
4 Not at all 54 20.38
Not applicable 18 6.79

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 104 39.25
2 80 30.19
3 44 16.60
4 Not at all 15 5.66
Not applicable 22 8.30

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 3 1.13
2 5 1.89
3 9 3.40
4 Not at all 51 19.25
Not applicable 197 74.34

f. Other (Please specify)

print(w2$preferred_mode_f_txt[w2$preferred_mode_f_txt!=""])
## [1] "It's a pandemic I'm almost entirely at home and don't enjoy it"
## [2] "Cab or Uber"                                                   
## [3] "Taxi"

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("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 135 50.94
2 70 26.42
3 38 14.34
4 Not at all 8 3.02
Not applicable 14 5.28

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 79 29.81
2 51 19.25
3 46 17.36
4 Not at all 42 15.85
Not applicable 47 17.74

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(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("") 
plot(p)

kable(t_1)  %>%   kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
var_name_f n pct
1 A lot 61 23.02
2 83 31.32
3 60 22.64
4 Not at all 46 17.36
Not applicable 15 5.66

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 108 40.75
2 69 26.04
3 46 17.36
4 Not at all 22 8.30
Not applicable 20 7.55

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 2 0.75
2 8 3.02
3 7 2.64
4 Not at all 41 15.47
Not applicable 207 78.11

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 177 66.79
1 12 4.53
2 15 5.66
3 20 7.55
4 11 4.15
5 20 7.55
6 6 2.26
7 4 1.51

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.0    30.0    60.0   110.9   180.0   480.0     177

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 16 6.04
1 21 7.92
2 26 9.81
3 36 13.58
4 38 14.34
5 37 13.96
6 34 12.83
7 57 21.51

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 
##    1.00   30.00   40.00   60.35   60.00  720.00      16

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 214 80.75
1 15 5.66
2 7 2.64
3 13 4.91
4 4 1.51
5 6 2.26
6 3 1.13
7 3 1.13

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   13.50   30.00   45.88   60.00  180.00     214

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 58 21.89
1 33 12.45
2 37 13.96
3 36 13.58
4 27 10.19
5 25 9.43
6 15 5.66
7 34 12.83

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 
##    0.00   20.00   30.00   47.31   60.00  900.00      58

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 66 25
1 31 12
2 40 15
3 29 11
4 28 11
5 31 12
6 8 3
7 32 12

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 
##    0.00   25.00   30.00   46.05   60.00  900.00      66

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 145 55
1 19 7
2 22 8
3 31 12
4 22 8
5 12 5
6 9 3
7 5 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   45.00   49.81   60.00  120.00     145

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 187 71
1 26 10
2 14 5
3 16 6
4 10 4
5 6 2
6 2 1
7 4 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 
##    3.00   30.00   30.00   49.32   60.00  180.00     187

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)

summary(w2$sit_weekday)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    45.0   240.0   420.0   427.7   600.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)

summary(w2$sit_weekend)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    60.0   240.0   360.0   382.1   480.0   960.0

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)

summary(w2$height)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     147     163     168     169     173     206

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)

summary(w2$weight)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   44.00   63.00   73.00   78.34   91.00  169.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) %>%
            summarise(n = n()) %>%
            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 = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 35 13.21
Very good 101 38.11
Good 94 35.47
Fair 29 10.94
Poor 6 2.26

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) %>%
            summarise(n = n()) %>%
            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 = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 9 3.40
Yes, limited a little 31 11.70
No, not at all 225 84.91

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) %>%
            summarise(n = n()) %>%
            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 = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 18 6.79
Yes, limited a little 54 20.38
No, not at all 193 72.83

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) %>%
            summarise(n = n()) %>%
            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("Percent") +
      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 62 23.4
No 203 76.6

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) %>%
            summarise(n = n()) %>%
            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("Percent") +
      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 21.51
No 208 78.49

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) %>%
            summarise(n = n()) %>%
            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("Percent") +
      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 112 42.26
No 153 57.74

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) %>%
            summarise(n = n()) %>%
            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("Percent") +
      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 70 26.42
No 195 73.58

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 127 47.92
Slightly 81 30.57
Moderately 35 13.21
Quite a bit 19 7.17
Extremely 3 1.13

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 15 5.66
Most of the time 67 25.28
A good bit of the time 92 34.72
Some of the time 53 20.00
A little of the time 33 12.45
None of the time 5 1.89

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 14 5.28
Most of the time 62 23.40
A good bit of the time 80 30.19
Some of the time 69 26.04
A little of the time 33 12.45
None of the time 7 2.64

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 8 3.02
Most of the time 21 7.92
A good bit of the time 44 16.60
Some of the time 72 27.17
A little of the time 93 35.09
None of the time 27 10.19

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 9 3.40
Most of the time 10 3.77
A good bit of the time 32 12.08
Some of the time 40 15.09
A little of the time 68 25.66
None of the time 106 40.00

Section 4: Well-being

Thinking about your own life and personal circumstances, how satisfied are you

t_1 <- select(w2, compare, pwb_a, pwb_b, pwb_c, pwb_d, pwb_e, pwb_f, pwb_g, pwb_h, pwb_i)
t_1 <- pivot_longer(t_1,
   cols = starts_with("pwb_"),
   names_to = "perception",
   names_prefix = "pwb_",
   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 satisfied", "9" = "9","8" = "8","7" = "7", "6" = "6", "5" = "5", "4" = "4", "3" = "3", "2" = "2", "1" = "1","0" = "0-Completely dissatisfied")

##### 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 = 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" = "", "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) %>%
            summarise(n = n()) %>%
            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 = INTERACTfade) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 5 1.89
2 6 2.26
12 4.53
4 25 9.43
5 86 32.45
6 80 30.19
7- A very happy person 51 19.25

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" = "", "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) %>%
            summarise(n = n()) %>%
            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 = INTERACTfade) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 9 3.40
2 9 3.40
21 7.92
4 47 17.74
5 80 30.19
6 48 18.11
7- More happy 51 19.25

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" = "", "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) %>%
            summarise(n = n()) %>%
            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 = INTERACTfade) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 8 3.02
2 24 9.06
23 8.68
4 44 16.60
5 76 28.68
6 56 21.13
7- A great deal 34 12.83

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" = "", "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) %>%
            summarise(n = n()) %>%
            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 = INTERACTfade) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 62 23.40
2 64 24.15
39 14.72
4 30 11.32
5 39 14.72
6 19 7.17
7- A great deal 12 4.53

Tell us how often you feel this way.

t_1 <- select(w2, compare, loneliness_a, loneliness_b, loneliness_c)
t_1 <- pivot_longer(t_1,
   cols = starts_with("loneliness_"),
   names_to = "perception",
   names_prefix = "loneliness_",
   values_to = "values",
   values_drop_na = TRUE)
## rename 

t_1$perception[t_1$perception== "a"] <- "a. How often do you feel that you lack companionship?"
t_1$perception[t_1$perception== "b"] <- "b. How often do you feel left out?"
t_1$perception[t_1$perception== "c"] <- "c. How often do you feel isolated from others?"


## recode

t_1$values <- recode_factor(t_1$values, "1" = "Hardly ever", "2" = "Some of the time", "3" = "Often")

##### 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)

Section 5: Social Participation

How would you describe your sense of belonging to your local community? Would you say it is:

var_name <- w2$belonging
w2$var_name_f <- recode_factor(var_name, "1" = "Very strong", "2" = "Somewhat strong", "3" = "Somewhat weak", "4" = "Very weak", "77" ="I don't know")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTshortfade) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 strong 21 7.92
Somewhat strong 83 31.32
Somewhat weak 101 38.11
Very weak 47 17.74
I don’t know 13 4.91

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.0000  0.6904  1.9945  2.5057  3.9890  6.9808

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.00000 0.05753 0.69041 1.20626 1.99452 6.98082

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.0000  0.0000  0.0000  0.4167  0.2301  6.9808

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.0000  0.0000  0.0000  0.1708  0.0000  4.9863

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.00000 0.00000 0.01918 0.27001 0.23014 4.98630

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = rev(INTERACTPalette3)) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 42 15.85
Somewhat disagree 40 15.09
Neither agree or disagree 115 43.40
Somewhat agree 50 18.87
Strongly agree 18 6.79

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = rev(INTERACTPalette3)) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 79 29.81
Somewhat disagree 91 34.34
Neither agree or disagree 80 30.19
Somewhat agree 11 4.15
Strongly agree 4 1.51

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = rev(INTERACTPalette3)) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 6 2.26
Somewhat disagree 20 7.55
Neither agree or disagree 63 23.77
Somewhat agree 128 48.30
Strongly agree 48 18.11

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = rev(INTERACTPalette3)) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 25 9.43
Somewhat disagree 79 29.81
Neither agree or disagree 126 47.55
Somewhat agree 27 10.19
Strongly agree 8 3.02

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = rev(INTERACTPalette3)) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 4 1.51
Somewhat disagree 22 8.30
Neither agree or disagree 75 28.30
Somewhat agree 117 44.15
Strongly agree 47 17.74

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 72 27.17
Somewhat likely 123 46.42
Not at all likely 30 11.32
I don’t know 40 15.09

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 8 3.02
Somewhat likely 81 30.57
Not at all likely 122 46.04
I don’t know 54 20.38

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)

summary(w2$confide)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   0.000   3.000   5.000   5.449   6.000  40.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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 95 35.85
Satisfied 135 50.94
Neither satisfied nor dissatisfied 21 7.92
Dissatisfied 10 3.77
Strongly dissatisfied 4 1.51

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 32 12.08
Satisfied 92 34.72
Neither satisfied nor dissatisfied 97 36.60
Dissatisfied 38 14.34
Strongly dissatisfied 6 2.26

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 37 13.96
Satisfied 96 36.23
Neither satisfied nor dissatisfied 99 37.36
Dissatisfied 30 11.32
Strongly dissatisfied 3 1.13

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 77 29.06
Satisfied 107 40.38
Neither satisfied nor dissatisfied 59 22.26
Dissatisfied 17 6.42
Strongly dissatisfied 5 1.89

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTshortfade) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 129 48.68
Somewhat important 75 28.30
Not very important 28 10.57
Not important at all 24 9.06
I don’t know 9 3.40

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTshortfade) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 136 51.32
Somewhat important 95 35.85
Not very important 23 8.68
Not important at all 5 1.89
I don’t know 6 2.26

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTshortfade) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 114 43.02
Somewhat important 110 41.51
Not very important 30 11.32
Not important at all 5 1.89
I don’t know 6 2.26

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTshortfade) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 70 26.42
Somewhat important 90 33.96
Not very important 80 30.19
Not important at all 18 6.79
I don’t know 7 2.64

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTshortfade) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 58 21.89
Somewhat important 116 43.77
Not very important 64 24.15
Not important at all 15 5.66
I don’t know 12 4.53

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTshortfade) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 43 16.23
Somewhat important 67 25.28
Not very important 80 30.19
Not important at all 66 24.91
I don’t know 9 3.40

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTshortfade) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 139 52.45
Somewhat important 93 35.09
Not very important 21 7.92
Not important at all 7 2.64
I don’t know 5 1.89

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTshortfade) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 68 25.66
Somewhat important 84 31.70
Not very important 50 18.87
Not important at all 52 19.62
I don’t know 11 4.15

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTshortfade) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 72 27.17
Somewhat important 51 19.25
Not very important 47 17.74
Not important at all 78 29.43
I don’t know 17 6.42

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?

typical habits prior to COVID-19

excluded outliers where more than 100 trips a week

#cov_con_trips_pre
w2$cov_con_trips_pre[w2$cov_con_trips_pre>=100] <- NA

ggplot(w2, aes(x= cov_con_trips_pre)) + geom_bar(na.rm = TRUE,fill="#76D24A", binwidth = 1) + xlab("Number of trips per week") + facet_wrap( ~ compare)

summary(w2$cov_con_trips_pre)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##    0.00    5.50   10.00   11.76   15.00   60.00       2

most closed phase of COVID-19

excluded outliers where more than 100 trips a week

#cov_con_trips
w2$cov_con_trips[w2$cov_con_trips>=100] <- NA

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.    NA's 
##    0.00    0.00    2.00    3.28    4.00   30.00       1

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 21 7.92
Care-taking No 244 92.08
Groceries Yes 226 85.28
Groceries No 39 14.72
Medical trips Yes 89 33.58
Medical trips No 176 66.42
School Yes 17 6.42
School No 248 93.58
Social, entertainment, eating out Yes 50 18.87
Social, entertainment, eating out No 215 81.13
Work Yes 89 33.58
Work No 176 66.42

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 101 38.11
Cycling Same as before COVID-19 113 42.64
Cycling More 51 19.25
Driving Less 132 49.81
Driving Same as before COVID-19 69 26.04
Driving More 64 24.15
Public Transit Less 189 71.32
Public Transit Same as before COVID-19 71 26.79
Public Transit More 5 1.89
Walking Less 61 23.02
Walking Same as before COVID-19 92 34.72
Walking More 112 42.26

Please tell us why you used public transit more by ranking the following items based on how importantly they factored into your decision.

#cov_con_brt_more_a

w2$cov_con_brt_more_a[w2$cov_con_brt_more_a==-7] <- NA
w2$cov_con_brt_more_b[w2$cov_con_brt_more_b==-7] <- NA
w2$cov_con_brt_more_c[w2$cov_con_brt_more_c==-7] <- NA
w2$cov_con_brt_more_d[w2$cov_con_brt_more_d==-7] <- NA
w2$cov_con_brt_more_e[w2$cov_con_brt_more_e==-7] <- NA



var_name <- w2$cov_con_brt_more_a
w2$var_name_f <- recode_factor(var_name, "1" = "1. Most important", "2" = "2", "3" = "3", "4" = "4", "5" = "5. Least important ")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill= "76D24A") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("Needed a place to spend time") +
  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. Most important
2 0.75
  1. Least important
3 1.13
NA 260 98.11
#cov_con_brt_more_b

var_name <- w2$cov_con_brt_more_b
w2$var_name_f <- recode_factor(var_name, "1" = "1. Most important", "2" = "2", "3" = "3", "4" = "4", "5" = "5. Least important ")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill= "76D24A") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("Public spaces were closed") +
  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. Most important
1 0.38
  1. Least important
4 1.51
NA 260 98.11
#cov_con_brt_more_c

var_name <- w2$cov_con_brt_more_c
w2$var_name_f <- recode_factor(var_name, "1" = "1. Most important", "2" = "2", "3" = "3", "4" = "4", "5" = "5. Least important ")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill= "76D24A") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("Free transit meant I could access more places") +
  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. Most important
2 0.75
2 1 0.38
3 1 0.38
  1. Least important
1 0.38
NA 260 98.11
#cov_con_brt_more_d

var_name <- w2$cov_con_brt_more_d
w2$var_name_f <- recode_factor(var_name, "1" = "1. Most important", "2" = "2", "3" = "3", "4" = "4", "5" = "5. Least important ")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill= "76D24A") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("Preferred using transit over another mode of transportation") +
  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. Most important
2 0.75
2 1 0.38
  1. Least important
2 0.75
NA 260 98.11
#cov_con_brt_more_e

var_name <- w2$cov_con_brt_more_e
w2$var_name_f <- recode_factor(var_name, "1" = "1. Most important", "2" = "2", "3" = "3", "4" = "4", "5" = "5. Least important ")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill= "76D24A") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("Less risk of COVID transmission compared to other modes") +
  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. Most important
1 0.38
3 1 0.38
4 1 0.38
  1. Least important
2 0.75
NA 260 98.11

Please tell us why you used public transit less by ranking the following items based on how importantly they factored into your decision.

w2$cov_con_brt_less_a[w2$cov_con_brt_less_a==-7] <- NA
w2$cov_con_brt_less_b[w2$cov_con_brt_less_b==-7] <- NA
w2$cov_con_brt_less_c[w2$cov_con_brt_less_c==-7] <- NA
w2$cov_con_brt_less_d[w2$cov_con_brt_less_d==-7] <- NA
w2$cov_con_brt_less_e[w2$cov_con_brt_less_e==-7] <- NA
w2$cov_con_brt_less_f[w2$cov_con_brt_less_f==-7] <- NA
w2$cov_con_brt_less_f[w2$cov_con_brt_less_g==-7] <- NA

#cov_con_brt_less_a
var_name <- w2$cov_con_brt_less_a
w2$var_name_f <- recode_factor(var_name, "1" = "1. Most important", "2" = "2", "3" = "3", "4" = "4", "5" = "5", "6" = "6",  " 7" = "7. Least important ")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill = "76d24a") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("Didn’t feel safe from contracting COVID-19")+
  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. Most important
105 39.62
2 20 7.55
3 22 8.30
4 12 4.53
5 7 2.64
6 5 1.89
  1. Least important
18 6.79
NA 76 28.68
#cov_con_brt_less_b
var_name <- w2$cov_con_brt_less_b
w2$var_name_f <- recode_factor(var_name, "1" = "1. Most important", "2" = "2", "3" = "3", "4" = "4", "5" = "5", "6" = "6",  " 7" = "7. Least important")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill = "76d24a") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("Change in schedule made it not feasible")+
  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. Most important
33 12.45
2 21 7.92
3 16 6.04
4 23 8.68
5 11 4.15
6 24 9.06
  1. Least important
61 23.02
NA 76 28.68
#cov_con_brt_less_c
var_name <- w2$cov_con_brt_less_c
w2$var_name_f <- recode_factor(var_name, "1" = "1. Most important", "2" = "2", "3" = "3", "4" = "4", "5" = "5", "6" = "6",  " 7" = "7. Least important ")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill = "76d24a") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("Change in route made it not feasible")+
  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. Most important
18 6.79
2 11 4.15
3 16 6.04
4 25 9.43
5 15 5.66
6 26 9.81
  1. Least important
78 29.43
NA 76 28.68
#cov_con_brt_less_d
var_name <- w2$cov_con_brt_less_d
w2$var_name_f <- recode_factor(var_name, "1" = "1. Most important", "2" = "2", "3" = "3", "4" = "4", "5" = "5", "6" = "6",  " 7" = "7. Least important ")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill = "76d24a") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("Used active transportation instead (walking, cycling, etc.)" )+
  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. Most important
37 13.96
2 35 13.21
3 21 7.92
4 23 8.68
5 12 4.53
6 15 5.66
  1. Least important
46 17.36
NA 76 28.68
#cov_con_brt_less_e
var_name <- w2$cov_con_brt_less_e
w2$var_name_f <- recode_factor(var_name, "1" = "1. Most important", "2" = "2", "3" = "3", "4" = "4", "5" = "5", "6" = "6",  " 7" = "7. Least important ")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill = "76d24a") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("Used a car instead   ")+
  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. Most important
73 27.55
2 26 9.81
3 25 9.43
4 14 5.28
5 10 3.77
6 4 1.51
  1. Least important
37 13.96
NA 76 28.68
#cov_con_brt_less_f
var_name <- w2$cov_con_brt_less_f
w2$var_name_f <- recode_factor(var_name,"1" = "1. Most important", "2" = "2", "3" = "3", "4" = "4", "5" = "5", "6" = "6",  " 7" = "7. Least important ")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill = "76d24a") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("My destinations were out of reach of transit ")+
  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. Most important
18 6.79
2 14 5.28
3 13 4.91
4 16 6.04
5 22 8.30
6 27 10.19
  1. Least important
79 29.81
NA 76 28.68
#cov_con_brt_less_g
var_name <- w2$cov_con_brt_less_g
w2$var_name_f <- recode_factor(var_name, "1" = "1. Most important", "2" = "2", "3" = "3", "4" = "4", "5" = "5", "6" = "6",  " 7" = "7. Least important ")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill = "76d24a") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("I did not need transit to access my destinations")+
  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. Most important
61 23.02
2 31 11.70
3 13 4.91
4 20 7.55
5 9 3.40
6 9 3.40
  1. Least important
46 17.36
NA 76 28.68

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 32 12.08
Somewhat satisfied 79 29.81
Neutral 37 13.96
Somewhat dissatisfied 75 28.30
Very dissatisfied 42 15.85

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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.79
Somewhat satisfied 57 21.51
Neutral 55 20.75
Somewhat dissatisfied 77 29.06
Very dissatisfied 58 21.89

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) %>%
            summarise(n = n()) %>%
            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 = rev(INTERACTfade)) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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. As bad as it could be
7 2.64
1 2 0.75
2 16 6.04
3 29 10.94
4 32 12.08
5 33 12.45
6 38 14.34
7 44 16.60
8 24 9.06
9 15 5.66
  1. As good as it could be
25 9.43

During the height of the COVID-19 lockdown, how satisfied were you with Saskatoon Transit’s response to the lockdown?

var_name <- w2$cov_sati_resp
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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 51 19.25
Somewhat satisfied 76 28.68
Neutral 105 39.62
Somewhat dissatisfied 27 10.19
Very dissatisfied 6 2.26

Please rank the following temporary interventions from 1 being most effective to 5 as least effective to encourage mobility in Saskatoon during the height of the COVID-19 lockdown.

Reduced capacity on buses to accommodate for physical distancing

var_name <- w2$cov_mob_rank_a
w2$var_name_f <- recode_factor(var_name, "1" = "Most effective", "2" = "2", 
                                                "3" = "3", 
                                                "4" = "4", "5" = "Least effective")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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
Most effective 134 50.57
2 65 24.53
3 44 16.60
4 15 5.66
Least effective 7 2.64

Back door loading/ no fares collected

var_name <- w2$cov_mob_rank_b
w2$var_name_f <- recode_factor(var_name, "1" = "Most effective", "2" = "2", 
                                                "3" = "3", 
                                                "4" = "4",  "5" = "Least effective")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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
Most effective 120 45.28
2 71 26.79
3 54 20.38
4 8 3.02
Least effective 12 4.53

Changes in routes/schedule

var_name <- w2$cov_mob_rank_c
w2$var_name_f <- recode_factor(var_name, "1" = "Most effective", "2" = "2", 
                                                "3" = "3", 
                                                "4" = "4",  "5" = "Least effective")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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
Most effective 20 7.55
2 28 10.57
3 85 32.08
4 59 22.26
Least effective 73 27.55

Extra buses on busy routes

var_name <- w2$cov_mob_rank_d
w2$var_name_f <- recode_factor(var_name, "1" = "Most effective", "2" = "2", 
                                                "3" = "3", 
                                                "4" = "4", "5" = "Least effective")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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
Most effective 91 34.34
2 62 23.40
3 69 26.04
4 29 10.94
Least effective 14 5.28

Public Paid Parking not enforced

var_name <- w2$cov_mob_rank_e
w2$var_name_f <- recode_factor(var_name, "1" = "Most effective","2" = "2", 
                                                "3" = "3", 
                                                "4" = "4",  "5" = "Least effective")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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
Most effective 98 36.98
2 39 14.72
3 38 14.34
4 31 11.70
Least effective 59 22.26

When thinking of the term “safety” and the use of public transit, please rank the following from safest to least safe.

Risk of contracting COVID-19

var_name <- w2$cov_safety_a
w2$var_name_f <- recode_factor(var_name, "1" = "Safest", "2" = "2", 
                                                "3" = "3", 
                                                "4" = "4",  "5" = "Least safe")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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
Safest 24 9.06
2 34 12.83
3 73 27.55
4 65 24.53
Least safe 69 26.04

Using the bus late at night

var_name <- w2$cov_safety_b
w2$var_name_f <- recode_factor(var_name, "1" = "Safest", "2" = "2", 
                                                "3" = "3", 
                                                "4" = "4", "5" = "Least safe")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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
Safest 20 7.55
2 36 13.58
3 61 23.02
4 69 26.04
Least safe 79 29.81

Waiting for the bus at bus shelters

var_name <- w2$cov_safety_c
w2$var_name_f <- recode_factor(var_name, "1" = "Safest", "2" = "2", 
                                                "3" = "3", 
                                                "4" = "4", "5" = "Least safe")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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
Safest 22 8.30
2 59 22.26
3 83 31.32
4 61 23.02
Least safe 40 15.09

Physical safety from other riders on the bus

var_name <- w2$cov_safety_d
w2$var_name_f <- recode_factor(var_name, "1" = "Safest", "2" = "2", 
                                                "3" = "3", 
                                                "4" = "4", "5" = "Least safe")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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
Safest 39 14.72
2 77 29.06
3 76 28.68
4 43 16.23
Least safe 30 11.32

Being involved in a collision while riding the bus

var_name <- w2$cov_safety_e
w2$var_name_f <- recode_factor(var_name, "1" = "Safest", "2" = "2", 
                                                "3" = "3", 
                                                "4" = "4", "5" = "Least safe")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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
Safest 108 40.75
2 51 19.25
3 47 17.74
4 26 9.81
Least safe 33 12.45

During the height of the COVID-19 lockdown, which of the following statement best represents the reason you took public transit?

var_name <- w2$cov_reasonuse
w2$var_name_f <- recode_factor(var_name, "1" = "I used the bus for essential trips only", "2" = "I used the bus for mainly essential trips but also some trips for leisure", "3" = "I used the bus for leisure trips only", "4" = "I used the bus for mainly leisure trips but also some trips for essential", "5" = "I did not use the bus during the height of the COVID-19 lockdown")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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
I used the bus for essential trips only 66 24.91
I used the bus for mainly essential trips but also some trips for leisure 16 6.04
I used the bus for leisure trips only 3 1.13
I used the bus for mainly leisure trips but also some trips for essential 3 1.13
I did not use the bus during the height of the COVID-19 lockdown 177 66.79

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    2.00    6.00    7.66   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 25 9.43
Care-taking No 240 90.57
Groceries Yes 227 85.66
Groceries No 38 14.34
Medical trips Yes 146 55.09
Medical trips No 119 44.91
School Yes 38 14.34
School No 227 85.66
Social, entertainment, eating out Yes 103 38.87
Social, entertainment, eating out No 162 61.13
Work Yes 130 49.06
Work No 135 50.94

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 78 29.43
Cycling Same as before COVID-19 152 57.36
Cycling More 35 13.21
Driving Less 84 31.70
Driving Same as before COVID-19 104 39.25
Driving More 77 29.06
Public Transit Less 152 57.36
Public Transit Same as before COVID-19 90 33.96
Public Transit More 23 8.68
Walking Less 52 19.62
Walking Same as before COVID-19 116 43.77
Walking More 97 36.60

Please tell us why you use public transit more by ranking the following items based on how importantly they factor into your decision.

#cov_decon_brt_more

w2$cov_decon_brt_more_a[w2$cov_decon_brt_more_a==-7] <- NA
w2$cov_decon_brt_more_b[w2$cov_decon_brt_more_b==-7] <- NA
w2$cov_decon_brt_more_d[w2$cov_decon_brt_more_d==-7] <- NA
w2$cov_decon_brt_more_e[w2$cov_decon_brt_more_e==-7] <- NA



var_name <- w2$cov_decon_brt_more_a
w2$var_name_f <- recode_factor(var_name, "1" = "1. Most important", "2" = "2", 
                                                "3" = "3", "4" = "4. Least important ")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill= "76D24A") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("Needed a place to spend time") +
  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. Most important
2 0.75
2 2 0.75
3 3 1.13
  1. Least important
16 6.04
NA 242 91.32
#cov_decon_brt_more_b

var_name <- w2$cov_decon_brt_more_b
w2$var_name_f <- recode_factor(var_name, "1" = "1. Most important", "2" = "2", 
                                                "3" = "3", "4" = "4. Least important ")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill= "76D24A") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("Public spaces were closed") +
  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. Most important
4 1.51
2 6 2.26
3 4 1.51
  1. Least important
9 3.40
NA 242 91.32
#cov_decon_brt_more_d

var_name <- w2$cov_decon_brt_more_d
w2$var_name_f <- recode_factor(var_name, "1" = "1. Most important", "2" = "2", 
                                                "3" = "3", "4" = "4. Least important ")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill= "76D24A") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("Preferred using transit over another mode of transportation") +
  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. Most important
15 5.66
2 1 0.38
3 3 1.13
  1. Least important
4 1.51
NA 242 91.32
#cov_decon_brt_more_e

var_name <- w2$cov_decon_brt_more_e
w2$var_name_f <- recode_factor(var_name, "1" = "1. Most important", "2" = "2", 
                                                "3" = "3", "4" = "4. Least important ")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill= "76D24A") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("Less risk of COVID transmission compared to other modes") +
  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. Most important
2 0.75
2 7 2.64
3 5 1.89
  1. Least important
9 3.40
NA 242 91.32

Please tell us why you use public transit less by ranking the following items based on how importantly they factor into your decision.

w2$cov_decon_brt_less_a[w2$cov_decon_brt_less_a==-7] <- NA
w2$cov_decon_brt_less_b[w2$cov_decon_brt_less_b==-7] <- NA
w2$cov_decon_brt_less_c[w2$cov_decon_brt_less_c==-7] <- NA
w2$cov_decon_brt_less_d[w2$cov_decon_brt_less_d==-7] <- NA
w2$cov_decon_brt_less_e[w2$cov_decon_brt_less_e==-7] <- NA
w2$cov_decon_brt_less_f[w2$cov_decon_brt_less_f==-7] <- NA
w2$cov_decon_brt_less_g[w2$cov_decon_brt_less_g==-7] <- NA

#cov_decon_brt_less_a
var_name <- w2$cov_decon_brt_less_a
w2$var_name_f <- recode_factor(var_name, "1" = "1. Most important", "2" = "2", "3" = "3", "4" = "4", "5" = "5", "6" = "6", "7" = "7. Least important ")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill = "76d24a") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("Didn’t feel safe from contracting COVID-19")+
  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. Most important
84 31.70
2 13 4.91
3 25 9.43
4 14 5.28
5 4 1.51
6 3 1.13
  1. Least important
9 3.40
NA 113 42.64
#cov_decon_brt_less_b
var_name <- w2$cov_decon_brt_less_b
w2$var_name_f <- recode_factor(var_name, "1" = "1. Most important", "2" = "2", "3" = "3", "4" = "4", "5" = "5", "6" = "6","7" = "7. Least important ")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill = "76d24a") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("Change in schedule made it not feasible")+
  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. Most important
21 7.92
2 13 4.91
3 12 4.53
4 23 8.68
5 19 7.17
6 22 8.30
  1. Least important
42 15.85
NA 113 42.64
#cov_decon_brt_less_c
var_name <- w2$cov_decon_brt_less_c
w2$var_name_f <- recode_factor(var_name, "1" = "1. Most important", "2" = "2", "3" = "3", "4" = "4", "5" = "5", "6" = "6", "7" = "7. Least important ")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill = "76d24a") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("Change in route made it not feasible")+
  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. Most important
8 3.02
2 13 4.91
3 13 4.91
4 26 9.81
5 17 6.42
6 25 9.43
  1. Least important
50 18.87
NA 113 42.64
#cov_decon_brt_less_d
var_name <- w2$cov_decon_brt_less_d
w2$var_name_f <- recode_factor(var_name, "1" = "1. Most important", "2" = "2", "3" = "3", "4" = "4", "5" = "5", "6" = "6", "7" = "7. Least important ")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill = "76d24a") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("Used active transportation instead (walking, cycling, etc.)" )+
  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. Most important
26 9.81
2 25 9.43
3 19 7.17
4 32 12.08
5 11 4.15
6 12 4.53
  1. Least important
27 10.19
NA 113 42.64
#cov_decon_brt_less_e
var_name <- w2$cov_decon_brt_less_e
w2$var_name_f <- recode_factor(var_name, "1" = "1. Most important", "2" = "2", "3" = "3", "4" = "4", "5" = "5", "6" = "6", "7" = "7. Least important ")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill = "76d24a") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("Used a car instead   ")+
  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. Most important
61 23.02
2 28 10.57
3 23 8.68
4 9 3.40
5 8 3.02
6 2 0.75
  1. Least important
21 7.92
NA 113 42.64
#cov_decon_brt_less_f
var_name <- w2$cov_decon_brt_less_f
w2$var_name_f <- recode_factor(var_name, "1" = "1. Most important", "2" = "2", "3" = "3", "4" = "4", "5" = "5", "6" = "6", "7" = "7. Least important ")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill = "76d24a") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("My destinations were out of reach of transit ")+
  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. Most important
11 4.15
2 4 1.51
3 15 5.66
4 28 10.57
5 18 6.79
6 23 8.68
  1. Least important
53 20.00
NA 113 42.64
#cov_decon_brt_less_g
var_name <- w2$cov_decon_brt_less_g
w2$var_name_f <- recode_factor(var_name, "1" = "1. Most important", "2" = "2", "3" = "3", "4" = "4", "5" = "5", "6" = "6","7" = "7. Least important ")
var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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", fill = "76d24a") +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") +
  ggtitle("I did not need transit to access my destinations")+
  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. Most important
55 20.75
2 18 6.79
3 13 4.91
4 18 6.79
5 10 3.77
6 9 3.40
  1. Least important
29 10.94
NA 113 42.64

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 33 12.45
Somewhat satisfied 91 34.34
Neutral 49 18.49
Somewhat dissatisfied 65 24.53
Very dissatisfied 27 10.19

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) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalette3) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 19 7.17
Somewhat satisfied 112 42.26
Neutral 45 16.98
Somewhat dissatisfied 59 22.26
Very dissatisfied 30 11.32

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

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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 = INTERACTfade) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 1 0.38
2 6 2.26
3 18 6.79
4 21 7.92
5 35 13.21
6 31 11.70
7 64 24.15
8 43 16.23
9 26 9.81
  1. As good as it could be
20 7.55

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) %>%
            summarise(n = n()) %>%
            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 = INTERACTPaletteSet) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 76 28.68
Woman 182 68.68
Trans man 2 0.75
Genderqueer/Gender non-conforming 5 1.89

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) %>%
            summarise(n = n()) %>%
            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 = INTERACTPaletteSet) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 75 28.30
Female 182 68.68
Other 1 0.38
NA 7 2.64

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) %>%
            summarise(n = n()) %>%
            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 = INTERACTPaletteSet) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 120 45.28
Married/commonlaw 130 49.06
Separated/divorced 13 4.91
Widowed 2 0.75

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) %>%
            summarise(n = n()) %>%
            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("Percent") +
      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 88 33.21
No 177 66.79

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   1.000   2.000   1.932   2.000   4.000     177

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) %>%
            summarise(n = n()) %>%
            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("Percent") +
      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 54 20.38
With other people 211 79.62
# 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)

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 50.94 With a spouse (or partner)
living_arrange_3 22.26 With children
living_arrange_4 0.38 With grandchildren
living_arrange_5 13.21 With relatives or siblings?
living_arrange_6 6.79 With friends
living_arrange_7 6.42 With other people

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.3509  0.0000  4.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   2.000   2.000   2.155   2.000  11.000

Thinking about where you live now, are you

#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", "77" = "I don't know")

var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPaletteSet) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 118 44.53
A tenant 105 39.62
Resident in a relative or friend’s home 30 11.32
Resident other than in a relative or friend’s home 2 0.75
Other 2 0.75
I don’t know 8 3.02

In what type of dwelling do you currently live? Is it:

#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" = "Don't know")

var_name_f <- w2$var_name_f

##### Table
t_1 <- w2 %>%
          group_by(compare, var_name_f) %>%
            summarise(n = n()) %>%
            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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPaletteSet) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 126 47.55
Semi-detached house 9 3.40
Row house 18 6.79
An apartment (or condo) in a duplex or triplex 18 6.79
Apartment (or condo) in building with fewer than 5 storeys 60 22.64
Apartment (or condo) in building with more than 5 storeys 14 5.28
Mobile home/movable dwelling 1 0.38
Other 7 2.64
Don’t know 7 2.64
NA 5 1.89

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)

summary(time)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   0.000   2.000   4.000   7.454   9.250  44.000       5

Were you born in Canada?

*Note: Question only asked to new participants at w2 (n=155), 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) %>%
            summarise(n = n()) %>%
            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("Percent") +
      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 202 76.23
No 56 21.13
NA 7 2.64

When did you move to Canada?

*Note: Question only asked to new participants at w2 or(n=155), reporting w1 data for returning participants Question asked only to new participants not born in Canada (n=38)

#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")

summary(w2$move_can)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##    1961    2011    2017    2012    2019    2021     209

To which ethnic or cultural group(s) do you belong? (Check all that apply)

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) %>%
            summarise(n = n()) %>%
            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=90, hjust = 1, vjust = .6)) + 
  geom_bar(stat="identity", fill = "76d24a") +
  guides(fill=FALSE) +
      ylab("Percent") +
      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
Indigenous or Aboriginal 7 2.64
White 173 65.28
South Asian 18 6.79
Chinese 7 2.64
Black 2 0.75
Filipino 9 3.40
Latin American 4 1.51
Arab 2 0.75
Southeast Asian 4 1.51
West Asian 3 1.13
Other 2 0.75
Mixed identity 6 2.26
I don’t know/ prefer not to answer 5 1.89
NA 23 8.68

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) %>%
            summarise(n = n()) %>%
            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=90, hjust = 1, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = rev(INTERACTfade)) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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
No income 2 0.75
$1 to $9,999 8 3.02
$10,000 to $14,999 17 6.42
$15,000 to $19,999 15 5.66
$20,000 to $29,999 23 8.68
$30,000 to $39,999 24 9.06
$40,000 to $49,999 20 7.55
$50,000 to $99,999 60 22.64
$100,000 to $149,999 36 13.58
$150,000 to $199,999 14 5.28
$200,000 or more 13 4.91
Don’t know/prefer no answer 33 12.45

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) %>%
            summarise(n = n()) %>%
            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 = INTERACTshortfade) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 75 28.30
Well 112 42.26
Not so well 55 20.75
Not at all 12 4.53
Don’t know/prefer no answer 11 4.15

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(w2, 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 
##       0     750    1300    1420    2000    4000      83

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) %>%
            summarise(n = n()) %>%
            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=90, hjust =1, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPaletteSet) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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
Primary/Elementary school 2 0.75
Secondary school 38 14.34
Trade/Technical school or college diploma 39 14.72
University degree 109 41.13
Graduate degree 71 26.79
I don’t know/Prefer not to answer 6 2.26

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) %>%
            summarise(n = n()) %>%
            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=90, hjust=1, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPaletteSet) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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 16 6.04
Employed full-time 125 47.17
Employed part-time 47 17.74
Unemployed and looking for work 26 9.81
Unemployed and not looking for work 17 6.42
Other 34 12.83

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 75 28.30
I continue to work at my normal place of work. No 190 71.70
I have started a new job Yes 14 5.28
I have started a new job No 251 94.72
I lost my job Yes 24 9.06
I lost my job No 241 90.94
I work from home. Yes 72 27.17
I work from home. No 193 72.83
I work partly from home, partly at my normal workplace Yes 33 12.45
I work partly from home, partly at my normal workplace No 232 87.55
My hourly rate has been reduced Yes 9 3.40
My hourly rate has been reduced No 256 96.60
My hourly rate has increased. Yes 6 2.26
My hourly rate has increased. No 259 97.74
My job has been deemed essential by the government. Yes 22 8.30
My job has been deemed essential by the government. No 243 91.70
My paid work #hours have been reduced. Yes 16 6.04
My paid work #hours have been reduced. No 249 93.96
My paid work hours have increased Yes 8 3.02
My paid work hours have increased No 257 96.98

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) %>%
            summarise(n = n()) %>%
            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=90, hjust=1, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPalettecont) +
  guides(fill=FALSE) +
      ylab("Percent") +
      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. 126 47.55
A regular evening shift 10 3.77
A regular night shift 1 0.38
A rotating shift, a split shift, or an irregular schedule 22 8.30
On call or casual 9 3.40
Other 4 1.51
NA 93 35.09

Age

# Categorize age variable
## reviens-y

w2$age_cat <- NA

w2$age_cat[w2$age  %in% c(18:24)] <- "18-24"
w2$age_cat[w2$age  %in% c(25:34)] <- "25-34"
w2$age_cat[w2$age  %in% c(35:44)] <- "35-44"
w2$age_cat[w2$age  %in% c(45:54)] <- "45-54"
w2$age_cat[w2$age  %in% c(55:64)] <- "55-64"
w2$age_cat[w2$age  %in% c(65:74)] <- "65-74"
w2$age_cat[w2$age  %in% c(75:100)] <- "75+"


##### Table
t_1 <- w2 %>%
          group_by(compare, age_cat) %>%
            dplyr::summarise(n = n()) %>%
            dplyr:: mutate(pct = round(100*n/sum(n),2))


p <- ggplot(t_1, aes(age_cat,  y = pct, fill = age_cat)) + theme(axis.text.x = element_text(angle=90, vjust = .6)) + 
  geom_bar(stat= "identity") +
  scale_fill_manual(values = INTERACTPalettecont) +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response") + 
  facet_wrap(~ compare)
plot(p)

kable(t_1)  %>%   kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
compare age_cat n pct
18-24 55 20.75
25-34 85 32.08
35-44 57 21.51
45-54 33 12.45
55-64 24 9.06
65-74 10 3.77
NA 1 0.38