Skip to content

Commit 4998545

Browse files
authored
Merge pull request #1303 from cmu-delphi/final-wave-12-changes
Survey changes for the finalized version of Wave 12
2 parents 8d96199 + 92f432c commit 4998545

File tree

6 files changed

+225
-30
lines changed

6 files changed

+225
-30
lines changed

ansible/templates/facebook-params-prod.json.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"Survey of COVID-Like Illness - Wave 10": "fb-survey",
3838
"Survey of COVID-Like Illness - Wave 11": "fb-survey",
3939
"Survey of COVID-Like Illness - Wave 12": "fb-survey",
40+
"Survey of COVID-Like Illness - Wave 12 - Full Launch": "fb-survey",
4041
"Survey of COVID-Like Illness - Wave 4": "fb-survey",
4142
"Survey of COVID-Like Illness - Wave 5": "fb-survey",
4243
"Survey of COVID-Like Illness - Wave 6": "fb-survey",

facebook/delphiFacebook/R/binary.R

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ get_binary_indicators <- function() {
129129

130130
"smoothed_vaccinate_children", "weight_unif", "v_vaccinate_children", 6, compute_binary_response, jeffreys_binary,
131131
"smoothed_wvaccinate_children", "weight", "v_vaccinate_children", 6, compute_binary_response, jeffreys_binary,
132+
"smoothed_vaccinate_child_oldest", "weight_unif", "v_vaccinate_child_oldest", 6, compute_binary_response, jeffreys_binary,
133+
"smoothed_wvaccinate_child_oldest", "weight", "v_vaccinate_child_oldest", 6, compute_binary_response, jeffreys_binary,
134+
132135
"smoothed_try_vaccinate_1m", "weight_unif", "v_try_vaccinate_1m", 6, compute_binary_response, jeffreys_binary,
133136
"smoothed_wtry_vaccinate_1m", "weight", "v_try_vaccinate_1m", 6, compute_binary_response, jeffreys_binary,
134137

@@ -193,7 +196,9 @@ get_binary_indicators <- function() {
193196
"smoothed_whesitancy_reason_pregnant", "weight", "v_hesitancy_reason_pregnant", 6, compute_binary_response, jeffreys_binary,
194197
"smoothed_hesitancy_reason_religious", "weight_unif", "v_hesitancy_reason_religious", 6, compute_binary_response, jeffreys_binary,
195198
"smoothed_whesitancy_reason_religious", "weight", "v_hesitancy_reason_religious", 6, compute_binary_response, jeffreys_binary,
196-
199+
"smoothed_hesitancy_reason_dislike_vaccines_generally", "weight_unif", "v_hesitancy_reason_dislike_vaccines_generally", 6, compute_binary_response, jeffreys_binary,
200+
"smoothed_whesitancy_reason_dislike_vaccines_generally", "weight", "v_hesitancy_reason_dislike_vaccines_generally", 6, compute_binary_response, jeffreys_binary,
201+
197202
# vaccine barriers
198203
"smoothed_vaccine_barrier_eligible", "weight_unif", "v_vaccine_barrier_eligible", 6, compute_binary_response, jeffreys_binary,
199204
"smoothed_wvaccine_barrier_eligible", "weight", "v_vaccine_barrier_eligible", 6, compute_binary_response, jeffreys_binary,
@@ -219,6 +224,10 @@ get_binary_indicators <- function() {
219224
"smoothed_wvaccine_barrier_type", "weight", "v_vaccine_barrier_type", 6, compute_binary_response, jeffreys_binary,
220225
"smoothed_vaccine_barrier_none", "weight_unif", "v_vaccine_barrier_none", 6, compute_binary_response, jeffreys_binary,
221226
"smoothed_wvaccine_barrier_none", "weight", "v_vaccine_barrier_none", 6, compute_binary_response, jeffreys_binary,
227+
"smoothed_vaccine_barrier_appointment_location", "weight_unif", "v_vaccine_barrier_appointment_location", 6, compute_binary_response, jeffreys_binary,
228+
"smoothed_wvaccine_barrier_appointment_location", "weight", "v_vaccine_barrier_appointment_location", 6, compute_binary_response, jeffreys_binary,
229+
"smoothed_vaccine_barrier_other", "weight_unif", "v_vaccine_barrier_other", 6, compute_binary_response, jeffreys_binary,
230+
"smoothed_wvaccine_barrier_other", "weight", "v_vaccine_barrier_other", 6, compute_binary_response, jeffreys_binary,
222231

223232
# vaccine barriers for vaccinated
224233
"smoothed_vaccine_barrier_eligible_has", "weight_unif", "v_vaccine_barrier_eligible_has", 6, compute_binary_response, jeffreys_binary,
@@ -245,6 +254,10 @@ get_binary_indicators <- function() {
245254
"smoothed_wvaccine_barrier_type_has", "weight", "v_vaccine_barrier_type_has", 6, compute_binary_response, jeffreys_binary,
246255
"smoothed_vaccine_barrier_none_has", "weight_unif", "v_vaccine_barrier_none_has", 6, compute_binary_response, jeffreys_binary,
247256
"smoothed_wvaccine_barrier_none_has", "weight", "v_vaccine_barrier_none_has", 6, compute_binary_response, jeffreys_binary,
257+
"smoothed_vaccine_barrier_appointment_location_has", "weight_unif", "v_vaccine_barrier_appointment_location_has", 6, compute_binary_response, jeffreys_binary,
258+
"smoothed_wvaccine_barrier_appointment_location_has", "weight", "v_vaccine_barrier_appointment_location_has", 6, compute_binary_response, jeffreys_binary,
259+
"smoothed_vaccine_barrier_other_has", "weight_unif", "v_vaccine_barrier_other_has", 6, compute_binary_response, jeffreys_binary,
260+
"smoothed_wvaccine_barrier_other_has", "weight", "v_vaccine_barrier_other_has", 6, compute_binary_response, jeffreys_binary,
248261

249262
# vaccine barriers for attempted vaccinated
250263
"smoothed_vaccine_barrier_eligible_tried", "weight_unif", "v_vaccine_barrier_eligible_tried", 6, compute_binary_response, jeffreys_binary,
@@ -271,6 +284,11 @@ get_binary_indicators <- function() {
271284
"smoothed_wvaccine_barrier_type_tried", "weight", "v_vaccine_barrier_type_tried", 6, compute_binary_response, jeffreys_binary,
272285
"smoothed_vaccine_barrier_none_tried", "weight_unif", "v_vaccine_barrier_none_tried", 6, compute_binary_response, jeffreys_binary,
273286
"smoothed_wvaccine_barrier_none_tried", "weight", "v_vaccine_barrier_none_tried", 6, compute_binary_response, jeffreys_binary,
287+
"smoothed_vaccine_barrier_appointment_location_tried", "weight_unif", "v_vaccine_barrier_appointment_location_tried", 6, compute_binary_response, jeffreys_binary,
288+
"smoothed_wvaccine_barrier_appointment_location_tried", "weight", "v_vaccine_barrier_appointment_location_tried", 6, compute_binary_response, jeffreys_binary,
289+
"smoothed_vaccine_barrier_other_tried", "weight_unif", "v_vaccine_barrier_other_tried", 6, compute_binary_response, jeffreys_binary,
290+
"smoothed_wvaccine_barrier_other_tried", "weight", "v_vaccine_barrier_other_tried", 6, compute_binary_response, jeffreys_binary,
291+
274292

275293
# reasons for belief that vaccine is unnecessary
276294
"smoothed_dontneed_reason_had_covid", "weight_unif", "v_dontneed_reason_had_covid", 6, compute_binary_response, jeffreys_binary,
@@ -294,6 +312,11 @@ get_binary_indicators <- function() {
294312
"smoothed_inperson_school_parttime", "weight_unif", "s_inperson_school_parttime", 6, compute_binary_response, jeffreys_binary,
295313
"smoothed_winperson_school_parttime", "weight", "s_inperson_school_parttime", 6, compute_binary_response, jeffreys_binary,
296314

315+
"smoothed_inperson_school_fulltime_oldest", "weight_unif", "s_inperson_school_fulltime_oldest", 6, compute_binary_response, jeffreys_binary,
316+
"smoothed_winperson_school_fulltime_oldest", "weight", "s_inperson_school_fulltime_oldest", 6, compute_binary_response, jeffreys_binary,
317+
"smoothed_inperson_school_parttime_oldest", "weight_unif", "s_inperson_school_parttime_oldest", 6, compute_binary_response, jeffreys_binary,
318+
"smoothed_winperson_school_parttime_oldest", "weight", "s_inperson_school_parttime_oldest", 6, compute_binary_response, jeffreys_binary,
319+
297320
# beliefs
298321
"smoothed_belief_masking_effective", "weight_unif", "b_belief_masking_effective", 6, compute_binary_response, jeffreys_binary,
299322
"smoothed_wbelief_masking_effective", "weight", "b_belief_masking_effective", 6, compute_binary_response, jeffreys_binary,

facebook/delphiFacebook/R/contingency_indicators.R

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ get_aggs <- function() {
135135
"pct_covid_vaccinated_friends", "v_covid_vaccinated_friends", compute_binary, jeffreys_binary,
136136

137137
"pct_vaccinate_children", "v_vaccinate_children", compute_binary, jeffreys_binary,
138+
"pct_vaccinate_child_oldest", "v_vaccinate_child_oldest", compute_binary, jeffreys_binary,
138139

139140
"pct_accept_vaccine_defyes", "v_accept_vaccine_defyes", compute_binary, jeffreys_multinomial_factory(4),
140141
"pct_accept_vaccine_probyes", "v_accept_vaccine_probyes", compute_binary, jeffreys_multinomial_factory(4),
@@ -203,6 +204,7 @@ get_aggs <- function() {
203204
"pct_hesitant_barrier_health_condition", "v_hesitant_barrier_health_condition", compute_binary, jeffreys_binary,
204205
"pct_hesitant_barrier_pregnant", "v_hesitant_barrier_pregnant", compute_binary, jeffreys_binary,
205206
"pct_hesitant_barrier_other", "v_hesitant_barrier_other", compute_binary, jeffreys_binary,
207+
"pct_hesitant_barrier_dislike_vaccines_generally", "v_hesitant_barrier_dislike_vaccines_generally", compute_binary, jeffreys_binary,
206208

207209
"pct_hesitant_dontneed_reason_had_covid", "v_hesitant_dontneed_reason_had_covid", compute_binary, jeffreys_binary,
208210
"pct_hesitant_dontneed_reason_dont_spend_time", "v_hesitant_dontneed_reason_dont_spend_time", compute_binary, jeffreys_binary,
@@ -227,6 +229,7 @@ get_aggs <- function() {
227229
"pct_barrier_health_condition", "v_hesitancy_reason_health_condition", compute_binary, jeffreys_binary,
228230
"pct_barrier_pregnant", "v_hesitancy_reason_pregnant", compute_binary, jeffreys_binary,
229231
"pct_barrier_other", "v_hesitancy_reason_other", compute_binary, jeffreys_binary,
232+
"pct_barrier_dislike_vaccines_generally", "v_hesitancy_reason_dislike_vaccines_generally", compute_binary, jeffreys_binary,
230233

231234
# vaccine "don't need" reasons
232235
"pct_dontneed_reason_had_covid", "v_dontneed_reason_had_covid_5abc_6", compute_binary, jeffreys_binary,
@@ -252,6 +255,7 @@ get_aggs <- function() {
252255
"pct_defno_barrier_health_condition", "v_defno_barrier_health_condition", compute_binary, jeffreys_binary,
253256
"pct_defno_barrier_pregnant", "v_defno_barrier_pregnant", compute_binary, jeffreys_binary,
254257
"pct_defno_barrier_other", "v_defno_barrier_other", compute_binary, jeffreys_binary,
258+
"pct_defno_barrier_dislike_vaccines_generally", "v_defno_barrier_dislike_vaccines_generally", compute_binary, jeffreys_binary,
255259

256260
"pct_defno_dontneed_reason_had_covid", "v_defno_dontneed_reason_had_covid", compute_binary, jeffreys_binary,
257261
"pct_defno_dontneed_reason_dont_spend_time", "v_defno_dontneed_reason_dont_spend_time", compute_binary, jeffreys_binary,
@@ -284,6 +288,8 @@ get_aggs <- function() {
284288
"pct_vaccine_barrier_time", "v_vaccine_barrier_time", compute_binary, jeffreys_binary,
285289
"pct_vaccine_barrier_type", "v_vaccine_barrier_type", compute_binary, jeffreys_binary,
286290
"pct_vaccine_barrier_none", "v_vaccine_barrier_none", compute_binary, jeffreys_binary,
291+
"pct_vaccine_barrier_appointment_location", "v_vaccine_barrier_appointment_location", compute_binary, jeffreys_binary,
292+
"pct_vaccine_barrier_other", "v_vaccine_barrier_other", compute_binary, jeffreys_binary,
287293

288294
# beliefs
289295
"pct_belief_masking_effective", "b_belief_masking_effective", compute_binary, jeffreys_binary,
@@ -397,6 +403,8 @@ get_aggs <- function() {
397403
"pct_vaccine_barrier_time_has", "v_vaccine_barrier_time_has", compute_binary, jeffreys_binary,
398404
"pct_vaccine_barrier_type_has", "v_vaccine_barrier_type_has", compute_binary, jeffreys_binary,
399405
"pct_vaccine_barrier_none_has", "v_vaccine_barrier_none_has", compute_binary, jeffreys_binary,
406+
"pct_vaccine_barrier_appointment_location_has", "v_vaccine_barrier_appointment_location_has", compute_binary, jeffreys_binary,
407+
"pct_vaccine_barrier_other_has", "v_vaccine_barrier_other_has", compute_binary, jeffreys_binary,
400408

401409
# vaccine barriers for tried vaccinated
402410
"pct_vaccine_barrier_eligible_tried", "v_vaccine_barrier_eligible_tried", compute_binary, jeffreys_binary,
@@ -410,7 +418,9 @@ get_aggs <- function() {
410418
"pct_vaccine_barrier_childcare_tried", "v_vaccine_barrier_childcare_tried", compute_binary, jeffreys_binary,
411419
"pct_vaccine_barrier_time_tried", "v_vaccine_barrier_time_tried", compute_binary, jeffreys_binary,
412420
"pct_vaccine_barrier_type_tried", "v_vaccine_barrier_type_tried", compute_binary, jeffreys_binary,
413-
"pct_vaccine_barrier_none_tried", "v_vaccine_barrier_none_tried", compute_binary, jeffreys_binary
421+
"pct_vaccine_barrier_none_tried", "v_vaccine_barrier_none_tried", compute_binary, jeffreys_binary,
422+
"pct_vaccine_barrier_appointment_location_tried", "v_vaccine_barrier_appointment_location_tried", compute_binary, jeffreys_binary,
423+
"pct_vaccine_barrier_other_tried", "v_vaccine_barrier_other_tried", compute_binary, jeffreys_binary
414424
)
415425

416426
aggs <- create_aggs_product(regions, groups, indicators)

facebook/delphiFacebook/R/contingency_variables.R

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -503,16 +503,27 @@ code_vaccine_barriers <- function(input_data, wave) {
503503
input_data$v_hesitant_barrier_other <- is_selected(hesitancy_reasons, "13")
504504
input_data$v_hesitant_barrier_pregnant <- is_selected(hesitancy_reasons, "14")
505505
input_data$v_hesitant_barrier_religious <- is_selected(hesitancy_reasons, "15")
506+
input_data$v_hesitant_barrier_dislike_vaccines_generally <- is_selected(hesitancy_reasons, "16") # replacing choice 5 as of Wave 12
506507

507-
# These response choices were removed starting in Wave 11. They are explicitly set to missing
508-
# for waves 11 and later since `is_selected` will return FALSE (meaning "not selected") for
509-
# them if the respondent selected at least once answer choice.
510-
input_data$v_hesitant_barrier_allergic[input_data$wave >= 11] <- NA
511-
input_data$v_hesitant_barrier_not_recommended[input_data$wave >= 11] <- NA
512-
input_data$v_hesitant_barrier_distrust_vaccines[input_data$wave >= 11] <- NA
513-
input_data$v_hesitant_barrier_health_condition[input_data$wave >= 11] <- NA
514-
input_data$v_hesitant_barrier_pregnant[input_data$wave >= 11] <- NA
515-
508+
# For waves before a given response choice existed, explicitly set the
509+
# derived field to missing since `is_selected` will return FALSE (meaning
510+
# "not selected") for them if the respondent selected at least once answer
511+
# choice.
512+
if (wave >= 11) {
513+
input_data$v_hesitant_barrier_allergic <- NA
514+
input_data$v_hesitant_barrier_not_recommended <- NA
515+
input_data$v_hesitant_barrier_health_condition <- NA
516+
input_data$v_hesitant_barrier_pregnant <- NA
517+
}
518+
if (wave == 11) {
519+
input_data$v_hesitant_barrier_distrust_vaccines <- NA
520+
}
521+
if (wave < 12) {
522+
input_data$v_hesitant_barrier_dislike_vaccines_generally <- NA
523+
}
524+
if (wave >= 12) {
525+
input_data$v_hesitant_barrier_dislike_vaccines <- NA
526+
}
516527
} else {
517528
input_data$v_hesitant_barrier_sideeffects <- NA
518529
input_data$v_hesitant_barrier_allergic <- NA
@@ -529,6 +540,7 @@ code_vaccine_barriers <- function(input_data, wave) {
529540
input_data$v_hesitant_barrier_other <- NA
530541
input_data$v_hesitant_barrier_pregnant <- NA
531542
input_data$v_hesitant_barrier_religious <- NA
543+
input_data$v_hesitant_barrier_dislike_vaccines_generally <- NA
532544
}
533545

534546
# defno_barrier_<reason>
@@ -554,16 +566,27 @@ code_vaccine_barriers <- function(input_data, wave) {
554566
input_data$v_defno_barrier_other <- is_selected(defno_reasons, "13")
555567
input_data$v_defno_barrier_pregnant <- is_selected(defno_reasons, "14")
556568
input_data$v_defno_barrier_religious <- is_selected(defno_reasons, "15")
557-
558-
# These response choices were removed starting in Wave 11. They are explicitly set to missing
559-
# for waves 11 and later since `is_selected` will return FALSE (meaning "not selected") for
560-
# them if the respondent selected at least once answer choice.
561-
input_data$v_defno_barrier_allergic[input_data$wave >= 11] <- NA
562-
input_data$v_defno_barrier_not_recommended[input_data$wave >= 11] <- NA
563-
input_data$v_defno_barrier_distrust_vaccines[input_data$wave >= 11] <- NA
564-
input_data$v_defno_barrier_health_condition[input_data$wave >= 11] <- NA
565-
input_data$v_defno_barrier_pregnant[input_data$wave >= 11] <- NA
566-
569+
input_data$v_defno_barrier_dislike_vaccines_generally <- is_selected(defno_reasons, "16") # replacing choice 5 as of Wave 12
570+
571+
# For waves before a given response choice existed, explicitly set the
572+
# derived field to missing since `is_selected` will return FALSE (meaning
573+
# "not selected") for them if the respondent selected at least once answer
574+
# choice.
575+
if (wave >= 11) {
576+
input_data$v_defno_barrier_allergic <- NA
577+
input_data$v_defno_barrier_not_recommended <- NA
578+
input_data$v_defno_barrier_health_condition <- NA
579+
input_data$v_defno_barrier_pregnant <- NA
580+
}
581+
if (wave == 11) {
582+
input_data$v_defno_barrier_distrust_vaccines <- NA
583+
}
584+
if (wave < 12) {
585+
input_data$v_defno_barrier_dislike_vaccines_generally <- NA
586+
}
587+
if (wave >= 12) {
588+
input_data$v_defno_barrier_dislike_vaccines <- NA
589+
}
567590
} else {
568591
input_data$v_defno_barrier_sideeffects <- NA
569592
input_data$v_defno_barrier_allergic <- NA
@@ -580,6 +603,7 @@ code_vaccine_barriers <- function(input_data, wave) {
580603
input_data$v_defno_barrier_other <- NA
581604
input_data$v_defno_barrier_pregnant <- NA
582605
input_data$v_defno_barrier_religious <- NA
606+
input_data$v_defno_barrier_dislike_vaccines_generally <- NA
583607
}
584608

585609
# dontneed_reason_<reason>

facebook/delphiFacebook/R/responses.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ surveyID_to_wave <- Vectorize(function(surveyID) {
694694
"SV_6PADB8DyF9SIyXk" = 10,
695695
"SV_4VEaeffqQtDo33M" = 11,
696696
"SV_3TL0r243mLkDzCK" = 12.5, # experimental version of Wave 12
697-
"TBD finalized version" = 12 # finalized version of Wave 12
697+
"SV_eDISRi5wQcNU70G" = 12 # finalized version of Wave 12
698698
)
699699

700700
if ( any(names(waves) == surveyID) ) {

0 commit comments

Comments
 (0)