diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 5d6dee4a0..435cc2c7f 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.3.8 +current_version = 0.3.9 commit = True message = chore: bump covidcast-indicators to {new_version} tag = False diff --git a/ansible/templates/sir_complainsalot-params-prod.json.j2 b/ansible/templates/sir_complainsalot-params-prod.json.j2 index bddc8d874..326f703c4 100644 --- a/ansible/templates/sir_complainsalot-params-prod.json.j2 +++ b/ansible/templates/sir_complainsalot-params-prod.json.j2 @@ -79,27 +79,27 @@ "smoothed_inperson_school_fulltime", "smoothed_winperson_school_fulltime", "smoothed_inperson_school_parttime", "smoothed_winperson_school_parttime", "smoothed_vaccinate_children", "smoothed_wvaccinate_children", - ["smoothed_vaccine_barrier_appointment_time_tried", "msa"], ["smoothed_wvaccine_barrier_appointment_time_tried", "msa"], - ["smoothed_vaccine_barrier_childcare_tried", "msa"], ["smoothed_wvaccine_barrier_childcare_tried", "msa"], - ["smoothed_vaccine_barrier_document_tried", "msa"], ["smoothed_wvaccine_barrier_document_tried", "msa"], - ["smoothed_vaccine_barrier_eligible_tried", "msa"], ["smoothed_wvaccine_barrier_eligible_tried", "msa"], - ["smoothed_vaccine_barrier_language_tried", "msa"], ["smoothed_wvaccine_barrier_language_tried", "msa"], - ["smoothed_vaccine_barrier_no_appointments_tried", "msa"], ["smoothed_wvaccine_barrier_no_appointments_tried", "msa"], - ["smoothed_vaccine_barrier_none_tried", "msa"], ["smoothed_wvaccine_barrier_none_tried", "msa"], - ["smoothed_vaccine_barrier_technical_difficulties_tried", "msa"], ["smoothed_wvaccine_barrier_technical_difficulties_tried", "msa"], - ["smoothed_vaccine_barrier_technology_access_tried", "msa"], ["smoothed_wvaccine_barrier_technology_access_tried", "msa"], - ["smoothed_vaccine_barrier_time_tried", "msa"], ["smoothed_wvaccine_barrier_time_tried", "msa"], - ["smoothed_vaccine_barrier_travel_tried", "msa"], ["smoothed_wvaccine_barrier_travel_tried", "msa"], - ["smoothed_vaccine_barrier_type_tried", "msa"], ["smoothed_wvaccine_barrier_type_tried", "msa"], + ["smoothed_vaccine_barrier_appointment_time_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_appointment_time_tried", "msa", "county", "state"], + ["smoothed_vaccine_barrier_childcare_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_childcare_tried", "msa", "county", "state"], + ["smoothed_vaccine_barrier_document_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_document_tried", "msa", "county", "state"], + ["smoothed_vaccine_barrier_eligible_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_eligible_tried", "msa", "county", "state"], + ["smoothed_vaccine_barrier_language_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_language_tried", "msa", "county", "state"], + ["smoothed_vaccine_barrier_no_appointments_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_no_appointments_tried", "msa", "county", "state"], + ["smoothed_vaccine_barrier_none_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_none_tried", "msa", "county", "state"], + ["smoothed_vaccine_barrier_technical_difficulties_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_technical_difficulties_tried", "msa", "county", "state"], + ["smoothed_vaccine_barrier_technology_access_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_technology_access_tried", "msa", "county", "state"], + ["smoothed_vaccine_barrier_time_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_time_tried", "msa", "county", "state"], + ["smoothed_vaccine_barrier_travel_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_travel_tried", "msa", "county", "state"], + ["smoothed_vaccine_barrier_type_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_type_tried", "msa", "county", "state"], ["smoothed_try_vaccinate_1m", "hrr"], ["smoothed_wtry_vaccinate_1m", "hrr"], ["smoothed_try_vaccinate_1m", "msa"], ["smoothed_wtry_vaccinate_1m", "msa"], - ["smoothed_dontneed_reason_dont_spend_time", "hrr"], ["smoothed_wdontneed_reason_dont_spend_time", "hrr"], - ["smoothed_dontneed_reason_had_covid", "hrr"], ["smoothed_wdontneed_reason_had_covid", "hrr"], - ["smoothed_dontneed_reason_not_beneficial", "hrr"], ["smoothed_wdontneed_reason_not_beneficial", "hrr"], - ["smoothed_dontneed_reason_not_high_risk", "hrr"], ["smoothed_wdontneed_reason_not_high_risk", "hrr"], - ["smoothed_dontneed_reason_not_serious", "hrr"], ["smoothed_wdontneed_reason_not_serious", "hrr"], - ["smoothed_dontneed_reason_other", "hrr"], ["smoothed_wdontneed_reason_other", "hrr"], - ["smoothed_dontneed_reason_precautions", "hrr"], ["smoothed_wdontneed_reason_precautions", "hrr"], + ["smoothed_dontneed_reason_dont_spend_time", "hrr"], ["smoothed_wdontneed_reason_dont_spend_time", "hrr", "msa"], + ["smoothed_dontneed_reason_had_covid", "hrr"], ["smoothed_wdontneed_reason_had_covid", "hrr", "msa"], + ["smoothed_dontneed_reason_not_beneficial", "hrr"], ["smoothed_wdontneed_reason_not_beneficial", "hrr", "msa"], + ["smoothed_dontneed_reason_not_high_risk", "hrr"], ["smoothed_wdontneed_reason_not_high_risk", "hrr", "msa"], + ["smoothed_dontneed_reason_not_serious", "hrr"], ["smoothed_wdontneed_reason_not_serious", "hrr", "msa"], + ["smoothed_dontneed_reason_other", "hrr"], ["smoothed_wdontneed_reason_other", "hrr", "msa"], + ["smoothed_dontneed_reason_precautions", "hrr"], ["smoothed_wdontneed_reason_precautions", "hrr", "msa"], "smoothed_screening_tested_positive_14d", "smoothed_wscreening_tested_positive_14d", "smoothed_travel_outside_state_7d", "smoothed_wtravel_outside_state_7d", "smoothed_belief_vaccinated_mask_unnecessary", "smoothed_wbelief_vaccinated_mask_unnecessary", diff --git a/facebook/delphiFacebook/R/binary.R b/facebook/delphiFacebook/R/binary.R index fddc68537..0a2470098 100644 --- a/facebook/delphiFacebook/R/binary.R +++ b/facebook/delphiFacebook/R/binary.R @@ -131,7 +131,13 @@ get_binary_indicators <- function() { "smoothed_wvaccinate_children", "weight", "v_vaccinate_children", 6, compute_binary_response, jeffreys_binary, "smoothed_vaccinate_child_oldest", "weight_unif", "v_vaccinate_child_oldest", 6, compute_binary_response, jeffreys_binary, "smoothed_wvaccinate_child_oldest", "weight", "v_vaccinate_child_oldest", 6, compute_binary_response, jeffreys_binary, - + + "smoothed_wchild_vaccine_already", "weight", "v_child_vaccine_already", 6, compute_binary_response, jeffreys_multinomial_factory(5), + "smoothed_wchild_vaccine_yes_def", "weight", "v_child_vaccine_yes_def", 6, compute_binary_response, jeffreys_multinomial_factory(5), + "smoothed_wchild_vaccine_yes_prob", "weight", "v_child_vaccine_yes_prob", 6, compute_binary_response, jeffreys_multinomial_factory(5), + "smoothed_wchild_vaccine_no_prob", "weight", "v_child_vaccine_no_prob", 6, compute_binary_response, jeffreys_multinomial_factory(5), + "smoothed_wchild_vaccine_no_def", "weight", "v_child_vaccine_no_def", 6, compute_binary_response, jeffreys_multinomial_factory(5), + "smoothed_try_vaccinate_1m", "weight_unif", "v_try_vaccinate_1m", 6, compute_binary_response, jeffreys_binary, "smoothed_wtry_vaccinate_1m", "weight", "v_try_vaccinate_1m", 6, compute_binary_response, jeffreys_binary, @@ -332,11 +338,26 @@ get_binary_indicators <- function() { "smoothed_inperson_school_parttime", "weight_unif", "s_inperson_school_parttime", 6, compute_binary_response, jeffreys_binary, "smoothed_winperson_school_parttime", "weight", "s_inperson_school_parttime", 6, compute_binary_response, jeffreys_binary, - "smoothed_inperson_school_fulltime_oldest", "weight_unif", "s_inperson_school_fulltime_oldest", 6, compute_binary_response, jeffreys_binary, - "smoothed_winperson_school_fulltime_oldest", "weight", "s_inperson_school_fulltime_oldest", 6, compute_binary_response, jeffreys_binary, - "smoothed_inperson_school_parttime_oldest", "weight_unif", "s_inperson_school_parttime_oldest", 6, compute_binary_response, jeffreys_binary, - "smoothed_winperson_school_parttime_oldest", "weight", "s_inperson_school_parttime_oldest", 6, compute_binary_response, jeffreys_binary, - + "smoothed_inperson_school_fulltime_oldest", "weight_unif", "s_inperson_school_fulltime_oldest", 6, compute_binary_response, jeffreys_multinomial_factory(3), + "smoothed_winperson_school_fulltime_oldest", "weight", "s_inperson_school_fulltime_oldest", 6, compute_binary_response, jeffreys_multinomial_factory(3), + "smoothed_inperson_school_parttime_oldest", "weight_unif", "s_inperson_school_parttime_oldest", 6, compute_binary_response, jeffreys_multinomial_factory(3), + "smoothed_winperson_school_parttime_oldest", "weight", "s_inperson_school_parttime_oldest", 6, compute_binary_response, jeffreys_multinomial_factory(3), + "smoothed_wremote_school_fulltime_oldest", "weight", "s_remote_school_fulltime_oldest", 6, compute_binary_response, jeffreys_multinomial_factory(3), + + "smoothed_wschool_safety_measures_mask_students", "weight", "s_school_safety_measures_mask_students", 6, compute_binary_response, jeffreys_binary, + "smoothed_wschool_safety_measures_mask_teachers", "weight", "s_school_safety_measures_mask_teachers", 6, compute_binary_response, jeffreys_binary, + "smoothed_wschool_safety_measures_restricted_entry", "weight", "s_school_safety_measures_restricted_entry", 6, compute_binary_response, jeffreys_binary, + "smoothed_wschool_safety_measures_separators", "weight", "s_school_safety_measures_separators", 6, compute_binary_response, jeffreys_binary, + "smoothed_wschool_safety_measures_extracurricular", "weight", "s_school_safety_measures_extracurricular", 6, compute_binary_response, jeffreys_binary, + "smoothed_wschool_safety_measures_symptom_screen", "weight", "s_school_safety_measures_symptom_screen", 6, compute_binary_response, jeffreys_binary, + "smoothed_wschool_safety_measures_ventilation", "weight", "s_school_safety_measures_ventilation", 6, compute_binary_response, jeffreys_binary, + "smoothed_wschool_safety_measures_testing_staff", "weight", "s_school_safety_measures_testing_staff", 6, compute_binary_response, jeffreys_binary, + "smoothed_wschool_safety_measures_testing_students", "weight", "s_school_safety_measures_testing_students", 6, compute_binary_response, jeffreys_binary, + "smoothed_wschool_safety_measures_vaccine_staff", "weight", "s_school_safety_measures_vaccine_staff", 6, compute_binary_response, jeffreys_binary, + "smoothed_wschool_safety_measures_vaccine_students", "weight", "s_school_safety_measures_vaccine_students", 6, compute_binary_response, jeffreys_binary, + "smoothed_wschool_safety_measures_cafeteria", "weight", "s_school_safety_measures_cafeteria", 6, compute_binary_response, jeffreys_binary, + "smoothed_wschool_safety_measures_dont_know", "weight", "s_school_safety_measures_dont_know", 6, compute_binary_response, jeffreys_binary, + # beliefs "smoothed_belief_masking_effective", "weight_unif", "b_belief_masking_effective", 6, compute_binary_response, jeffreys_binary, "smoothed_wbelief_masking_effective", "weight", "b_belief_masking_effective", 6, compute_binary_response, jeffreys_binary, @@ -396,9 +417,7 @@ get_binary_indicators <- function() { "smoothed_want_info_employment", "weight_unif", "i_want_info_employment", 6, compute_binary_response, jeffreys_binary, "smoothed_wwant_info_employment", "weight", "i_want_info_employment", 6, compute_binary_response, jeffreys_binary, "smoothed_want_info_none", "weight_unif", "i_want_info_none", 6, compute_binary_response, jeffreys_binary, - "smoothed_wwant_info_none", "weight", "i_want_info_none", 6, compute_binary_response, jeffreys_binary, - - + "smoothed_wwant_info_none", "weight", "i_want_info_none", 6, compute_binary_response, jeffreys_binary ) diff --git a/facebook/delphiFacebook/R/contingency_indicators.R b/facebook/delphiFacebook/R/contingency_indicators.R index 205b06588..ffaa54f76 100644 --- a/facebook/delphiFacebook/R/contingency_indicators.R +++ b/facebook/delphiFacebook/R/contingency_indicators.R @@ -141,6 +141,12 @@ get_aggs <- function() { "pct_vaccinate_children", "v_vaccinate_children", compute_binary, jeffreys_binary, "pct_vaccinate_child_oldest", "v_vaccinate_child_oldest", compute_binary, jeffreys_binary, + "pct_child_vaccine_already", "v_child_vaccine_already", compute_binary, jeffreys_multinomial_factory(5), + "pct_child_vaccine_yes_def", "v_child_vaccine_yes_def", compute_binary, jeffreys_multinomial_factory(5), + "pct_child_vaccine_yes_prob", "v_child_vaccine_yes_prob", compute_binary, jeffreys_multinomial_factory(5), + "pct_child_vaccine_no_prob", "v_child_vaccine_no_prob", compute_binary, jeffreys_multinomial_factory(5), + "pct_child_vaccine_no_def", "v_child_vaccine_no_def", compute_binary, jeffreys_multinomial_factory(5), + "pct_accept_vaccine_defyes", "v_accept_vaccine_defyes", compute_binary, jeffreys_multinomial_factory(4), "pct_accept_vaccine_probyes", "v_accept_vaccine_probyes", compute_binary, jeffreys_multinomial_factory(4), "pct_accept_vaccine_probno", "v_accept_vaccine_probno", compute_binary, jeffreys_multinomial_factory(4), @@ -448,11 +454,39 @@ get_aggs <- function() { # schooling "pct_inperson_school_fulltime", "s_inperson_school_fulltime", compute_binary, jeffreys_binary, - "pct_inperson_school_parttime", "s_inperson_school_parttime", compute_binary, jeffreys_binary + "pct_inperson_school_parttime", "s_inperson_school_parttime", compute_binary, jeffreys_binary, + + "pct_remote_school_fulltime_oldest", "s_remote_school_fulltime_oldest", compute_binary, jeffreys_multinomial_factory(3), + "pct_inperson_school_fulltime_oldest", "s_inperson_school_fulltime_oldest", compute_binary, jeffreys_multinomial_factory(3), + "pct_inperson_school_parttime_oldest", "s_inperson_school_parttime_oldest", compute_binary, jeffreys_multinomial_factory(3), + + "pct_school_safety_measures_mask_students", "s_school_safety_measures_mask_students", compute_binary, jeffreys_binary, + "pct_school_safety_measures_mask_teachers", "s_school_safety_measures_mask_teachers", compute_binary, jeffreys_binary, + "pct_school_safety_measures_restricted_entry", "s_school_safety_measures_restricted_entry", compute_binary, jeffreys_binary, + "pct_school_safety_measures_separators", "s_school_safety_measures_separators", compute_binary, jeffreys_binary, + "pct_school_safety_measures_extracurricular", "s_school_safety_measures_extracurricular", compute_binary, jeffreys_binary, + "pct_school_safety_measures_symptom_screen", "s_school_safety_measures_symptom_screen", compute_binary, jeffreys_binary, + "pct_school_safety_measures_ventilation", "s_school_safety_measures_ventilation", compute_binary, jeffreys_binary, + "pct_school_safety_measures_testing_staff", "s_school_safety_measures_testing_staff", compute_binary, jeffreys_binary, + "pct_school_safety_measures_testing_students", "s_school_safety_measures_testing_students", compute_binary, jeffreys_binary, + "pct_school_safety_measures_vaccine_staff", "s_school_safety_measures_vaccine_staff", compute_binary, jeffreys_binary, + "pct_school_safety_measures_vaccine_students", "s_school_safety_measures_vaccine_students", compute_binary, jeffreys_binary, + "pct_school_safety_measures_cafeteria", "s_school_safety_measures_cafeteria", compute_binary, jeffreys_binary, + "pct_school_safety_measures_dont_know", "s_school_safety_measures_dont_know", compute_binary, jeffreys_binary ) aggs <- create_aggs_product(regions, groups, indicators) - + + + monthly_indicators <- tribble( + ~name, ~metric, ~compute_fn, ~post_fn, + "pct_child_school_public", "s_child_school_public", compute_binary, jeffreys_multinomial_factory(5), + "pct_child_school_private", "s_child_school_private", compute_binary, jeffreys_multinomial_factory(5), + "pct_child_school_homeschool", "s_child_school_homeschool", compute_binary, jeffreys_multinomial_factory(5), + "pct_child_school_not", "s_child_school_not", compute_binary, jeffreys_multinomial_factory(5), + "pct_child_school_other", "s_child_school_other", compute_binary, jeffreys_multinomial_factory(5) + ) + monthly_aggs <- create_aggs_product(regions, groups, monthly_indicators) ### Include handful of original public tables not already covered by set above common_group <- c("agefull", "gender", "race", "hispanic") @@ -509,7 +543,7 @@ get_aggs <- function() { aggs <- rbind(aggs, cut1_aggs, cut2_aggs, cut3_aggs, cut456_aggs, cut456_marginal_aggs) weekly_aggs <- aggs - monthly_aggs <- aggs + monthly_aggs <- rbind(aggs, monthly_aggs) return(list("week"=weekly_aggs, "month"=monthly_aggs)) } diff --git a/facebook/delphiFacebook/R/responses.R b/facebook/delphiFacebook/R/responses.R index d5bee7ae4..149aee432 100644 --- a/facebook/delphiFacebook/R/responses.R +++ b/facebook/delphiFacebook/R/responses.R @@ -193,6 +193,7 @@ load_response_one <- function(input_filename, params, contingency_run) { input_data <- code_activities(input_data, wave) input_data <- code_vaccines(input_data, wave) input_data <- code_schooling(input_data, wave) + input_data <- code_children(input_data, wave) input_data <- code_beliefs(input_data, wave) input_data <- code_news_and_info(input_data, wave) input_data <- code_gender(input_data, wave) diff --git a/facebook/delphiFacebook/R/variables.R b/facebook/delphiFacebook/R/variables.R index bfef39030..137d62d76 100644 --- a/facebook/delphiFacebook/R/variables.R +++ b/facebook/delphiFacebook/R/variables.R @@ -833,8 +833,20 @@ code_vaccines <- function(input_data, wave) { input_data$P3 == 5 ~ 1, TRUE ~ NA_real_ ) + + input_data$v_child_vaccine_already <- input_data$P3 == 5 + input_data$v_child_vaccine_yes_def <- input_data$P3 == 1 + input_data$v_child_vaccine_yes_prob <- input_data$P3 == 2 + input_data$v_child_vaccine_no_prob <- input_data$P3 == 3 + input_data$v_child_vaccine_no_def <- input_data$P3 == 4 + } else { input_data$v_vaccinate_child_oldest <- NA_real_ + input_data$v_child_vaccine_already <- NA + input_data$v_child_vaccine_yes_def <- NA + input_data$v_child_vaccine_yes_prob <- NA + input_data$v_child_vaccine_no_prob <- NA + input_data$v_child_vaccine_no_def <- NA } if ( "V16" %in% names(input_data) ) { @@ -906,6 +918,34 @@ code_vaccines <- function(input_data, wave) { return(input_data) } +#' Misc children +#' +#' @param input_data input data frame of raw survey data +#' @param wave integer indicating survey version +#' +#' @return augmented data frame +code_children <- function(input_data, wave) { + if ("P2" %in% names(input_data)) { + input_data$ch_has_child_under_18 <- input_data$P1 == 1 + } else { + input_data$ch_has_child_under_18 <- NA + } + + if ("P2" %in% names(input_data)) { + input_data$ch_oldest_child_under_5 <- input_data$P2 == 1 + input_data$ch_oldest_child_5_to_11 <- input_data$P2 == 2 + input_data$ch_oldest_child_12_to_15 <- input_data$P2 == 3 + input_data$ch_oldest_child_16_to_17 <- input_data$P2 == 4 + } else { + input_data$ch_oldest_child_under_5 <- NA + input_data$ch_oldest_child_5_to_11 <- NA + input_data$ch_oldest_child_12_to_15 <- NA + input_data$ch_oldest_child_16_to_17 <- NA + } + + return(input_data) +} + #' Schooling #' #' @param input_data input data frame of raw survey data @@ -948,11 +988,65 @@ code_schooling <- function(input_data, wave) { input_data$P5 != 3 ~ 0, TRUE ~ NA_real_ ) + input_data$s_remote_school_fulltime_oldest <- case_when( + input_data$P5 == 2 ~ 1, + input_data$P5 != 2 ~ 0, + TRUE ~ NA_real_ + ) } else { input_data$s_inperson_school_fulltime_oldest <- NA_real_ input_data$s_inperson_school_parttime_oldest <- NA_real_ + input_data$s_remote_school_fulltime_oldest <- NA_real_ + } + + if ("P4" %in% names(input_data)) { + input_data$s_child_school_public <- input_data$P4 == 1 + input_data$s_child_school_private <- input_data$P4 == 2 + input_data$s_child_school_homeschool <- input_data$P4 == 3 + input_data$s_child_school_not <- input_data$P4 == 4 + input_data$s_child_school_other <- input_data$P4 == 5 + } else { + input_data$s_child_school_public <- NA + input_data$s_child_school_private <- NA + input_data$s_child_school_homeschool <- NA + input_data$s_child_school_not <- NA + input_data$s_child_school_other <- NA } + + + if ("P6" %in% names(input_data)) { + safety_measures <- split_options(input_data$P6) + + input_data$s_school_safety_measures_mask_students <- is_selected(safety_measures, "1") + input_data$s_school_safety_measures_mask_teachers <- is_selected(safety_measures, "2") + input_data$s_school_safety_measures_restricted_entry <- is_selected(safety_measures, "6") + input_data$s_school_safety_measures_separators <- is_selected(safety_measures, "10") + input_data$s_school_safety_measures_extracurricular <- is_selected(safety_measures, "12") + input_data$s_school_safety_measures_symptom_screen <- is_selected(safety_measures, "15") + input_data$s_school_safety_measures_ventilation <- is_selected(safety_measures, "17") + input_data$s_school_safety_measures_testing_staff <- is_selected(safety_measures, "18") + input_data$s_school_safety_measures_testing_students <- is_selected(safety_measures, "19") + input_data$s_school_safety_measures_vaccine_staff <- is_selected(safety_measures, "20") + input_data$s_school_safety_measures_vaccine_students <- is_selected(safety_measures, "21") + input_data$s_school_safety_measures_cafeteria <- is_selected(safety_measures, "22") + input_data$s_school_safety_measures_dont_know <- is_selected(safety_measures, "16") + } else { + input_data$s_school_safety_measures_mask_students <- NA + input_data$s_school_safety_measures_mask_teachers <- NA + input_data$s_school_safety_measures_restricted_entry <- NA + input_data$s_school_safety_measures_separators <- NA + input_data$s_school_safety_measures_extracurricular <- NA + input_data$s_school_safety_measures_symptom_screen <- NA + input_data$s_school_safety_measures_ventilation <- NA + input_data$s_school_safety_measures_testing_staff <- NA + input_data$s_school_safety_measures_testing_students <- NA + input_data$s_school_safety_measures_vaccine_staff <- NA + input_data$s_school_safety_measures_vaccine_students <- NA + input_data$s_school_safety_measures_cafeteria <- NA + input_data$s_school_safety_measures_dont_know <- NA + } + return(input_data) } diff --git a/facebook/delphiFacebook/man/code_children.Rd b/facebook/delphiFacebook/man/code_children.Rd new file mode 100644 index 000000000..60dad399f --- /dev/null +++ b/facebook/delphiFacebook/man/code_children.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/variables.R +\name{code_children} +\alias{code_children} +\title{Misc children} +\usage{ +code_children(input_data, wave) +} +\arguments{ +\item{input_data}{input data frame of raw survey data} + +\item{wave}{integer indicating survey version} +} +\value{ +augmented data frame +} +\description{ +Misc children +} diff --git a/facebook/qsf-tools/generate-codebook.R b/facebook/qsf-tools/generate-codebook.R index 05453cadd..72786e8d4 100644 --- a/facebook/qsf-tools/generate-codebook.R +++ b/facebook/qsf-tools/generate-codebook.R @@ -4,7 +4,7 @@ ## ## Usage: ## -## Rscript generate-codebook.R path/to/qsf path/to/codebook +## Rscript generate-codebook.R [UMD/CMU] path/to/qsf path/to/codebook suppressPackageStartupMessages({ library(tidyverse) @@ -17,81 +17,32 @@ suppressPackageStartupMessages({ process_qsf <- function(path_to_qsf, + survey_version=c("CMU", "UMD"), path_to_shortname_map="./static/item_shortquestion_map.csv", path_to_replacement_map="./static/item_replacement_map.csv") { + survey_version <- match.arg(survey_version) q <- read_json(path_to_qsf) wave <- get_wave(path_to_qsf) - # get the survey elements with flow logic (should be one per block randomization branch) - ii_flow <- q$SurveyElements %>% - map_chr("Element") %>% - {. == "FL"} %>% - which() - ii_block_randomizer <- q$SurveyElements[ii_flow] %>% - map(~ .x$Payload$Flow) %>% - map(~ map(.x,~ .x$Type == "BlockRandomizer")) %>% - unlist() %>% - which() - random_block_ids <- q$SurveyElements[ii_flow] %>% - map(~ .x$Payload$Flow) %>% - map(~ .x[ii_block_randomizer]) %>% - map(~ map(.x,~ .x$Flow)) %>% - map(~ map(.x,~ map(.x,~ .x$ID))) %>% - unlist() - - block_id_item_map <- get_block_item_map(q) - block_id_item_map <- block_id_item_map %>% filter(BlockID %in% random_block_ids) %>% - select(-BlockID) - - # get the survey elements that are questions: - ii_questions <- q$SurveyElements %>% - map_chr("Element") %>% - {. == "SQ"} %>% - which() + displayed_questions <- subset_qsf_to_displayed(q) - # get the questions that were shown to respondents - shown_items <- get_shown_items(q) - ii_shown <- q$SurveyElements[ii_questions] %>% - map_chr(~ .x$Payload$QuestionID) %>% - {. %in% shown_items} %>% - which() - - # subset qsf to valid elements - displayed_questions <- q$SurveyElements[ii_questions][ii_shown] - - # Qualtrics auto-assigned question IDs + # get Qualtrics auto-assigned question IDs qids <- displayed_questions %>% map_chr(~ .x$Payload$QuestionID) - # the items are how we will match these to the survey data: - items <- displayed_questions %>% - map_chr(~ .x$Payload$DataExportTag) + # get item names + item_names <- displayed_questions %>% + map_chr(~ .x$Payload$DataExportTag) %>% + patch_item_names(survey_version, wave) - # B13 was originally named incorrectly. Rename manually as needed - items[items == "B13 "] <- "B13" - # V2a in Wave 13 was originally named incorrectly. Rename manually as needed - if (wave == 13) { - items[items == "V2a"] <- "V2d" - } - - # get the text of the question: + # get question text: questions <- displayed_questions %>% map_chr(~ .x$Payload$QuestionText) - # get the type of question: - type_map <- c(MC = "Multiple choice", TE = "Text", Matrix = "Matrix") - qtype <- displayed_questions %>% - map_chr(~ .x$Payload$QuestionType) %>% - {type_map[.]} - - ii_multiselect <- displayed_questions %>% - map_chr(~ .x$Payload$Selector) %>% - {. == "MAVR"} %>% - which() - qtype[ii_multiselect] <- "Multiselect" - qtype[items == "A5"] <- "Matrix" # this will be treated like C10 - - # get the choices (for MC and Matrix): + # get question types + qtype <- get_question_formats(displayed_questions, item_names, survey_version) + + # get choices for multiple choice (MC) and Matrix items: choices <- displayed_questions %>% map(~ .x$Payload$Choices) %>% map(~ map(.x, "Display")) @@ -122,8 +73,8 @@ process_qsf <- function(path_to_qsf, map(which) %>% map(names) %>% unlist() - other_text_items <- paste(items[ii_other_text_option], text_elem, "TEXT", sep="_") %>% - setNames(items[ii_other_text_option]) + other_text_items <- paste(item_names[ii_other_text_option], text_elem, "TEXT", sep="_") %>% + setNames(item_names[ii_other_text_option]) # some questions port the choices from other questions ii_carryforward <- displayed_questions %>% @@ -189,9 +140,26 @@ process_qsf <- function(path_to_qsf, paste(c(qid, selectable_text, option_code), collapse="") }, .x)) %>% # Replace QID with question number (A2, etc) - map(~ gsubfn("(QID[0-9]+)", function(qid) {items[qids == qid]}, .x)) %>% + map(~ gsubfn("(QID[0-9]+)", function(qid) {item_names[qids == qid]}, .x)) %>% # Collapse logic into a single string. map(~ paste(.x, collapse=" ")) + + # Handle questions that use a fixed condition ("If False", "If True") + ii_boolean_displaylogic <- (displayed_questions %>% + map(~ .x$Payload$DisplayLogic) %>% + map(~ .x$`0`) %>% + map(~ map(.x, "LogicType") %>% unlist()) == "BooleanValue") %>% + which() + + display_logic[ii_boolean_displaylogic] <- displayed_questions[ii_boolean_displaylogic] %>% + map(~ .x$Payload$DisplayLogic) %>% + map(~ .x$`0`) %>% + map(~ paste( + map(.x, "Value") + )) %>% + map(~ gsub(" ?NULL ?", "", .x)) %>% + # Collapse logic into a single string. + map(~ paste(.x, collapse="")) logic_type <- displayed_questions %>% map(~ .x$Payload$DisplayLogic) %>% @@ -203,7 +171,7 @@ process_qsf <- function(path_to_qsf, unlist() # format all qsf content lists into a single tibble - qdf <- tibble(variable = items, + qdf <- tibble(variable = item_names, question = questions, type = qtype, choices = choices, @@ -212,8 +180,9 @@ process_qsf <- function(path_to_qsf, response_option_randomization = response_option_randomization) # Add on module randomization + block_id_item_map <- map_qids_to_module(q) block_id_item_map <- block_id_item_map %>% - left_join(data.frame(qid=qids, item=items), by=c("Questions"="qid")) + left_join(data.frame(qid=qids, item=item_names), by=c("Questions"="qid")) qdf <- qdf %>% left_join(block_id_item_map, by=c(variable="item")) %>% rename(group_of_respondents_item_was_shown_to = BlockName) @@ -272,16 +241,21 @@ process_qsf <- function(path_to_qsf, select(new) %>% unnest(new) - # A5 and C10 are special cases b/c of they are matrix of text entry questions: - # also C10 needs an extra _1. - matrix_items <- matrix_items %>% - mutate(variable = if_else(str_starts(variable, "C10"), paste0(variable, "_1"), variable), - type = if_else(str_starts(variable, "A5|C10"), "Text", type), - choices = if_else(str_starts(variable, "A5|C10"), list(list()), choices)) + # Custom matrix formatting + if (survey_version == "CMU") { + # A5 and C10 are special cases b/c they are matrices of text entry questions: + # also C10 needs an extra _1. + matrix_items <- matrix_items %>% + mutate(variable = if_else(str_starts(variable, "C10"), paste0(variable, "_1"), variable), + type = if_else(str_starts(variable, "A5|C10"), "Text", type), + choices = if_else(str_starts(variable, "A5|C10"), list(list()), choices)) + } else if (survey_version == "UMD") { + # pass + } qdf <- bind_rows(nonmatrix_items, matrix_items) - # indicate which items have replaced old items. + # indicate which new items have replaced old items. replaces_map <- read_csv(path_to_replacement_map, col_types = cols(new_item = col_character(), old_item = col_character() @@ -448,11 +422,12 @@ add_qsf_to_codebook <- function(path_to_qsf, path_to_codebook) { args <- commandArgs(TRUE) -if (length(args) != 2) { - stop("Usage: Rscript generate-codebook.R path/to/qsf path/to/codebook") +if (length(args) != 3) { + stop("Usage: Rscript generate-codebook.R [UMD/CMU] path/to/qsf path/to/codebook") } -path_to_qsf <- args[1] -path_to_codebook <- args[2] +survey_version <- args[1] +path_to_qsf <- args[2] +path_to_codebook <- args[3] invisible(add_qsf_to_codebook(path_to_qsf, path_to_codebook)) diff --git a/facebook/qsf-tools/list-matrix-items.R b/facebook/qsf-tools/list-matrix-items.R new file mode 100644 index 000000000..fbbafd113 --- /dev/null +++ b/facebook/qsf-tools/list-matrix-items.R @@ -0,0 +1,49 @@ +#!/usr/bin/env Rscript + +## Print a list of survey questions that we handle as matrices. +## +## Usage: +## +## Rscript list-matrix-items.R [UMD/CMU] path/to/qsf + +suppressPackageStartupMessages({ + library(jsonlite) + library(tidyverse) + source("qsf-utils.R") +}) + + +print_matrix_items <- function(path_to_qsf, survey_version=c("CMU", "UMD")) { + survey_version <- match.arg(survey_version) + q <- read_json(path_to_qsf) + wave <- get_wave(path_to_qsf) + + displayed_questions <- subset_qsf_to_displayed(q) + + # Get survey item names + item_names <- displayed_questions %>% + map_chr(~ .x$Payload$DataExportTag) %>% + patch_item_names(survey_version, wave) + + # Get survey item formats + qtype <- get_question_formats(displayed_questions, item_names, survey_version) + + qdf <- tibble(variable = item_names, + type = qtype) + + matrix_items <- qdf %>% filter(type == "Matrix") %>% pull(variable) + message("Wave ", wave, " has ", length(matrix_items), " matrix items: ", paste(matrix_items, collapse=", ")) + + return(NULL) +} + +args <- commandArgs(TRUE) + +if (length(args) != 2) { + stop("Usage: Rscript list-matrix-items.R [UMD/CMU] path/to/qsf") +} + +survey_version <- args[1] +path_to_qsf <- args[2] + +invisible(print_matrix_items(path_to_qsf, survey_version)) diff --git a/facebook/qsf-tools/qsf-differ.R b/facebook/qsf-tools/qsf-differ.R index d9a595e1d..934bb9bc3 100644 --- a/facebook/qsf-tools/qsf-differ.R +++ b/facebook/qsf-tools/qsf-differ.R @@ -15,6 +15,7 @@ suppressPackageStartupMessages({ library(jsonlite) library(stringr) library(dplyr) + library(purrr) library(readr) source("qsf-utils.R") }) @@ -57,34 +58,74 @@ get_qsf_file <- function(path, ) { # Read file as json. qsf <- read_json(path) - ## Block shown_items <- get_shown_items(qsf) ## Questions questions <- Filter(function(elem) { elem[["Element"]] == "SQ" }, qsf$SurveyElements) + qids <- questions %>% + map_chr(~ .x$Payload$QuestionID) + qid_item_map <- list() questions_out <- list() - for (question in questions) { - question <- question$Payload + for (question_raw in questions) { + question_raw <- question_raw$Payload # Skip items not shown to respondents. - if ( !(question$QuestionID %in% shown_items) ) { + if ( !(question_raw$QuestionID %in% shown_items) ) { next } - if (!identical(keep_items, c("all"))) { - question <- question[names(question) %in% c("QuestionID", keep_items)] + question <- question_raw[names(question_raw) %in% c("QuestionID", keep_items)] + + recode_values <- question_raw$RecodeValues # If doesn't exist, will be NULL + carryforward_choices <- question_raw$DynamicChoices$Locator # If doesn't exist, will be NULL + + if (!is.null(carryforward_choices)) { + # Get choices that are programmed specifically for this question + old_choices <- question$Choices + + # Get carried-forward choices + carryforward_choices_qid <- carryforward_choices %>% + str_split(., "/") %>% + map(~ .x[3]) %>% unlist() + carryforward_question <- questions[qids == carryforward_choices_qid][[1]]$Payload + carryforward_choices <- carryforward_question$Choices + + # By default, carried forward choices are coded during the carry as + # "x". They are then recoded as pure numeric codes using + # the `RecodeValues` field. Some carried forward choices do not have + # `RecodeValues` defined and so in that case we don't want to prepend the + # codes with "x". + if (!is.null(recode_values)) { + names(carryforward_choices) <- paste0("x", names(carryforward_choices)) + } + # Combine new choices and carried-forward choices + question$Choices <- c(old_choices, carryforward_choices) } - # Rearrange Answers/Choices elements to be consistent between matrix and - # other items. if ("QuestionType" %in% names(question)) { if (question$QuestionType == "Matrix") { + # Rearrange Answers/Choices elements to be consistent between matrix and + # other items. question$Subquestions <- question$Choices question$Choices <- question$Answers question$Answers <- NULL + + # Recode subquestion names to match exported data. + # FALSE if not set, otherwise a list + matrix_subquestion_field_names <- question_raw$ChoiceDataExportTags + if (!inherits(matrix_subquestion_field_names, "list")) { + # When subquestion field names are not set, generate incrementing names + names(question$Subquestions) <- paste( + question$DataExportTag, + 1:length(question$Subquestions), + sep = "_" + ) + } else { + names(question$Subquestions) <- matrix_subquestion_field_names[names(question$Subquestions)] %>% unlist() + } } } @@ -136,8 +177,13 @@ diff_surveys <- function(old_qsf, new_qsf) { old_questions <- old_qsf$questions new_questions <- new_qsf$questions - added <- setdiff(new_shown_items, old_shown_items) - removed <- setdiff(old_shown_items, new_shown_items) + added_qs <- setdiff(new_shown_items, old_shown_items) + added <- rep(NA, length(added_qs)) + names(added) <- added_qs + + removed_qs <- setdiff(old_shown_items, new_shown_items) + removed <- rep(NA, length(removed_qs)) + names(removed) <- removed_qs added_df <- create_diff_df(added, "Added", NULL, new_questions) removed_df <- create_diff_df(removed, "Removed", old_questions, NULL) @@ -171,13 +217,33 @@ diff_question <- function(names, change_type=c("Choices", "QuestionText", old_qsf, new_qsf) { change_type <- match.arg(change_type) - changed <- c() + changed <- list() for (question in names) { if ( !identical(old_qsf[[question]][[change_type]], new_qsf[[question]][[change_type]]) ) { - changed <- append(changed, question) + changed_subquestions <- c() + if (change_type == "Subquestions") { + subquestion_codes <- unique( + c( + names(old_qsf[[question]][[change_type]]), + names(new_qsf[[question]][[change_type]]) + ) + ) + + for (code in subquestion_codes) { + if ( !identical(old_qsf[[question]][[change_type]][[code]], new_qsf[[question]][[change_type]][[code]]) ) { + changed_subquestions <- append(changed_subquestions, code) + } + } + changed_subquestions <- paste(changed_subquestions, collapse=", ") + } + + if (length(changed_subquestions) == 0) { + changed_subquestions <- NA + } + changed[[question]] <- changed_subquestions } } - out <- create_diff_df(changed, change_type, old_qsf, new_qsf) + out <- create_diff_df(unlist(changed), change_type, old_qsf, new_qsf) return(out) } @@ -208,25 +274,26 @@ create_diff_df <- function(questions, change_type=c("Added", "Removed", Choices = "Answer choices changed", Subquestions = "Matrix subquestions changed" ) - questions <- sort(questions) - if (!is.null(old_qsf, new_qsf { - old_qids <- sapply(questions, function(question) { old_qsf, new_qsfquestion]]$QuestionID }) + if (!is.null(old_qsf)) { + old_qids <- sapply(names(questions), function(question) { old_qsf[[question]]$QuestionID }) } else { old_qids <- NA } if (!is.null(new_qsf)) { - new_qids <- sapply(questions, function(question) { new_qsf[[question]]$QuestionID }) + new_qids <- sapply(names(questions), function(question) { new_qsf[[question]]$QuestionID }) } else { new_qids <- NA } out <- data.frame( change_type=change_descriptions[[change_type]], - item=questions, + item=names(questions), old_qid=old_qids, - new_qid=new_qids - ) + new_qid=new_qids, + impacted_subquestions=questions + ) %>% + arrange(item) } return(out) diff --git a/facebook/qsf-tools/qsf-utils.R b/facebook/qsf-tools/qsf-utils.R index 8e68ef81c..f7cdcca43 100644 --- a/facebook/qsf-tools/qsf-utils.R +++ b/facebook/qsf-tools/qsf-utils.R @@ -7,10 +7,10 @@ #' #' @return list of Qualtrics Question IDs (QIDs) of items shown to respondents get_shown_items <- function(qsf) { - block_out <- Filter(function(elem) { elem[["Element"]] == "BL" }, qsf$SurveyElements)[[1]]$Payload + all_blocks <- Filter(function(elem) { elem[["Element"]] == "BL" }, qsf$SurveyElements)[[1]]$Payload shown_items <- list() - for (block in block_out) { + for (block in all_blocks) { if (block$Type == "Trash") { next } @@ -27,10 +27,10 @@ get_shown_items <- function(qsf) { get_block_item_map <- function(qsf) { - block_out <- Filter(function(elem) { elem[["Element"]] == "BL" }, qsf$SurveyElements)[[1]]$Payload + all_blocks <- Filter(function(elem) { elem[["Element"]] == "BL" }, qsf$SurveyElements)[[1]]$Payload items <- list() - for (block in block_out) { + for (block in all_blocks) { if (block$Type == "Trash") { next } @@ -56,7 +56,7 @@ get_block_item_map <- function(qsf) { get_wave <- function(path_to_qsf) { qsf_name_pattern <- "(.*Wave_)([0-9]*([.][0-9])?)([.]qsf)$" if (!grepl(qsf_name_pattern, path_to_qsf)) { - stop("qsf filename should be of the format 'Survey_of_COVID-Like_Illness_-_Wave_XX.qsf'") + stop("qsf filename should be of the format 'Wave_XX.qsf' where 'XX' is an integer or float") } wave <- as.numeric( @@ -65,3 +65,109 @@ get_wave <- function(path_to_qsf) { return(wave) } + +#' Create mapping of QIDs to module name +#' +#' @param qsf contents of QSF file in JSON format +#' +#' @return dataframe with `BlockName` (module name) and `Questions` (QIDs) columns +map_qids_to_module <- function(qsf) { + # get the survey elements with flow logic (should be one per block randomization branch) + ii_flow <- qsf$SurveyElements %>% + map_chr("Element") %>% + {. == "FL"} %>% + which() + ii_block_randomizer <- qsf$SurveyElements[ii_flow] %>% + map(~ .x$Payload$Flow) %>% + map(~ map(.x,~ .x$Type == "BlockRandomizer")) %>% + unlist() %>% + which() + random_block_ids <- qsf$SurveyElements[ii_flow] %>% + map(~ .x$Payload$Flow) %>% + map(~ .x[ii_block_randomizer]) %>% + map(~ map(.x,~ .x$Flow)) %>% + map(~ map(.x,~ map(.x,~ .x$ID))) %>% + unlist() + + block_id_item_map <- get_block_item_map(qsf) + block_id_item_map <- block_id_item_map %>% filter(BlockID %in% random_block_ids) %>% + select(-BlockID) + + return(block_id_item_map) +} + +#' Get only questions that were shown to respondents, using definition in `get_shown_items` +#' +#' @param qsf contents of QSF file in JSON format +#' +#' @return QSF subsetted to only displayed questions +subset_qsf_to_displayed <- function(qsf) { + # get the survey elements that are questions: + ii_questions <- qsf$SurveyElements %>% + map_chr("Element") %>% + {. == "SQ"} %>% + which() + + # get the questions that were shown to respondents + shown_items <- get_shown_items(qsf) + ii_shown <- qsf$SurveyElements[ii_questions] %>% + map_chr(~ .x$Payload$QuestionID) %>% + {. %in% shown_items} %>% + which() + + # subset qsf to valid elements + displayed_questions <- qsf$SurveyElements[ii_questions][ii_shown] + + return(displayed_questions) +} + +#' Replace erroneous question names +#' +#' @param item_names character vector of survey question names +#' @param survey_version either "UMD" or "CMU" +#' @param wave integer or float survey version +#' +#' @return character vector of repaired survey question names +patch_item_names <- function(item_names, survey_version, wave) { + if (survey_version == "CMU") { + # B13 was originally named incorrectly. + item_names[item_names == "B13 "] <- "B13" + # V2a in Wave 13 was originally named incorrectly. + if (wave == 13) { + item_names[item_names == "V2a"] <- "V2d" + } + } else if (survey_version == "UMD") { + # pass + } + + return(item_names) +} + +#' Fetch and customize question format types. +#' +#' @param qsf contents of QSF file in JSON format +#' @param item_names character vector of survey question names +#' @param survey_version either "UMD" or "CMU" +#' +#' @return character vector of repaired survey question names +get_question_formats <- function(qsf, item_names, survey_version){ + type_map <- c(MC = "Multiple choice", TE = "Text", Matrix = "Matrix") + + qtype <- qsf %>% + map_chr(~ .x$Payload$QuestionType) %>% + {type_map[.]} + + ii_multiselect <- qsf %>% + map_chr(~ .x$Payload$Selector) %>% + {. == "MAVR"} %>% + which() + qtype[ii_multiselect] <- "Multiselect" + + if (survey_version == "CMU") { + qtype[item_names == "A5"] <- "Matrix" # this will be treated like C10 + } else if (survey_version == "UMD") { + # pass + } + + return(qtype) +} diff --git a/sir_complainsalot/params.json.template b/sir_complainsalot/params.json.template index e8b5c61fc..5ac618dc9 100644 --- a/sir_complainsalot/params.json.template +++ b/sir_complainsalot/params.json.template @@ -79,26 +79,27 @@ "smoothed_inperson_school_fulltime", "smoothed_winperson_school_fulltime", "smoothed_inperson_school_parttime", "smoothed_winperson_school_parttime", "smoothed_vaccinate_children", "smoothed_wvaccinate_children", - ["smoothed_vaccine_barrier_appointment_time_tried", "msa"], ["smoothed_wvaccine_barrier_appointment_time_tried", "msa"], - ["smoothed_vaccine_barrier_childcare_tried", "msa"], ["smoothed_wvaccine_barrier_childcare_tried", "msa"], - ["smoothed_vaccine_barrier_document_tried", "msa"], ["smoothed_wvaccine_barrier_document_tried", "msa"], - ["smoothed_vaccine_barrier_eligible_tried", "msa"], ["smoothed_wvaccine_barrier_eligible_tried", "msa"], - ["smoothed_vaccine_barrier_language_tried", "msa"], ["smoothed_wvaccine_barrier_language_tried", "msa"], - ["smoothed_vaccine_barrier_no_appointments_tried", "msa"], ["smoothed_wvaccine_barrier_no_appointments_tried", "msa"], - ["smoothed_vaccine_barrier_none_tried", "msa"], ["smoothed_wvaccine_barrier_none_tried", "msa"], - ["smoothed_vaccine_barrier_technical_difficulties_tried", "msa"], ["smoothed_wvaccine_barrier_technical_difficulties_tried", "msa"], - ["smoothed_vaccine_barrier_technology_access_tried", "msa"], ["smoothed_wvaccine_barrier_technology_access_tried", "msa"], - ["smoothed_vaccine_barrier_time_tried", "msa"], ["smoothed_wvaccine_barrier_time_tried", "msa"], - ["smoothed_vaccine_barrier_travel_tried", "msa"], ["smoothed_wvaccine_barrier_travel_tried", "msa"], - ["smoothed_vaccine_barrier_type_tried", "msa"], ["smoothed_wvaccine_barrier_type_tried", "msa"], + ["smoothed_vaccine_barrier_appointment_time_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_appointment_time_tried", "msa", "county", "state"], + ["smoothed_vaccine_barrier_childcare_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_childcare_tried", "msa", "county", "state"], + ["smoothed_vaccine_barrier_document_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_document_tried", "msa", "county", "state"], + ["smoothed_vaccine_barrier_eligible_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_eligible_tried", "msa", "county", "state"], + ["smoothed_vaccine_barrier_language_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_language_tried", "msa", "county", "state"], + ["smoothed_vaccine_barrier_no_appointments_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_no_appointments_tried", "msa", "county", "state"], + ["smoothed_vaccine_barrier_none_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_none_tried", "msa", "county", "state"], + ["smoothed_vaccine_barrier_technical_difficulties_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_technical_difficulties_tried", "msa", "county", "state"], + ["smoothed_vaccine_barrier_technology_access_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_technology_access_tried", "msa", "county", "state"], + ["smoothed_vaccine_barrier_time_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_time_tried", "msa", "county", "state"], + ["smoothed_vaccine_barrier_travel_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_travel_tried", "msa", "county", "state"], + ["smoothed_vaccine_barrier_type_tried", "msa", "county", "state"], ["smoothed_wvaccine_barrier_type_tried", "msa", "county", "state"], ["smoothed_try_vaccinate_1m", "hrr"], ["smoothed_wtry_vaccinate_1m", "hrr"], ["smoothed_try_vaccinate_1m", "msa"], ["smoothed_wtry_vaccinate_1m", "msa"], - ["smoothed_dontneed_reason_had_covid", "hrr"], ["smoothed_wdontneed_reason_had_covid", "hrr"], - ["smoothed_dontneed_reason_not_beneficial", "hrr"], ["smoothed_wdontneed_reason_not_beneficial", "hrr"], - ["smoothed_dontneed_reason_not_high_risk", "hrr"], ["smoothed_wdontneed_reason_not_high_risk", "hrr"], - ["smoothed_dontneed_reason_not_serious", "hrr"], ["smoothed_wdontneed_reason_not_serious", "hrr"], - ["smoothed_dontneed_reason_other", "hrr"], ["smoothed_wdontneed_reason_other", "hrr"], - ["smoothed_dontneed_reason_precautions", "hrr"], ["smoothed_wdontneed_reason_precautions", "hrr"], + ["smoothed_dontneed_reason_dont_spend_time", "hrr"], ["smoothed_wdontneed_reason_dont_spend_time", "hrr", "msa"], + ["smoothed_dontneed_reason_had_covid", "hrr"], ["smoothed_wdontneed_reason_had_covid", "hrr", "msa"], + ["smoothed_dontneed_reason_not_beneficial", "hrr"], ["smoothed_wdontneed_reason_not_beneficial", "hrr", "msa"], + ["smoothed_dontneed_reason_not_high_risk", "hrr"], ["smoothed_wdontneed_reason_not_high_risk", "hrr", "msa"], + ["smoothed_dontneed_reason_not_serious", "hrr"], ["smoothed_wdontneed_reason_not_serious", "hrr", "msa"], + ["smoothed_dontneed_reason_other", "hrr"], ["smoothed_wdontneed_reason_other", "hrr", "msa"], + ["smoothed_dontneed_reason_precautions", "hrr"], ["smoothed_wdontneed_reason_precautions", "hrr", "msa"], "smoothed_screening_tested_positive_14d", "smoothed_wscreening_tested_positive_14d", "smoothed_travel_outside_state_7d", "smoothed_wtravel_outside_state_7d", "smoothed_belief_vaccinated_mask_unnecessary", "smoothed_wbelief_vaccinated_mask_unnecessary",