Skip to content

Commit c280875

Browse files
committed
Make it COVID-19 Trends, not COVID Trends
1 parent fcd61e5 commit c280875

File tree

12 files changed

+97
-71
lines changed

12 files changed

+97
-71
lines changed

docs/api/covidcast-signals/fb-survey.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
title: COVID Trends and Impact Survey
2+
title: COVID-19 Trends and Impact Survey
33
parent: Data Sources and Signals
44
grand_parent: COVIDcast Epidata API
55
---
66

7-
# COVID Trends and Impact Survey
7+
# COVID-19 Trends and Impact Survey
88
{: .no_toc}
99

1010
* **Source name:** `fb-survey`
@@ -17,7 +17,7 @@ grand_parent: COVIDcast Epidata API
1717

1818
## Overview
1919

20-
This data source is based on the [COVID Trends and Impact Survey
20+
This data source is based on the [COVID-19 Trends and Impact Survey
2121
(CTIS)](../../symptom-survey/) run by the Delphi group at Carnegie Mellon.
2222
Facebook directs a random sample of its users to these surveys, which are
2323
voluntary. Users age 18 or older are eligible to complete the surveys, and

docs/symptom-survey/coding.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Questions and Coding
3-
parent: COVID Trends and Impact Survey
3+
parent: COVID-19 Trends and Impact Survey
44
nav_order: 6
55
---
66

docs/symptom-survey/collaboration-revision.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
---
22
title: Collaboration and Survey Revision
3-
parent: COVID Trends and Impact Survey
3+
parent: COVID-19 Trends and Impact Survey
44
nav_order: 1
55
---
66

77
# Collaboration and Survey Revision
88

9-
Delphi continues to revise the COVID Trends and Impact Survey (CTIS)
10-
instruments in order to prioritize items that have the greatest utility for
11-
the response to the COVID-19 pandemic. We conduct revisions in collaboration
12-
with data users, fellow researchers, and public health officials, to ensure
13-
the survey data best serves public health and research goals.
9+
Delphi continues to revise the COVID-19 Trends and Impact Survey (CTIS)
10+
instruments in order to prioritize items that have the greatest utility for the
11+
response to the COVID-19 pandemic. We conduct revisions in collaboration with
12+
data users, fellow researchers, and public health officials, to ensure the
13+
survey data best serves public health and research goals.
1414

1515
## Proposing Revisions
1616

1717
If there is a revision or question you would like us to consider, please fill
1818
out [this form requesting details about your
1919
proposal](https://forms.gle/q6NS8fPJJofKQ9mM8). This request can be submitted by
2020
researchers regardless of whether they have a signed Data Use Agreement for the
21-
individual responses to the COVID Trends and Impact Survey.
21+
individual responses to the COVID-19 Trends and Impact Survey.
2222

2323
## Collaboration Meetings
2424

docs/symptom-survey/contingency-tables.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: Contingency Tables
3-
parent: COVID Trends and Impact Survey
3+
parent: COVID-19 Trends and Impact Survey
44
nav_order: 4
55
---
66

77
# Contingency Tables
88
{: .no_toc}
99

1010
This documentation describes the fine-resolution contingency tables produced by
11-
grouping [COVID Trends and Impact Survey (CTIS)](./index.md) individual responses by various
11+
grouping [COVID-19 Trends and Impact Survey (CTIS)](./index.md) individual responses by various
1212
self-reported demographic features.
1313

1414
* [Weekly files](https://www.cmu.edu/delphi-web/surveys/weekly-rollup/)

docs/symptom-survey/data-access.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
title: Getting Data Access
3-
parent: COVID Trends and Impact Survey
3+
parent: COVID-19 Trends and Impact Survey
44
nav_order: 0
55
---
66

77
# Getting Data Access
88

99
The Delphi Research Group at Carnegie Mellon University (CMU), in partnership
10-
with Facebook, has conducted the COVID Trends and Impact Survey (CTIS) to
10+
with Facebook, has conducted the COVID-19 Trends and Impact Survey (CTIS) to
1111
better understand the spread of COVID-19 and its effects on public health and
1212
well-being. This may help improve our local and national responses to the
1313
pandemic and our understanding of how it has affected society.

docs/symptom-survey/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
title: COVID Trends and Impact Survey
2+
title: COVID-19 Trends and Impact Survey
33
has_children: true
44
nav_order: 2
55
---
66

7-
# COVID Trends and Impact Survey
7+
# COVID-19 Trends and Impact Survey
88

99
Since April 2020, Delphi has conducted a voluntary COVID-19 symptom survey,
1010
distributed daily to users in the United States via a partnership with Facebook.
@@ -29,7 +29,7 @@ If you have questions about the survey or getting access to data, contact us at
2929

3030
## Credits
3131

32-
The COVID Trends and Impact Survey (CTIS) is a project of the [Delphi
32+
The COVID-19 Trends and Impact Survey (CTIS) is a project of the [Delphi
3333
Group](https://delphi.cmu.edu/) at Carnegie Mellon University. The Principal
3434
Investigator is [Alex Reinhart](https://www.refsmmat.com/); Wichada La
3535
Motte-Kerr is Survey Coordinator. The survey protocol is reviewed by the
@@ -59,7 +59,7 @@ the survey in publications based on the data. Specifically, we ask that you:
5959
2. Cite this web page for details about the survey. For example, you may cite it
6060
as
6161

62-
> Delphi Group (2021). COVID Trends and Impact Survey.
62+
> Delphi Group (2021). COVID-19 Trends and Impact Survey.
6363
> <https://cmu-delphi.github.io/delphi-epidata/symptom-survey/>
6464
6565
A journal article describing the survey and its methods is currently in

docs/symptom-survey/modules.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: Survey Modules & Randomization
3-
parent: COVID Trends and Impact Survey
3+
parent: COVID-19 Trends and Impact Survey
44
nav_order: 7
55
---
66

77
# Questions and Coding
88
{: .no_toc}
99

1010
To reduce the overall length of the instrument and minimize response burden,
11-
the COVID Trends and Impact Survey (CTIS) will consist of a block of daily
11+
the COVID-19 Trends and Impact Survey (CTIS) will consist of a block of daily
1212
core questions and will use a randomized module approach for the other topics.
1313
Implementation of this approach started in [Wave 11](coding.md#wave-11), which
1414
launched on May 20, 2021.

docs/symptom-survey/problems.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
title: Problems and Data Errors
3-
parent: COVID Trends and Impact Survey
3+
parent: COVID-19 Trends and Impact Survey
44
nav_order: 8
55
---
66

77
# Problems and Data Errors
88
{: .no_toc}
99

10-
Given the scale of the COVID Trends and Impact Survey (CTIS), we occasionally
10+
Given the scale of the COVID-19 Trends and Impact Survey (CTIS), we occasionally
1111
encounter data errors or survey implementation problems that affect the
1212
interpretation of results. All problems will be logged here.
1313

docs/symptom-survey/server-access.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
title: SFTP Server Access
3-
parent: COVID Trends and Impact Survey
3+
parent: COVID-19 Trends and Impact Survey
44
nav_order: 2
55
---
66

77
# SFTP Server Access
88

9-
Researchers with data use agreements to access the raw data from the COVID
9+
Researchers with data use agreements to access the raw data from the COVID-19
1010
Trends and Impact Survey (CTIS) can access the data over SFTP. (If you do not
1111
have a data use agreement, see the [main survey page](index.md) for
1212
information about getting access and about aggregate data that is available

docs/symptom-survey/survey-files.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
title: Response Files
3-
parent: COVID Trends and Impact Survey (CTIS)
3+
parent: COVID-19 Trends and Impact Survey (CTIS)
44
nav_order: 3
55
---
66

77
# Response Files
88
{: .no_toc}
99

10-
Users with access to the [COVID Trends and Impact Survey (CTIS)](./index.md)
10+
Users with access to the [COVID-19 Trends and Impact Survey (CTIS)](./index.md)
1111
individual response data should have received SFTP credentials for a private
1212
server where the data are stored. To connect to the server, see the [server
1313
access documentation](server-access.md). This documentation describes the

docs/symptom-survey/survey-utils.R

Lines changed: 69 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ library(dplyr)
1212
#' This function extracts the date from each file, determines which files
1313
#' contain reissued data, and produces a single data frame representing the most
1414
#' recent data available for each day. It can read gzip-compressed CSV files,
15-
#' such as those on the SFTP site, using `readr::read_csv`.
15+
#' such as those on the SFTP site, using `readr::read_csv()`.
1616
#'
1717
#' This function handles column types correctly for surveys up to Wave 4.
1818
#'
@@ -38,57 +38,83 @@ get_survey_df <- function(directory, pattern = "*.csv.gz$") {
3838
big_df <- map_dfr(
3939
latest_files,
4040
function(f) {
41-
# stop readr from thinking commas = thousand separators,
42-
# and from inferring column types incorrectly
43-
read_csv(file.path(directory, f), locale = locale(grouping_mark = ""),
41+
# stop readr from thinking commas = thousand separators, and from
42+
# inferring column types incorrectly
43+
read_csv(file.path(directory, f),
44+
locale = locale(grouping_mark = ""),
4445
col_types = cols(
46+
UserLanguage = col_character(),
47+
StartDatetime = col_datetime(),
48+
EndDatetime = col_datetime(),
49+
weight = col_number(),
50+
wave = col_integer(),
51+
fips = col_character(),
52+
A2 = col_number(),
53+
A5_1 = col_number(),
54+
A5_2 = col_number(),
55+
A5_3 = col_number(),
4556
A2b = col_number(),
4657
A3 = col_character(),
4758
A4 = col_number(),
48-
B2 = col_character(),
49-
B2_14_TEXT = col_character(),
50-
B2c = col_character(),
51-
B2c_14_TEXT = col_character(),
52-
B4 = col_number(),
53-
B5 = col_number(),
54-
B7 = col_character(),
55-
B10b = col_character(),
56-
B12a = col_character(),
57-
C1 = col_character(),
58-
C3 = col_number(),
59-
C4 = col_number(),
60-
C5 = col_number(),
61-
C7 = col_number(),
62-
C13 = col_character(),
63-
C13a = col_character(),
64-
D1_4_TEXT = col_character(),
65-
E3 = col_character(),
66-
fips = col_character(),
67-
UserLanguage = col_character(),
68-
StartDatetime = col_character(),
69-
EndDatetime = col_character(),
70-
Q65 = col_integer(),
71-
Q66 = col_integer(),
72-
Q67 = col_integer(),
73-
Q68 = col_integer(),
74-
Q69 = col_integer(),
75-
Q70 = col_integer(),
76-
Q71 = col_integer(),
77-
Q72 = col_integer(),
78-
Q73 = col_integer(),
79-
Q74 = col_integer(),
80-
Q75 = col_integer(),
81-
Q76 = col_integer(),
82-
Q77 = col_integer(),
83-
Q78 = col_integer(),
84-
Q79 = col_integer(),
85-
Q80 = col_integer(),
86-
.default = col_number()))
59+
B2b = col_number(),
60+
.default = col_character()))
8761
}
8862
)
8963
return(big_df)
9064
}
9165

66+
#' Split multiselect options into codable form
67+
#'
68+
#' Multiselect options are coded by Qualtrics as a comma-separated string of
69+
#' selected options, like "1,14", or the empty string if no options are
70+
#' selected. Split these into vectors of selected options, which can be queried
71+
#' using `is_selected()`.
72+
#'
73+
#' @param column vector of selections, like c("1,4", "5", ...)
74+
#' @return list of same length, each entry of which is a vector of selected
75+
#' options
76+
split_options <- function(column) {
77+
return(strsplit(column, ",", fixed = TRUE))
78+
}
79+
80+
#' Test if a specific choice is selected in a multiselect item
81+
#'
82+
#' This is used for items that allow respondents to select multiple options from
83+
#' a list, such as the symptoms items. Checking whether a specific selection is
84+
#' selected in either "" (empty string) or `NA` responses will produce `NA`s, so
85+
#' that empty responses are treated as missing, rather than as the item not
86+
#' being selected.
87+
#'
88+
#' @param vec A list whose entries are character vectors, such as c("14", "15"),
89+
#' as produced by `split_options()`.
90+
#' @param selection one string, such as "14", representing the answer choice of
91+
#' interest
92+
#' @return a logical vector; for each entry in `vec`, the boolean indicates
93+
#' whether `selection` is contained in the character vector.
94+
#' @examples
95+
#' \dontrun{
96+
#' symptoms <- split_options(data$B2)
97+
#'
98+
#' # vector of T/F/NA for each respondent's fever status
99+
#' fever <- is_selected(symptoms, "1")
100+
#' }
101+
is_selected <- function(vec, selection) {
102+
selections <- unlist(lapply(
103+
vec,
104+
function(resp) {
105+
if (length(resp) == 0 || all(is.na(resp))) {
106+
# Qualtrics files code no selection as "" (empty string), which is
107+
# parsed by `read_csv()` as `NA` (missing) by default. Since all our
108+
# selection items include "None of the above" or similar, treat both no
109+
# selection ("") or missing (NA) as missing, for generality.
110+
NA
111+
} else {
112+
selection %in% resp
113+
}
114+
}))
115+
116+
return(selections)
117+
}
92118
## Helper function to extract dates from each file's filename.
93119
get_file_properties <- function(filename) {
94120
short <- strsplit(filename, ".", fixed = TRUE)[[1]][1]

docs/symptom-survey/weights.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Survey Weights
3-
parent: COVID Trends and Impact Survey
3+
parent: COVID-19 Trends and Impact Survey
44
nav_order: 5
55
---
66

0 commit comments

Comments
 (0)