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, 150 returning participants, and 170 new participants completed the Health Questionnaire, for a total of 320 responses. Responses were collected from September 27th, 2022 to January 18th, 2023.

Cohort demographics

Age distribution

summary(skt_data$age) %>%
  as.list() %>%
  data.frame() %>%
  knitr::kable(digits = 1, col.names = c("Min", "1st Qu.", "Median", "Mean", "3rd Qu.", "Max")) %>%
  kableExtra::kable_styling("hover", full_width = F)
Min 1st Qu. Median Mean 3rd Qu. Max
0 26 33 35.4 40.2 83
fillCount = length(unique(skt_data$age))
getPalette = colorRampPalette(RColorBrewer::brewer.pal(9, "GnBu"))

ggplot(skt_data) +
  geom_histogram(aes(age, y=after_stat(count / sum(count)), fill=factor(age)), binwidth = 5, show.legend = F) +
  theme_light() +
  scale_fill_manual(values = getPalette(fillCount), na.value = "grey") +
  scale_y_continuous(labels = percent) + ylab("")

# Add a age category variable
age_classes <- c("18 - 30", "31 - 50", "51 - 65", "65+")
skt_data <- skt_data %>%
  mutate(age_class = case_when(age < 31 ~ age_classes[1],
                               age < 51 ~ age_classes[2],
                               age < 66 ~ age_classes[3],
                               TRUE ~ age_classes[4]),
         age_class = factor(age_class, levels = age_classes))

table(skt_data$age_class, useNA = "ifany") %>%
  kableExtra::kable(col.names=c('Age categories', 'N')) %>%
  kableExtra::kable_styling("hover", full_width = F)
Age categories N
18 - 30 137
31 - 50 136
51 - 65 34
65+ 13
ggplot(skt_data) +
  geom_bar(aes(age_class, y=after_stat(count / sum(count)), fill=age_class), show.legend = FALSE) +
  theme_light() +
  scale_fill_brewer(palette="GnBu", na.value = "grey") +
  scale_y_continuous(labels = percent) + ylab("")

What is your current gender identity?

gender <- fromJSON('[
        {
          "label": "Man",
          "value": 1
        },
        {
          "label": "Woman",
          "value": 2
        },
        {
          "label": "Trans man",
          "value": 3
        },
        {
          "label": "Trans woman",
          "value": 4
        },
        {
          "label": "Genderqueer/Gender non-conforming",
          "value": 5
        },
        {
          "label": "Different identity",
          "value": 99
        }]') %>%
  mutate(label = factor(label, levels = label))

.ggpdf <- skt_data %>%
  left_join(gender, by=c("gender"="value")) %>%
  transmute(interact_id = interact_id,
            gender = label)

# Add gender as factor to dataset (for crosstab below)
skt_data <- skt_data %>%
  left_join(gender, by=c("gender"="value")) %>%
  mutate(gender_label = label) %>%
  select(!label)

table(.ggpdf$gender, useNA = "ifany") %>%
  kableExtra::kable(col.names=c('Gender', 'N')) %>%
  kableExtra::kable_styling("hover", full_width = F)
Gender N
Man 118
Woman 194
Trans man 2
Trans woman 0
Genderqueer/Gender non-conforming 6
Different identity 0
ggplot(.ggpdf) +
  geom_bar(aes(gender, y=after_stat(count / sum(count)), fill=gender), show.legend = FALSE) +
  theme_light() +
  scale_fill_brewer(palette="GnBu", na.value = "grey") +
  scale_y_continuous(labels = percent) + ylab("")

# grouping gender non-conforming under LGBTQ2S+
gender_groups <- c("Man", "Woman", "Gender minorities")
skt_data <- skt_data %>%
  mutate(gender_group = case_when(gender == 1 ~ gender_groups[1],
                                  gender == 2 ~ gender_groups[2],
                                  TRUE ~ gender_groups[3]),
         gender_group = factor(gender_group, levels = gender_groups))

What is your current living arrangement?

NB More than one possible answer

living_arrange <- fromJSON('[
        {
          "label": "Alone?",
          "value": 1
        },
        { 
          "label": "With a spouse (or partner)?",
          "value": 2
        },
        {
          "label": "With children?",
          "value": 3
        },
        {
          "label": "With grandchildren?",
          "value": 4
        },
        {
          "label": "With relatives or siblings?",
          "value": 5
        },
        {
          "label": "With friends?",
          "value": 6
        },
        {
          "label": "With other people?",
          "value": 7
        }
      ]')

.ggpdf <- skt_data %>%
  transmute(interact_id = interact_id,
            living_arrange = strsplit(str_sub(living_arrange, 2, -2), ', ')) %>%
  unnest(living_arrange) %>%
  mutate(living_arrange = as.integer(living_arrange)) %>%
  left_join(living_arrange, by=c("living_arrange"="value")) %>%
  transmute(interact_id = interact_id,
            living_arrange = case_when(is.na(living_arrange) ~ 'Living alone',
                                       TRUE ~ str_sub(label, 1, -2)))

table(.ggpdf$living_arrange, useNA = "ifany") %>%
  knitr::kable(col.names=c('Living arrangement', 'N')) %>%
  kableExtra::kable_styling("hover", full_width = F)
Living arrangement N
Alone 61
With a spouse (or partner) 181
With children 110
With friends 19
With grandchildren 2
With other people 11
With relatives or siblings 43
ggplot(.ggpdf) +
  geom_bar(aes(x=living_arrange, y=after_stat(count / sum(count)), fill=living_arrange), show.legend = FALSE) +
  theme_light() +
  theme(axis.text.x=element_text(angle=30,hjust=1)) +
  scale_fill_brewer(palette="GnBu", na.value = "grey") +
  scale_y_continuous(labels=percent) + ylab("")

Which category best describes your annual household income, taking into account all sources of income?

income <- fromJSON('[
        {
          "label": "No income",
          "value": 1
        },
        {
          "label": "$1 to $9,999",
          "value": 2
        },
        {
          "label": "$10,000 to $14,999",
          "value": 3
        },
        {
          "label": "$15,000 to $19,999",
          "value": 4
        },
        {
          "label": "$20,000 to $29,999",
          "value": 5
        },
        {
          "label": "$30,000 to $39,999",
          "value": 6
        },
        {
          "label": "$40,000 to $49,999",
          "value": 7
        },
        {
          "label": "$50,000 to $99,999",
          "value": 8
        },
        {
          "label": "$100,000 to $149,999",
          "value": 9
        },
        {
          "label": "$150,000 to $199,999",
          "value": 10
        },
        {
          "label": "$200,000 or more",
          "value": 11
        },
        {
          "label": "I don’t know/Prefer not to answer",
          "value": 77
        }
      ]') %>%
  mutate(label = factor(label, levels = label))

.ggpdf <- skt_data %>%
  left_join(income, by=c("income"="value")) %>%
  transmute(interact_id = interact_id,
            income = label)

table(.ggpdf$income, useNA = "ifany") %>%
  kableExtra::kable(col.names=c('Income', 'N')) %>%
  kableExtra::kable_styling("hover", full_width = F)
Income N
No income 4
$1 to $9,999 11
$10,000 to $14,999 14
$15,000 to $19,999 11
$20,000 to $29,999 17
$30,000 to $39,999 21
$40,000 to $49,999 27
$50,000 to $99,999 98
$100,000 to $149,999 39
$150,000 to $199,999 25
$200,000 or more 17
I don’t know/Prefer not to answer 36
ggplot(.ggpdf) +
  geom_bar(aes(y=income, x=after_stat(count / sum(count)), fill=income), show.legend = FALSE) +
  theme_light() +
  scale_fill_brewer(palette="GnBu", na.value = "grey") +
  scale_x_continuous(labels=percent) + xlab("")

What is your highest education level?

education <- fromJSON('[
        {
          "label": "Primary/Elementary school",
          "value": 1
        },
        {
          "label": "Secondary school",
          "value": 2
        },
        {
          "label": "Trade/Technical school or college diploma",
          "value": 3
        },
        {
          "label": "University degree",
          "value": 4
        },
        {
          "label": "Graduate degree",
          "value": 5
        },
        {
          "label": "I don’t know/Prefer not to answer",
          "value": 77
        }
      ]') %>%
  mutate(label = factor(label, levels = label))

.ggpdf <- skt_data %>%
  left_join(education, by=c("education"="value")) %>%
  transmute(interact_id = interact_id,
            education = label)

table(.ggpdf$education, useNA = "ifany") %>%
  kableExtra::kable(col.names=c('Education', 'N')) %>%
  kableExtra::kable_styling("hover", full_width = F)
Education N
Primary/Elementary school 1
Secondary school 41
Trade/Technical school or college diploma 61
University degree 134
Graduate degree 80
I don’t know/Prefer not to answer 3
ggplot(.ggpdf) +
  geom_bar(aes(education, y=after_stat(count / sum(count)), fill=education), show.legend = FALSE) +
  theme_light() +
  theme(axis.text.x=element_text(angle=30,hjust=1)) +
  scale_fill_brewer(palette="GnBu", na.value = "grey") +
  scale_x_discrete(labels = scales::label_wrap(25)) +
  scale_y_continuous(labels=percent) + ylab("")

Are you currently a student?

student <- fromJSON('[
        {
          "label": "Yes",
          "value": 1
        },
        {
          "label": "No",
          "value": 2
        }
      ]') %>%
  mutate(label = factor(label, levels = label))

.ggpdf <- skt_data %>%
  left_join(student, by=c("student"="value")) %>%
  transmute(interact_id = interact_id,
            student = label)

table(.ggpdf$student, useNA = "ifany") %>%
  kableExtra::kable(col.names=c('Student', 'N')) %>%
  kableExtra::kable_styling("hover", full_width = F)
Student N
Yes 97
No 223
ggplot(.ggpdf) +
  geom_bar(aes(student, y=after_stat(count / sum(count)), fill=student), show.legend = FALSE) +
  theme_light() +
  scale_fill_manual(values = INTERACTPaletteYN) +
  scale_x_discrete(labels = scales::label_wrap(25)) +
  scale_y_continuous(labels=percent) + ylab("")

What is your current employment status?

employment <- fromJSON('[
        {
          "label": "Retired and not working",
          "value": 1
        },
        {
          "label": "Employed full-time",
          "value": 2
        },
        {
          "label": "Employed part-time",
          "value": 3
        },
        {
          "label": "Unemployed and looking for work",
          "value": 4
        },
        {
          "label": "Unemployed and not looking for work",
          "value": 5
        },
        {
          "label": "Other",
          "value": 99
        }
      ]') %>%
  mutate(label = factor(label, levels = label))

.ggpdf <- skt_data %>%
  left_join(employment, by=c("employment"="value")) %>%
  transmute(interact_id = interact_id,
            employment = label)

table(.ggpdf$employment, useNA = "ifany") %>%
  kableExtra::kable(col.names=c('Employment', 'N')) %>%
  kableExtra::kable_styling("hover", full_width = F)
Employment N
Retired and not working 15
Employed full-time 190
Employed part-time 56
Unemployed and looking for work 17
Unemployed and not looking for work 18
Other 24
ggplot(.ggpdf) +
  geom_bar(aes(employment, y=after_stat(count / sum(count)), fill=employment), show.legend = FALSE) +
  theme_light() +
  theme(axis.text.x=element_text(angle=30,hjust=1)) +
  scale_fill_brewer(palette="GnBu", na.value = "grey") +
  scale_x_discrete(labels = scales::label_wrap(25)) +
  scale_y_continuous(labels=percent) + ylab("")

To which ethnic or cultural groups did your ancestors belong?

NB More than one ethnic group possible

ethnicity <- fromJSON('[
        {
          "label": "Aboriginal / Indigenous",
          "value": 1
        },
        {
          "label": "Asian",
          "value": 2
        },
        {
          "label": "Black",
          "value": 3
        },
        {
          "label": "Caucasian",
          "value": 4
        },
        {
          "label": "Latin American",
          "value": 5
        },
        {
          "label": "Middle Eastern",
          "value": 6
        },
        {
          "label": "Other",
          "value": 99
        },
        {
          "label": "I don’t know/Prefer not to answer",
          "value": 77
        }
      ]') %>%
  mutate(label = factor(label, levels = label))

.ggpdf <- skt_data %>%
  left_join(group_id_w1_w2, by="interact_id") %>%
  transmute(interact_id = interact_id,
            group_id = coalesce(group_id, group_id_w1_w2)) %>%
  transmute(interact_id = interact_id,
           group_id = strsplit(str_sub(group_id, 2, -2), ', ')) %>%
  unnest(group_id) %>%
  mutate(group_id = as.integer(group_id)) %>%
  left_join(ethnicity, by=c("group_id"="value")) %>%
  transmute(interact_id = interact_id,
            ethnicity = label) %>%
  filter(!is.na(ethnicity))


table(.ggpdf$ethnicity, useNA = "ifany") %>%
  kableExtra::kable(col.names=c('Ethnicity', 'N')) %>%
  kableExtra::kable_styling("hover", full_width = F)
Ethnicity N
Aboriginal / Indigenous 28
Asian 44
Black 21
Caucasian 182
Latin American 16
Middle Eastern 10
Other 0
I don’t know/Prefer not to answer 4
ggplot(.ggpdf) +
  geom_bar(aes(ethnicity, y=after_stat(count / sum(count)), fill=ethnicity), show.legend = FALSE) +
  theme_light() +
  theme(axis.text.x=element_text(angle=30,hjust=1)) +
  scale_fill_brewer(palette="GnBu", na.value = "grey") +
  scale_x_discrete(labels = scales::label_wrap(20))+
  scale_y_continuous(labels=percent) + ylab("")

Housing tenure

house_tenure <- fromJSON('[
        {
          "label": "An owner",
          "value": 1
        },
        {
          "label": "A tenant",
          "value": 2
        },
        {
          "label": "A resident in a relative or friend’s home",
          "value": 3
        },
        {
          "label": "A resident other than in a relative or friend’s home",
          "value": 4
        },
        {
          "label": "Other",
          "value": 99
        },
        {
          "label": "I don’t know/Prefer not to answer",
          "value": 77
        }
      ]') %>%
  mutate(label = factor(label, levels = label))


## rename -7 to NA
skt_data$house_tenure <- replace(skt_data$house_tenure, skt_data$house_tenure < 0, NA)



.ggpdf <- skt_data %>%
  left_join(skt_data_w2w1, by="interact_id") %>%
  transmute(interact_id = interact_id,
            house_tenure = coalesce(house_tenure, house_tenure_w2, house_tenure_w1)) %>%
  left_join(house_tenure, by=c("house_tenure"="value")) %>%
  transmute(interact_id = interact_id,
            house_tenure = label) %>%
  filter(!is.na(house_tenure))

table(.ggpdf$house_tenure, useNA = "ifany") %>%
  kableExtra::kable(col.names=c('Housing tenure', 'N')) %>%
  kableExtra::kable_styling("hover", full_width = F)
Housing tenure N
An owner 124
A tenant 128
A resident in a relative or friend’s home 43
A resident other than in a relative or friend’s home 1
Other 4
I don’t know/Prefer not to answer 4
ggplot(.ggpdf) +
  geom_bar(aes(house_tenure, y=after_stat(count / sum(count)), fill=house_tenure), show.legend = FALSE) +
  theme_light() +
  theme(axis.text.x=element_text(angle=30,hjust=1)) +
  scale_fill_brewer(palette="GnBu", na.value = "grey") +
  scale_x_discrete(labels = scales::label_wrap(25))+
  scale_y_continuous(labels=percent) + ylab("")

Dwelling

dwelling_type <- fromJSON('[
        {
          "label": "A single-detached house",
          "value": 1
        },
        {
          "label": "A semi-detached house",
          "value": 2
        },
        {
          "label": "A row house",
          "value": 3
        },
        {
          "label": "An apartment (or condo) in a duplex or triplex (two or three dwellings located one above the other)",
          "value": 4
        },
        {
          "label": "An apartment (or condo) in a building that has fewer than five storeys",
          "value": 5
        },
        {
          "label": "An apartment (or condo) in a building that has five or more storeys",
          "value": 6
        },
        {
          "label": "A mobile home or other movable dwelling",
          "value": 7
        },
        {
          "label": "A seniors’ home",
          "value": 8
        },
        {
          "label": "Other",
          "value": 99
        },
        {
          "label": "I don’t know/Prefer not to answer",
          "value": 77
        }
      ]') %>%
  mutate(label = factor(label, levels = label))


## rename -7 to NA
skt_data$dwelling_type <- replace(skt_data$dwelling_type, skt_data$dwelling_type < 0, NA)

.ggpdf <- skt_data %>%
  left_join(skt_data_w2w1, by="interact_id") %>%
  transmute(interact_id = interact_id,
            dwelling_type = coalesce(dwelling_type, dwelling_type_w2, dwelling_type_w1)) %>%
  left_join(dwelling_type, by=c("dwelling_type"="value")) %>%
  transmute(interact_id = interact_id,
            dwelling_type = label)%>%
 filter(!is.na(dwelling_type))

table(.ggpdf$dwelling_type, useNA = "ifany") %>%
  kableExtra::kable(col.names=c('Dwelling', 'N')) %>%
  kableExtra::kable_styling("hover", full_width = F)
Dwelling N
A single-detached house 144
A semi-detached house 20
A row house 16
An apartment (or condo) in a duplex or triplex (two or three dwellings located one above the other) 30
An apartment (or condo) in a building that has fewer than five storeys 55
An apartment (or condo) in a building that has five or more storeys 21
A mobile home or other movable dwelling 6
A seniors’ home 0
Other 7
I don’t know/Prefer not to answer 4
ggplot(.ggpdf) +
  geom_bar(aes(y=dwelling_type, x=after_stat(count / sum(count)), fill=dwelling_type), show.legend = FALSE) +
  theme_light() +
  #theme(axis.text.x=element_text(angle=30,hjust=1)) +
  scale_fill_brewer(palette="GnBu", na.value = "grey") +
  scale_y_discrete(label=label_wrap(50))+
  scale_x_continuous(labels=percent) + xlab("")

Returning or new participant

skt_data %>%
  count(questionnaire) %>%
  kableExtra::kable() %>%
  kableExtra::kable_styling("hover", full_width = F)
questionnaire n
New 170
Returning 150
ggplot(skt_data) +
  geom_bar(aes(questionnaire, y=after_stat(count / sum(count)), fill=questionnaire), show.legend = FALSE) +
  theme_light() +
  #theme(axis.text.x=element_text(angle=30,hjust=1)) +
  scale_fill_brewer(palette="GnBu", na.value = "grey")+
  scale_y_continuous(labels=percent) + ylab("")

Transit and Transportation

Which Saskatoon Transit Go Pass do you own?

var_name <- skt_data$sask_bus_pass
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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=90, vjust = .6)) + 
  geom_bar(stat="identity") +
  scale_fill_manual(values = INTERACTPaletteSet) +
  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
Monthly adult pass 99 30.94
Eco Pass 10 3.12
UPass 43 13.44
Student Pass 41 12.81
Discounted Pass 8 2.50
Low Income Pass 4 1.25
I do not use a Go pass, I use a multi-use pass 35 10.94
I do not use a Go pass, I use cash 30 9.38
I do not currently ride the bus 50 15.62

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

Fall

df<- skt_data %>% filter(bus_freq_a < 91) %>%
  transmute(interact_id = interact_id, 
            bus_freq_a = bus_freq_a/13)

ggplot(df, aes(x =  (bus_freq_a)
)) + geom_histogram(na.rm = TRUE, fill = "#E5364D") + xlab("Days per week in the fall") +
  theme(axis.text.x = element_text(angle = 30, hjust = 1))

summary(df$bus_freq_a)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.0000  0.4615  2.3077  2.5038  4.0000  6.9231

Winter

df<- skt_data %>% filter(bus_freq_b < 91) %>%
  transmute(interact_id = interact_id, 
            bus_freq_b = bus_freq_b/13)

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

summary(df$bus_freq_b)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.0000  0.6923  2.3077  2.5190  4.0000  6.9231

Spring

df<- skt_data %>% filter(bus_freq_c < 91) %>%
  transmute(interact_id = interact_id, 
            bus_freq_c = bus_freq_c/13)

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

summary(df$bus_freq_c)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.0000  0.4615  2.0000  2.3259  4.0000  6.9231

Summer

df<- skt_data %>% filter(bus_freq_d < 91) %>%
  transmute(interact_id = interact_id, 
            bus_freq_d = bus_freq_d/13)

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

summary(df$bus_freq_d)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   0.000   0.000   1.154   1.892   3.115   6.923

Average number of days of bus use per week (based on an annual average)

## add all seasons 

annual <- select(skt_data, interact_id, bus_freq_a, bus_freq_b, bus_freq_c, bus_freq_d) 

annual <- annual %>%
  mutate(across(starts_with("bus_freq_"), ~ pmin(., 91)))

annual$annual_bus_freq <- annual$bus_freq_a + annual$bus_freq_b + annual$bus_freq_c + annual$bus_freq_d

annual$mean_bus_freq <- annual$annual_bus_freq/52


# Add a freq of use category variable
bus_freq <- c("less than once a week", "1-3 times a week", "4 or more times a week")
annual <- annual %>%
  mutate(intervention_freq_use_class = case_when(mean_bus_freq < 1 ~ bus_freq[1],
                               mean_bus_freq < 3.5 ~ bus_freq[2],
                               TRUE ~ bus_freq[3]),
         intervention_freq_use_class = factor(intervention_freq_use_class, level = bus_freq))

annual<- select(annual, interact_id, intervention_freq_use_class)


# Join newly created var to skt_data
skt_data <- skt_data %>%
  left_join(annual, by = c("interact_id" = "interact_id"))

# 
# table(skt_data$intervention_freq_use_class, useNA = "ifany") %>%
#   kableExtra::kable(col.names=c('Taking the bus frequency', 'N')) %>%
#   kableExtra::kable_styling("hover", full_width = F)


ggplot(skt_data) +
  geom_bar(aes(intervention_freq_use_class, y=after_stat(count/sum(count)), fill=intervention_freq_use_class), show.legend = FALSE) +
  theme_light() +
  #theme(axis.text.x=element_text(angle=30, hjust=1)) +
  scale_fill_brewer(palette="GnBu", na.value = "grey") +
  scale_y_continuous(labels = percent) + ylab("")

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

a. 8th street

var_name <- skt_data$saskroads_a
skt_data$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "77" = "I don't know")
var_name_f <- skt_data$var_name_f

##### Table
t_1 <- skt_data %>%
          group_by(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")
plot(p)

kable(t_1)  %>%   kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
var_name_f n pct
Yes 170 53.12
No 146 45.62
I don’t know 4 1.25

b. 22nd street

var_name <- skt_data$saskroads_b
skt_data$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "77" = "I don't know")
var_name_f <- skt_data$var_name_f

##### Table
t_1 <- skt_data %>%
          group_by(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") 
plot(p)

kable(t_1)  %>%   kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
var_name_f n pct
Yes 134 41.88
No 177 55.31
I don’t know 9 2.81

c. College Drive

var_name <- skt_data$saskroads_c
skt_data$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "77" = "I don't know")
var_name_f <- skt_data$var_name_f

##### Table
t_1 <- skt_data %>%
          group_by(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") 
plot(p)

kable(t_1)  %>%   kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
var_name_f n pct
Yes 206 64.38
No 107 33.44
I don’t know 7 2.19

d. Preston Avenue

var_name <- skt_data$saskroads_d
skt_data$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "77" = "I don't know")
var_name_f <- skt_data$var_name_f

##### Table
t_1 <- skt_data %>%
          group_by(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") 
plot(p)

kable(t_1)  %>%   kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
var_name_f n pct
Yes 136 42.5
No 176 55.0
I don’t know 8 2.5

e. Attridge Drive

var_name <- skt_data$saskroads_e
skt_data$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "77" = "I don't know")
var_name_f <- skt_data$var_name_f

##### Table
t_1 <- skt_data %>%
          group_by(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") 
plot(p)

kable(t_1)  %>%   kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
var_name_f n pct
Yes 80 25.00
No 225 70.31
I don’t know 15 4.69

f. Warman Rd

var_name <- skt_data$saskroads_f
skt_data$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "77" = "I don't know")
var_name_f <- skt_data$var_name_f

##### Table
t_1 <- skt_data %>%
          group_by(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") 
plot(p)

kable(t_1)  %>%   kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
var_name_f n pct
Yes 75 23.44
No 231 72.19
I don’t know 14 4.38

g. Idylwyld Dr N

var_name <- skt_data$saskroads_g
skt_data$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "77" = "I don't know")
var_name_f <- skt_data$var_name_f

##### Table
t_1 <- skt_data %>%
          group_by(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") 
plot(p)

kable(t_1)  %>%   kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
var_name_f n pct
Yes 113 35.31
No 194 60.62
I don’t know 13 4.06

h. 3rd Avenue N

var_name <- skt_data$saskroads_h
skt_data$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "77" = "I don't know")
var_name_f <- skt_data$var_name_f

##### Table
t_1 <- skt_data %>%
          group_by(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") 
plot(p)

kable(t_1)  %>%   kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
var_name_f n pct
Yes 136 42.50
No 165 51.56
I don’t know 19 5.94

i. Broadway Avenue

var_name <- skt_data$saskroads_i
skt_data$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "77" = "I don't know")
var_name_f <- skt_data$var_name_f

##### Table
t_1 <- skt_data %>%
          group_by(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") 
plot(p)

kable(t_1)  %>%   kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
var_name_f n pct
Yes 158 49.38
No 155 48.44
I don’t know 7 2.19

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 <- skt_data$bus_moti_a
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACTshorterfade) +
  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
Much more likely 166 51.88
Somewhat more likely 118 36.88
Not at all more likely 30 9.38
I don’t know 6 1.88

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

var_name <- skt_data$bus_moti_b
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACTshorterfade) +
  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
Much more likely 173 54.06
Somewhat more likely 109 34.06
Not at all more likely 31 9.69
I don’t know 7 2.19

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

var_name <- skt_data$bus_moti_c
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACTshorterfade) +
  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
Much more likely 132 41.25
Somewhat more likely 125 39.06
Not at all more likely 47 14.69
I don’t know 16 5.00

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

var_name <- skt_data$bus_moti_d
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACTshorterfade) +
  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
Much more likely 198 61.88
Somewhat more likely 96 30.00
Not at all more likely 22 6.88
I don’t know 4 1.25

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

var_name <- skt_data$bus_moti_e
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACTshorterfade) +
  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
Much more likely 134 41.88
Somewhat more likely 102 31.88
Not at all more likely 61 19.06
I don’t know 23 7.19

Other

skt_data %>%
  select(bus_moti_f_txt) %>%
  filter(!is.na(bus_moti_f_txt)) %>%
  kableExtra::kable(col.names = "Motivations")
Motivations
Buses ran with more frequency later into evenings and on Sundays!
I would ride the bus more often if I had a longer commute
I wish the connections were better. Often the connections to #7 are bad. I often see it leaving as the bus I am on is about to pull up behind it. This means a half hour wait for the next #7
50% of The drivers are miserable and terrible drivers. They smash over curbs all the time and stop violently like jerks. Bad morale=bad employer. My partner and I have both arrived at our stops to yellow signs saying they’re cancelled.
Ran more frequently in the evening
the route existed and was efficient
Reliability.
The buses have been running late especially No.6 that I take to the University from 7th St E
Busses were cleaner and on time/not full
To catch the bus and make sure the buses are meeting up at the same time, in order to make a transfer.
People keep their feet with shoes or boots on the seat sometimes and makes it dirty
More routes available
shelters were upgraded on the west side
If there was a way to stay warm while waiting for the bus (like with subway, metro, or train stations)
The bus route itself was much more direct/faster
More accurate bus tracking in the app
It was made easie for seniors with some mobility issues ttravel
If buses (and stations) were as accessible as train stations in other cities then you would see a dramatic increase inn usership
No homeless people using the bus as a shelter
the bus route is more direct
If bus shelters existed at most stops
Heated bus shelters, bus every 5 minutes, bud ride no longer than 15-20 from downtown to my neighborhood.
there were less transfers/more direct routes
my bus stop had a shelter
Warmer place to wait for bus
the bus routes used to be much better, stopping on main streets.
Bus shelters were heated (or at the very least enclosed) during the winter
the bus stop to get to university was closer to my house
Buses transfers were better.
There were more shelters/warm places to wait along my routes
Reliable and efficient
Need to have better bus sheltors
There were faster bus routes to my workplace
my main reason for not taking the bus more is too busy when school is in session
If the bus routes were more direct and faster
That it doesn’t take 1.5 hours to get from point a to point b
For me the most important factor is service levels, frequency from the Broadway area to the University is the main factor.
There are many stops on which we dont have a shelter to stand or a seat. There are times in winters when bus get delayed coz of obvious reasons and it becomes very difficult to wait. If we can do something about it keeping in mind the harsh weather we get, it will make bus travel more easy. Thanks
Right now i have a back injury so i probably would have trouble stepping into the bus
Maybe when the pandemic is over I would take the bus again.
Transit officers
I bought a car in 2020. Ecopass was no longer offered through the university because of the pandemic.
I still have concerns about COVID, as someone who is immunecompromised, so if COVID numbers were much lower or inexistent
Ideally, the better a transit system is, the more likely people are too use it. However, SK culture is so vehicle-centric that you would have to change the way that people think to have any large scale impact.
The service returned to Feb2020 scheduling
Closer stop to my home, fewer transfers required
Route took less long than walking
There was more social distancing
I could have my small dog with me.
Primary issue is long commute. For the small city like Saskatoon, spending 1h one way to travel from centre to the north industrial area is not okay. Reduction of timing needed for commute.
Bus reliability has become a major problem over the last year. The city needs to address bus maintenance so that we stop having cancelled routes due to broken down buses. The lack of reliability is the biggest reason why my wife and I chose to purchase a vehicle for her commute to work.
My bus, #27 Silverspring, runs EVERY 40 MINUTES. Outrageous. It also DOES NOT GO DOWNTOWN - I loathe transferring in general. Transit is unreliable; and as you know winter in Saskatoon is hella cold……it should go downtown if it only comes every 40 minutes - I’d make that work.
real-time updates on every bus/route
They have a mask mandate
Extended hours especially on sundays
Bus drivers were friendlier
The routes aligned better between my starting point and destination (ie: fewer transfers; not single hub-and-spoke
More frequency and earlier start would allow me to get to work at the hospital on time
Having Timers or Real Time Tracking on busses available at bus hubs or through the app with free wifi at bus hubs
If masks were mandatory.
if the price of gas goes up further
skt_data %>%
  select(bus_moti_g_txt) %>%
  filter(!is.na(bus_moti_g_txt)) %>%
  kableExtra::kable(col.names = "Motivations")
Motivations
Even the driver watch me running and waving and I am just 10 ft. away from the door, they will close the door and I need to wait for next bus in this winter for 30 mins.
Sometimes the steps to get in and out of the bus are high.
There was a bit more time allowed in transfer tickets
If it was simpler to navigate (like your proposed idea of having a loop like most large city metro maps) with easy transfer points and routes listed on the buses
the bus does not wait for long periods at transfer points
There were fewer busses that skipped stops because they were full.
safety. I work at St. Paul’s Hospital. It’s extremely unnerving catching the bus there. And I wont take another bus that requires me to walk to or from my destination in that neighborhood
Safer buses
I can’t walk to far or stand to long
Friendly transit drivers, Clearer bus, mask laws enforcerment
The routes that entered Place Riel in Feb2020 resumed service into campus
If it started earlier we hospital workers could get to the hospital on time for our shifts
Having clean busses with dedicated lanes, not getting stuck in traffic. Having smart traffic lights which switch when busses are coming. Making bus a better option then driving alone in cars

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(skt_data,
       aes(x = bus_moti_slider 
       )) + geom_histogram(na.rm = TRUE, bins = 15, fill= "#76D24A")  + xlab("Rank") 

summary(skt_data$bus_moti_slider)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00   10.00   30.00   37.19   62.50  100.00

Do you think Saskatoon Transit Service today is:

a. Reliable

var_name <- skt_data$sask_bus_now_a
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACTshortfade) +
  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
Very 44 13.75
Moderately 158 49.38
Slightly 82 25.62
Not at all 30 9.38
I don’t know 6 1.88

b. Clean

var_name <- skt_data$sask_bus_now_b
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACTshortfade) +
  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
Very 50 15.62
Moderately 181 56.56
Slightly 60 18.75
Not at all 17 5.31
I don’t know 12 3.75

c. Safe

var_name <- skt_data$sask_bus_now_c
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACTshortfade) +
  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
Very 92 28.75
Moderately 152 47.50
Slightly 56 17.50
Not at all 8 2.50
I don’t know 12 3.75

d. Convenient

var_name <- skt_data$sask_bus_now_d
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACTshortfade) +
  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
Very 43 13.44
Moderately 115 35.94
Slightly 95 29.69
Not at all 62 19.38
I don’t know 5 1.56

e. Too expensive

var_name <- skt_data$sask_bus_now_e
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACTshortfade) +
  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
Very 32 10.00
Moderately 75 23.44
Slightly 122 38.12
Not at all 71 22.19
I don’t know 20 6.25

f. Too cheap

var_name <- skt_data$sask_bus_now_f
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACTshortfade) +
  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
Very 13 4.06
Moderately 35 10.94
Slightly 47 14.69
Not at all 199 62.19
I don’t know 26 8.12

g. Professional

var_name <- skt_data$sask_bus_now_g
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACTshortfade) +
  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
Very 69 21.56
Moderately 141 44.06
Slightly 80 25.00
Not at all 12 3.75
I don’t know 18 5.62

h. Environmentally friendly

var_name <- skt_data$sask_bus_now_h
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACTshortfade) +
  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
Very 69 21.56
Moderately 137 42.81
Slightly 60 18.75
Not at all 15 4.69
I don’t know 39 12.19

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

var_name <- skt_data$brt_familiarity
skt_data$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "77" = "I don't know")
var_name_f <- skt_data$var_name_f

##### Table
t_1 <- skt_data %>%
          group_by(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") 

plot(p)

kable(t_1)  %>%   kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
var_name_f n pct
Yes 220 68.75
No 100 31.25

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

var_name <- skt_data$brt_idea
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACTshortfade) +
  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
Very good idea 182 56.88
Somewhat good idea 109 34.06
Somewhat bad idea 9 2.81
Very bad idea 10 3.12
I don’t know 10 3.12

Do you think the BRT will be good for:

a. The Environment

var_name <- skt_data$brt_good_a
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACTshortfade) +
  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
Very good 105 32.81
Somewhat good 150 46.88
Somewhat bad 21 6.56
Very bad 2 0.62
I don’t know 42 13.12

b. Increasing access to transportation

var_name <- skt_data$brt_good_b
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACTshortfade) +
  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
Very good 185 57.81
Somewhat good 113 35.31
Somewhat bad 5 1.56
Very bad 3 0.94
I don’t know 14 4.38

c. Making Saskatoon a vibrant city

var_name <- skt_data$brt_good_c
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACTshortfade) +
  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
Very good 141 44.06
Somewhat good 120 37.50
Somewhat bad 15 4.69
Very bad 4 1.25
I don’t know 40 12.50

d. Tourism

var_name <- skt_data$brt_good_d
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACTshortfade) +
  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
Very good 104 32.50
Somewhat good 158 49.38
Somewhat bad 9 2.81
Very bad 6 1.88
I don’t know 43 13.44

e. Reducing traffic congestion

var_name <- skt_data$brt_good_e
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACTshortfade) +
  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
Very good 137 42.81
Somewhat good 126 39.38
Somewhat bad 20 6.25
Very bad 9 2.81
I don’t know 28 8.75

f. Health

var_name <- skt_data$brt_good_f
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACTshortfade) +
  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
Very good 95 29.69
Somewhat good 135 42.19
Somewhat bad 12 3.75
Very bad 3 0.94
I don’t know 75 23.44

g. Local business

var_name <- skt_data$brt_good_g
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACTshortfade) +
  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
Very good 136 42.50
Somewhat good 123 38.44
Somewhat bad 11 3.44
Very bad 5 1.56
I don’t know 45 14.06

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

var_name <- skt_data$brt_bus_more
skt_data$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "77" = "I don't know")
var_name_f <- skt_data$var_name_f

##### Table
t_1 <- skt_data %>%
          group_by(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")
plot(p)

kable(t_1)  %>%   kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
var_name_f n pct
Yes 256 80
No 64 20

In the current context, do you use transit less than, more than, or the same as you did prior to the COVID-19 pandemic?

var_name <- skt_data$cov_decon_mode_d
skt_data$var_name_f <- recode_factor(var_name, "1" = "Less", "2" = "Same as before", "3" = "More")
var_name_f <- skt_data$var_name_f

##### Table
t_1 <- skt_data %>%
          group_by(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")
plot(p)

kable(t_1)  %>%   kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
var_name_f n pct
Less 150 46.88
Same as before 129 40.31
More 41 12.81

Compared with before the COVID-19 pandemic, how would you rate your mental health (such as feeling anxious, depressed, or irritable) in general now?

var_name <- skt_data$sf_covid_mental
skt_data$var_name_f <- recode_factor(var_name, "1" = "Much better", "2" = "Slightly better", "3" = "About the same", "4" = "Slightly worse", "5" = "Much worse")
var_name_f <- skt_data$var_name_f

##### Table
t_1 <- skt_data %>%
          group_by(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 = INTERACT5likert) +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response")
plot(p)

kable(t_1)  %>%   kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
var_name_f n pct
Much better 54 16.88
Slightly better 73 22.81
About the same 95 29.69
Slightly worse 77 24.06
Much worse 21 6.56

Compared with before the COVID-19 pandemic, how would you rate your physical health in general now?

var_name <- skt_data$sf_covid_physical
skt_data$var_name_f <- recode_factor(var_name, "1" = "Much better", "2" = "Slightly better", "3" = "About the same", "4" = "Slightly worse", "5" = "Much worse")
var_name_f <- skt_data$var_name_f

##### Table
t_1 <- skt_data %>%
          group_by(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 = INTERACT5likert) +
  guides(fill=FALSE) +
      ylab("Percent") +
      xlab("Response")
plot(p)

kable(t_1)  %>%   kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
var_name_f n pct
Much better 59 18.44
Slightly better 86 26.88
About the same 90 28.12
Slightly worse 70 21.88
Much worse 15 4.69

What is your main mode of transportation?

transp_main_mode <- fromJSON('[
        {
          "label": "Walking",
          "value": 1
        },
        {
          "label": "Cycling",
          "value": 2
        },
        {
          "label": "Public Transit",
          "value": 3
        },
        {
          "label": "Car",
          "value": 4
        },
        {
          "label": "Motorcycle or scooter",
          "value": 5
        },
        {
          "label": "Other",
          "value": 99
        }
      ]') %>%
  mutate(label = factor(label, levels = label))

.ggpdf <- skt_data %>%
  left_join(transp_main_mode, by=c("transp_main_mode"="value")) %>%
  transmute(interact_id = interact_id,
            transp_main_mode = label)

table(.ggpdf$transp_main_mode, useNA = "ifany") %>%
  as.data.frame() %>%
  arrange(desc(Freq)) %>%
  kableExtra::kable(col.names=c('Main mode of transportation', 'N')) %>%
  kableExtra::kable_styling("hover", full_width = F)
Main mode of transportation N
Car 129
Public Transit 124
Cycling 34
Walking 30
Other 2
Motorcycle or scooter 1
skt_data %>%
  select(transp_main_mode_txt) %>%
  filter(!is.na(transp_main_mode_txt)) %>%
  unique() %>%
  kableExtra::kable(col.names = "Other listed main transportation modes") %>%
  kableExtra::kable_styling("hover", full_width = F)
Other listed main transportation modes
Bus and car
Rides with other people as I do not drive
ggplot(count(.ggpdf, transp_main_mode)) +
  geom_bar(aes(y=reorder(transp_main_mode, -n), x=n/nrow(skt_data), fill=reorder(transp_main_mode, -n)), stat="identity", show.legend = FALSE) +
  theme_light() +
  scale_fill_brewer(palette="GnBu", na.value = "grey", direction=-1) +
  scale_x_continuous(labels = percent) +
  ylab("transp_main_mode") + xlab("")

Do you have access to a car?

var_name <- skt_data$car_access
skt_data$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "77" = "I don't know")
var_name_f <- skt_data$var_name_f

##### Table
t_1 <- skt_data %>%
          group_by(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") 

plot(p)

kable(t_1)  %>%   kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
var_name_f n pct
Yes 252 78.75
No 68 21.25

Do you have access to a bike?

var_name <- skt_data$bike_access
skt_data$var_name_f <- recode_factor(var_name, "1" = "Yes", "2" = "No", "77" = "I don't know")
var_name_f <- skt_data$var_name_f

##### Table
t_1 <- skt_data %>%
          group_by(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") 
plot(p)

kable(t_1)  %>%   kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
var_name_f n pct
Yes 220 68.75
No 100 31.25

How much do you enjoy using each transportation mode?

a. Walking

var_name <- skt_data$preferred_mode_a2
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACT4likert) +
  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 135 42.19
2 92 28.75
3 80 25.00
4 Not at all 11 3.44
Not applicable 2 0.62

b. Biking

var_name <- skt_data$preferred_mode_b
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACT4likert) +
  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 80 25.00
2 82 25.62
3 66 20.62
4 Not at all 36 11.25
Not applicable 56 17.50

c. Public Transit

var_name <- skt_data$preferred_mode_c
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACT4likert) +
  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 76 23.75
2 109 34.06
3 88 27.50
4 Not at all 40 12.50
Not applicable 7 2.19

d. Car

var_name <- skt_data$preferred_mode_d
skt_data$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 <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACT4likert) +
  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 112 35.00
2 104 32.50
3 66 20.62
4 Not at all 19 5.94
Not applicable 19 5.94

f. Other (Please specify)

skt_data %>%
  select(preferred_mode_f_txt) %>%
  filter(!is.na(preferred_mode_f_txt)) %>%
  kableExtra::kable(col.names = "Enjoyment of other modes")
Enjoyment of other modes
I love public transit, but Saskatoon transit makes it awful. I want to love it, but it’s garbage. Make downtown inaccessible by car. Cars are stupid, people should all take public transit but here it’s only for losers who can’t afford cars. Nice job, mo.
Anything but garbage busses in this city
metro/subway/trains (when I lived in Asia and Europe)
Physical difficulties make some methods of travel difficult
While there are clear benefits to the BRT, it still suffers from the same problems as regular buses: vehicle congestion, train crossings, CO2 emissions
Taxi
I don’t bike in the city because I don’t feel safe. I would like to use the bus but the service does not meet my needs.
Uber/taxi
I do love to walk but can’t to far. The park by my place has benches every couple hundred feet so i walk walk there quite often
I find biking in Saskatoon to be awful compared to Ottawa where I used to live

On a scale of 1 to 5, with 1 being ‘very safe’ and 5 being ‘very dangerous’, overall, how safe do you think cycling is in your city?

var_name <- skt_data$bike_safety
skt_data$var_name_f <- recode_factor(var_name, "1" = "Very Safe","2" = "Somewhat safe", "3" = "Neither safe, nor unsafe", "4" = "Somewhat dangerous", "5" = "Very dangerous")
var_name_f <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACT5likert) +
  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
Very Safe 38 11.88
Somewhat safe 112 35.00
Neither safe, nor unsafe 42 13.12
Somewhat dangerous 88 27.50
Very dangerous 24 7.50
NA 16 5.00

On a scale of 1 to 5, with 1 being ‘very safe’ and 5 being ‘very dangerous’, overall, how safe do you think walking is in your city?

var_name <- skt_data$walk_safety
skt_data$var_name_f <- recode_factor(var_name, "1" = "Very Safe","2" = "Somewhat safe", "3" = "Neither safe, nor unsafe", "4" = "Somewhat dangerous", "5" = "Very dangerous")
var_name_f <- skt_data$var_name_f

t_1 <- skt_data %>%
          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 = INTERACT5likert) +
  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
Very Safe 90 28.12
Somewhat safe 162 50.62
Neither safe, nor unsafe 26 8.12
Somewhat dangerous 33 10.31
Very dangerous 9 2.81

How satisfied are you with your current levels of physical activity?

var_name <- skt_data$cov_decon_pa
skt_data$var_name_f <- recode_factor(var_name, "1" = "Very satisfied", 
                                                "2" = "Somewhat satisfied", 
                                                "3" = "Neutral", 
                                                "4" = "Somewhat dissatisfied", 
                                                "5" = "Very dissatisfied")
var_name_f <- skt_data$var_name_f

##### Table
t_1 <- skt_data %>%
          group_by(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")
plot(p)

kable(t_1)  %>%   kable_styling(bootstrap_options = "striped", full_width = T, position = "left")
var_name_f n pct
Very satisfied 70 21.88
Somewhat satisfied 140 43.75
Neutral 35 10.94
Somewhat dissatisfied 60 18.75
Very dissatisfied 15 4.69

Impacts

Minutes of physical activity

Minutes of total medium-vigorous physical activity per day, including work, travel, leisure. Computed from modpa and vigpa variables from health survey:

Global

.ggpdf <- skt_data %>%
  transmute(interact_id = interact_id,
            mvpa = ((coalesce(vigpa_days, 0) * coalesce(vigpa_freq, 0) + coalesce(modpa_days, 0) * coalesce(modpa_freq, 0))  / 7)) %>%   
  filter(mvpa >= 0 & mvpa < 900) 


# Link back MVPA to main dataset
skt_data <- skt_data %>%
  left_join(.ggpdf, by="interact_id") 

summary(skt_data$mvpa) %>% 
  as.list() %>%
  data.frame() %>%
  knitr::kable(digits = 1, col.names = c("Min", "1st Qu.", "Median", "Mean", "3rd Qu.", "Max")) %>%
  kableExtra::kable_styling("hover", full_width = F)
Min 1st Qu. Median Mean 3rd Qu. Max
0 17.1 34.3 63.5 68.6 822.9
fillCount = length(unique(.ggpdf$mvpa))
getPalette = colorRampPalette(RColorBrewer::brewer.pal(9, "GnBu"))

ggplot(skt_data) +
  geom_histogram(aes(mvpa, y=after_stat(count/sum(count)), fill=factor(mvpa)), binwidth=20, show.legend = F) +
  theme_light() +
  scale_fill_manual(values = getPalette(fillCount), na.value = "grey") +
  xlab("average minutes of MVPA per day, in the last 7 days") +
  scale_y_continuous(labels = percent) + ylab("")

By frequency of bus use

fillCount = length(unique(skt_data$mvpa))
getPalette = colorRampPalette(RColorBrewer::brewer.pal(9, "GnBu"))

ggplot(filter(skt_data, mvpa >=0)) +
  geom_histogram(aes(mvpa, y = after_stat(count/tapply(count, PANEL, sum)[PANEL]), fill=factor(mvpa)), binwidth=30, show.legend = F) +
  theme_light() +
  scale_fill_manual(values = getPalette(fillCount), na.value = "grey") +
  facet_wrap(vars(intervention_freq_use_class), ncol=3) + 
  xlab("average minutes of MVPA per day, in the last 7 days") +
  scale_y_continuous(labels = percent) + ylab("percent within each frequency group")

Health

Using sf1 variable: In general, would you say your health is…

Global

sf1 <- fromJSON('[
        {
          "label": "Excellent",
          "value": 1
        },
        {
          "label": "Very good",
          "value": 2
        },
        {
          "label": "Good",
          "value": 3
        },
        {
          "label": "Fair",
          "value": 4
        },
        {
          "label": "Poor",
          "value": 5
        }
      ]') %>%
  mutate(label = factor(label, levels = label))

.ggpdf <- skt_data %>%
  left_join(sf1, by=c("sf1"="value")) %>%
  transmute(interact_id = interact_id,
            sf1 = label)

table(.ggpdf$sf1, useNA = "ifany") %>%
  kableExtra::kable(col.names=c('Health status', 'N')) %>%
  kableExtra::kable_styling("hover", full_width = F)
Health status N
Excellent 39
Very good 113
Good 124
Fair 36
Poor 8
ggplot(.ggpdf) +
  geom_bar(aes(sf1, fill=sf1, y=after_stat(count/sum(count))), show.legend = FALSE) +
  theme_light() +
  #theme(axis.text.x=element_text(angle=30,hjust=1)) +
  scale_fill_brewer(palette="GnBu", na.value = "grey") +
  scale_y_continuous(labels = percent) + ylab("")

By frequency of bus use

.ggpdf <- skt_data %>%
  left_join(sf1, by=c("sf1"="value")) %>%
  transmute(interact_id = interact_id,
            intervention_freq_use_class = intervention_freq_use_class,
            sf1 = label)

rbind(table(pull(filter(.ggpdf, intervention_freq_use_class == bus_freq[1]), sf1)),
      table(pull(filter(.ggpdf, intervention_freq_use_class == bus_freq[2]), sf1)),
      table(pull(filter(.ggpdf, intervention_freq_use_class == bus_freq[3]), sf1))) %>%
  t() %>%
  kableExtra::kable(col.names = bus_freq) %>%
  kableExtra::kable_styling("hover", full_width = F)
less than once a week 1-3 times a week 4 or more times a week
Excellent 6 15 18
Very good 33 50 30
Good 33 50 41
Fair 17 8 11
Poor 2 4 2
ggplot(.ggpdf) +
  geom_bar(aes(sf1, y = after_stat(count/tapply(count, PANEL, sum)[PANEL]), fill=sf1), show.legend = FALSE) +
  theme_light() +
  theme(axis.text.x=element_text(angle=30,hjust=1)) +
  scale_fill_brewer(palette="GnBu", na.value = "grey") +
  facet_wrap(vars(intervention_freq_use_class), ncol=3) +
  scale_y_continuous(labels = percent) + ylab("percent within each frequency group")

Personal wellbeing

Overall life satisfaction, from 0 (completely dissatisfied) to 10 (completely satisfied). Computed from Personal Wellbeing Index (PWI) Scale, excluding the general life satisfaction (pwb_a) and spirituality items (pwb_i).

Global

skt_data <- skt_data %>%
  mutate(pwb = rowMeans(select(., pwb_b:pwb_h), na.rm = T)) # excluding pwb_a

.ggpdf <- skt_data %>%
  transmute(interact_id = interact_id,
            pwb = pwb,
            pwb_int = as.integer(round(pwb))) 

summary(.ggpdf$pwb) %>%
  as.list() %>%
  data.frame() %>%
  knitr::kable(digits = 1, col.names = c("Min", "1st Qu.", "Median", "Mean", "3rd Qu.", "Max")) %>%
  kableExtra::kable_styling("hover", full_width = F)
Min 1st Qu. Median Mean 3rd Qu. Max
2.4 6.3 7.3 7 8 10
fillCount = length(unique(.ggpdf$pwb_int))
getPalette = colorRampPalette(RColorBrewer::brewer.pal(9, "GnBu"))

ggplot(.ggpdf) +
  geom_histogram(aes(pwb, y=after_stat(count/sum(count)), fill=factor(pwb_int)), binwidth=1, show.legend = F) +
  theme_light() +
  scale_fill_manual(values = getPalette(fillCount), na.value = "grey") +
  scale_y_continuous(labels = percent) + ylab("")

By frequency of bus use

.ggpdf <- skt_data %>%
  transmute(interact_id = interact_id,
            intervention_freq_use_class = intervention_freq_use_class,
            pwb = pwb,
            pwb_int = as.integer(round(pwb))) 

fillCount = length(unique(.ggpdf$pwb_int))
getPalette = colorRampPalette(RColorBrewer::brewer.pal(9, "GnBu"))

ggplot(.ggpdf) +
  geom_histogram(aes(pwb, y = after_stat(count/tapply(count, PANEL, sum)[PANEL]), fill=factor(pwb_int)), binwidth=1, show.legend = F) +
  theme_light() +
  scale_fill_manual(values = getPalette(fillCount), na.value = "grey") +
  facet_wrap(vars(intervention_freq_use_class), ncol=3) +
  scale_y_continuous(labels = percent) + ylab("percent within each frequency group")

Number of close friends

Global

summary(skt_data$confide) %>%
  as.list() %>%
  data.frame() %>%
  knitr::kable(digits = 1, col.names = c("Min", "1st Qu.", "Median", "Mean", "3rd Qu.", "Max")) %>%
  kableExtra::kable_styling("hover", full_width = F)
Min 1st Qu. Median Mean 3rd Qu. Max
0 2 3 4.4 5 50
fillCount = length(unique(skt_data$confide))
getPalette = colorRampPalette(RColorBrewer::brewer.pal(9, "GnBu"))

ggplot(skt_data) +
  geom_histogram(aes(confide, y=after_stat(count/sum(count)), fill=factor(confide)), binwidth=2, show.legend = F) +
  theme_light() +
  scale_fill_manual(values = getPalette(fillCount), na.value = "grey") +
  scale_y_continuous(labels = percent) + ylab("")

By frequency of bus use

fillCount = length(unique(skt_data$confide))
getPalette = colorRampPalette(RColorBrewer::brewer.pal(9, "GnBu"))

ggplot(skt_data) +
  geom_histogram(aes(confide, y = after_stat(count/tapply(count, PANEL, sum)[PANEL]), fill=factor(confide)), binwidth=5, show.legend = F) +
  theme_light() +
  scale_fill_manual(values = getPalette(fillCount), na.value = "grey") +
  facet_wrap(vars(intervention_freq_use_class), ncol=3) +
  scale_y_continuous(labels = percent) + ylab("percent within each frequency group")

Sense of belonging

Global

belonging <- fromJSON('[
        {
          "label": "Very strong",
          "value": 1
        },
        {
          "label": "Somewhat strong",
          "value": 2
        },
        {
          "label": "Somewhat weak",
          "value": 3
        },
        {
          "label": "Very weak",
          "value": 4
        },
        {
          "label": "I don’t know",
          "value": 77
        }
      ]') %>%
  mutate(label = factor(label, levels = label))

.ggpdf <- skt_data %>%
  left_join(belonging, by=c("belonging"="value")) %>%
  transmute(interact_id = interact_id,
            belonging = label)

table(.ggpdf$belonging, useNA = "ifany") %>%
  kableExtra::kable(col.names=c('Sense of belonging', 'N')) %>%
  kableExtra::kable_styling("hover", full_width = F)
Sense of belonging N
Very strong 54
Somewhat strong 129
Somewhat weak 94
Very weak 27
I don’t know 16
ggplot(.ggpdf) +
  geom_bar(aes(belonging, y=after_stat(count/sum(count)), fill=belonging), show.legend = FALSE) +
  theme_light() +
  theme(axis.text.x=element_text(angle=30,hjust=1)) +
  scale_fill_brewer(palette="GnBu", na.value = "grey") +
  scale_y_continuous(labels = percent) + ylab("")

By frequency of bus use

.ggpdf <- skt_data %>%
  left_join(belonging, by=c("belonging"="value")) %>%
  transmute(interact_id = interact_id,
            intervention_freq_use_class = intervention_freq_use_class,
            belonging = label)

rbind(table(pull(filter(.ggpdf, intervention_freq_use_class == bus_freq[1]), belonging)),
      table(pull(filter(.ggpdf, intervention_freq_use_class == bus_freq[2]), belonging)),
      table(pull(filter(.ggpdf, intervention_freq_use_class == bus_freq[3]), belonging))) %>%
  t() %>%
  kableExtra::kable(col.names = bus_freq) %>%
  kableExtra::kable_styling("hover", full_width = F)
less than once a week 1-3 times a week 4 or more times a week
Very strong 8 23 23
Somewhat strong 36 53 40
Somewhat weak 28 37 29
Very weak 14 6 7
I don’t know 5 8 3
ggplot(.ggpdf) +
  geom_bar(aes(belonging, y = after_stat(count/tapply(count, PANEL, sum)[PANEL]), fill=belonging), show.legend = FALSE) +
  theme_light() +
  theme(axis.text.x=element_text(angle=30,hjust=1)) +
  scale_fill_brewer(palette="GnBu", na.value = "grey") + 
  facet_wrap(vars(intervention_freq_use_class), ncol = 3) +
  scale_y_continuous(labels = percent) + ylab("percent within each frequency group")

Loneliness

Derived from 3 items:

  1. How often do you feel left out;
  2. lack companionship;
  3. feel isolated.

Responses are rated as either 1 (hardly ever), 2 (some of the time), or 3 (often), and summed to a total score from 3 to 9. Higher scores indicate greater loneliness.

Global

skt_data <- skt_data %>%
  mutate(loneliness = loneliness_a + loneliness_b + loneliness_c)

summary(skt_data$loneliness) %>%
  as.list() %>%
  data.frame() %>%
  knitr::kable(digits = 1, col.names = c("Min", "1st Qu.", "Median", "Mean", "3rd Qu.", "Max")) %>%
  kableExtra::kable_styling("hover", full_width = F)
Min 1st Qu. Median Mean 3rd Qu. Max
3 3 5 4.8 6 9
ggplot(skt_data) +
  geom_bar(aes(factor(loneliness), y=after_stat(count/sum(count)), fill=factor(loneliness)), show.legend = F) +
  theme_light() +
  labs(x = "loneliness") +
  scale_fill_brewer(palette="GnBu", na.value = "grey", ) +
  scale_y_continuous(labels = percent) + ylab("")

By frequency of bus use

ggplot(skt_data) +
  geom_bar(aes(factor(loneliness), y = after_stat(count/tapply(count, PANEL, sum)[PANEL]), fill=factor(loneliness)), show.legend = F) +
  theme_light() +
  labs(x = "loneliness") +
  scale_fill_brewer(palette="GnBu", na.value = "grey", ) + 
  facet_wrap(vars(intervention_freq_use_class), ncol = 3) +
  scale_y_continuous(labels = percent) + ylab("percent within each frequency group")

Social cohesion

Derived from 5 items:

  1. people around here are willing to help their neighbors;
  2. this is a close-knit neighborhood;
  3. people in this neighborhood can be trusted;
  4. people in this neighborhood generally do not get along with one another; and
  5. people in this neighborhood do not share the same values.

Average of 5 items scored on a scale from strongly agree to strongly disagree. Higher score indicates higher social cohesion.

Global

skt_data <- skt_data %>%
  mutate(spat_soc_cohesion = (spat2_a + 6 - spat2_b + spat2_c + 6 - spat2_d + spat2_e) / 5)

summary(skt_data$spat_soc_cohesion) %>%
  as.list() %>%
  data.frame() %>%
  knitr::kable(digits = 1, col.names = c("Min", "1st Qu.", "Median", "Mean", "3rd Qu.", "Max")) %>%
  kableExtra::kable_styling("hover", full_width = F)
Min 1st Qu. Median Mean 3rd Qu. Max
1.4 3.2 3.6 3.5 3.8 5
ggplot(skt_data) +
  geom_bar(aes(factor(as.integer(round(spat_soc_cohesion))), y=after_stat(count/sum(count)), fill=factor(as.integer(round(spat_soc_cohesion)))), show.legend = F) +
  theme_light() +
  labs(x = "spat_soc_cohesion") +
  scale_fill_brewer(palette="GnBu", na.value = "grey", )  +
  scale_y_continuous(labels = percent) + ylab("")

By frequency of bus use

ggplot(skt_data) +
  geom_bar(aes(factor(as.integer(round(spat_soc_cohesion))), y = after_stat(count/tapply(count, PANEL, sum)[PANEL]), fill=factor(as.integer(round(spat_soc_cohesion)))), show.legend = F) +
  theme_light() +
  labs(x = "spat_soc_cohesion") +
  scale_fill_brewer(palette="GnBu", na.value = "grey", ) +
  facet_wrap(vars(intervention_freq_use_class), ncol = 3) +
  scale_y_continuous(labels = percent) + ylab("percent within each frequency group")

Neighbouring (informal)

Frequency of informal social interactions among neighbours (saying hello or having chat) per week, on a scale of 0 (never) to 7 (almost daily).

Global

# spa_freq <- fromJSON('[
#         {
#           "label": "per week",
#           "coeff": 52,
#           "value": 1
#         },
#         {
#           "label": "per month",
#           "coeff": 12,
#           "value": 2
#         },
#         {
#           "label": "per year",
#           "coeff": 1,
#           "value": 3
#         }
#       ]') %>%
#   mutate(label = factor(label, levels = label))
# 
.existing_cols <- colnames(skt_data)

skt_data <- skt_data %>%
  mutate(spat_talking_nghb = (coalesce(spat_a, 0) + coalesce(spat_b, 0)) /2 / 52) %>%
  select(.existing_cols, spat_talking_nghb)

summary(skt_data$spat_talking_nghb) %>%
  as.list() %>%
  data.frame() %>%
  knitr::kable(digits = 1, col.names = c("Min", "1st Qu.", "Median", "Mean", "3rd Qu.", "Max")) %>%
  kableExtra::kable_styling("hover", full_width = F)
Min 1st Qu. Median Mean 3rd Qu. Max
0 0.5 1.5 2 3 7
ggplot(skt_data) +
  geom_histogram(aes(spat_talking_nghb, y=after_stat(count/sum(count)), fill=factor(as.integer(round(spat_talking_nghb)))), binwidth=1, show.legend = F) +
  theme_light() +
  scale_fill_brewer(palette="GnBu", na.value = "grey") +
  scale_y_continuous(labels = percent) + ylab("")

By frequency of bus use

ggplot(skt_data) +
  geom_histogram(aes(spat_talking_nghb, y = after_stat(count/tapply(count, PANEL, sum)[PANEL]), fill=factor(as.integer(round(spat_talking_nghb)))), binwidth=1, show.legend = F) +
  theme_light() +
  scale_fill_brewer(palette="GnBu", na.value = "grey") +
  facet_wrap(vars(intervention_freq_use_class), ncol = 3) +
  scale_y_continuous(labels = percent) + ylab("percent within each frequency group")

Neighbouring (formal)

Frequency of formal social interactions among neighbours (visiting or going somewhere with neighbour, giving or receiving help from neighbour) per week, on a scale of 0 (never) to 7 (almost daily).

Global

.existing_cols <- colnames(skt_data)

skt_data <- skt_data %>%
  mutate(spat_interact_nghb = (coalesce(spat_c, 0) + coalesce(spat_2e, 0)) / 2 / 52) %>%
  select(.existing_cols, spat_interact_nghb)

summary(skt_data$spat_interact_nghb) %>%
  as.list() %>%
  data.frame() %>%
  knitr::kable(digits = 1, col.names = c("Min", "1st Qu.", "Median", "Mean", "3rd Qu.", "Max")) %>%
  kableExtra::kable_styling("hover", full_width = F)
Min 1st Qu. Median Mean 3rd Qu. Max
0 0 0 0.3 0.3 6.5
fillCount = length(unique(as.integer(round(skt_data$spat_interact_nghb))))
getPalette = colorRampPalette(RColorBrewer::brewer.pal(9, "GnBu"))

ggplot(skt_data) +
  geom_histogram(aes(spat_interact_nghb, y=after_stat(count/sum(count)), fill=factor(as.integer(round(spat_interact_nghb)))), binwidth = 1, show.legend = F) +
  theme_light() +
  scale_fill_manual(values = getPalette(fillCount), na.value = "grey") +
  scale_y_continuous(labels = percent) + ylab("")

By frequency of bus use

ggplot(skt_data) +
  geom_histogram(aes(spat_interact_nghb, y = after_stat(count/tapply(count, PANEL, sum)[PANEL]), fill=factor(as.integer(round(spat_interact_nghb)))), binwidth=1, show.legend = F) +
  theme_light() +
  scale_fill_brewer(palette="GnBu", na.value = "grey") +
  facet_wrap(vars(intervention_freq_use_class), ncol = 3) +
  scale_y_continuous(labels = percent) + ylab("percent within each frequency group")