Data from Imperial College London YouGov Covid 19 Behaviour Tracker Data Hub (https://github.com/YouGov-Data/covid-19-tracker). From the website:
YouGov has partnered with the Institute of Global Health Innovation (IGHI) at Imperial College London to gather global insights on people’s behaviours in response to COVID-19. The research will cover 29 countries, interviewing around 21,000 people each week. It is designed to provide behavioural analysis on how different populations are responding to the pandemic, helping public health bodies in their efforts to limit the impact of the disease. Anonymised respondent level data will be available for all public health and academic institutions globally. The questions in the survey, led by IGHI, cover data on testing, symptoms, self-isolating in response to symptoms and the ability and willingness to self-isolate if needed. It also looks at behaviours, including going outdoors, working outside the home, contact with others, hand washing and the extent of compliance with 20 common preventative measures.
Respondents were asked to what extent they agreed (response 7) or disagreed (response 1) with the statement, “My life has been greatly affected by coronavirus (COVID-19)”. Here we categorize a response of 5 or greater as agreement.
Respondents were also asked “On how many days last week did you leave your house?” and “On how many of those days did you wear a face mask or covering?”. This was converted to a variable “Always wore mask when outside” (Yes or No).
The survey was conducted during each week of the pandemic, starting March 31st 2020. The above questions were not asked during all of the weeks.
Gender was summarized.
options(dplyr.summarise.inform = FALSE)
library(dplyr)
library(vtree)
library(RCurl)
library(httr)
data <- read.csv(
"https://raw.github.com/YouGov-Data/covid-19-tracker/master/data/canada.csv",
encoding = "UTF-8")
z <- data %>%
mutate(
qweek_number = as.numeric(gsub("^week ","",qweek)),
r1_7 = replace(r1_7,r1_7==" ",NA),
enddate = strftime(strptime(
endtime,format="%d/%m/%Y %H:%M"),format="%Y-%m-%d"),
always=ifelse(m2>0 & m3>0,"Yes","No"),
affected = if_else(r1_7>=5,"Yes","No")) %>%
arrange(qweek_number) %>%
mutate(
qweek = factor(qweek,levels=unique(qweek)))
z <- z %>%
group_by(qweek) %>%
mutate(qdate=first(enddate)) %>%
ungroup()
availability <- z %>%
group_by(qweek) %>%
summarize(
all_missing_r1_7=all(is.na(r1_7)),
all_missing_m2=all(is.na(m2))) %>%
mutate(weeks_with_both = if_else(
!all_missing_r1_7 & !all_missing_m2,"Yes","No"))
u <- z %>% right_join(availability,by="qweek")
vtree(u,"weeks_with_both gender affected always",
labelvar=c(
weeks_with_both="Both behaviour questions were asked",
qdate="Questionnaire date",
always="Always wore mask when outside",
affected="My life has been greatly affected by coronavirus (COVID-19)"),
summary="qdate \n\n%list_%%var=weeks_with_both%",
keep=list(weeks_with_both="Yes",always="Yes"),
title="Canada\ntotal responses:")