Skip to content

Commit 2170af6

Browse files
committed
add V6 to API
1 parent e5f0daf commit 2170af6

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

facebook/delphiFacebook/R/binary.R

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,22 @@ get_binary_indicators <- function() {
147147
"smoothed_whesitancy_reason_pregnant", "weight", "v_hesitancy_reason_pregnant", 6, compute_binary_response, jeffreys_binary,
148148
"smoothed_hesitancy_reason_religious", "weight_unif", "v_hesitancy_reason_religious", 6, compute_binary_response, jeffreys_binary,
149149
"smoothed_whesitancy_reason_religious", "weight", "v_hesitancy_reason_religious", 6, compute_binary_response, jeffreys_binary,
150+
151+
# reasons for belief that vaccine is unnecessary
152+
"smoothed_dontneed_reason_had_covid", "weight_unif", "v_dontneed_reason_had_covid", 6, compute_binary_response, jeffreys_binary,
153+
"smoothed_wdontneed_reason_had_covid", "weight", "v_dontneed_reason_had_covid", 6, compute_binary_response, jeffreys_binary,
154+
"smoothed_dontneed_reason_dont_spend_time", "weight_unif", "v_dontneed_reason_dont_spend_time", 6, compute_binary_response, jeffreys_binary,
155+
"smoothed_wdontneed_reason_dont_spend_time", "weight", "v_dontneed_reason_dont_spend_time", 6, compute_binary_response, jeffreys_binary,
156+
"smoothed_dontneed_reason_not_high_risk", "weight_unif", "v_dontneed_reason_not_high_risk", 6, compute_binary_response, jeffreys_binary,
157+
"smoothed_wdontneed_reason_not_high_risk", "weight", "v_dontneed_reason_not_high_risk", 6, compute_binary_response, jeffreys_binary,
158+
"smoothed_dontneed_reason_precautions", "weight_unif", "v_dontneed_reason_precautions", 6, compute_binary_response, jeffreys_binary,
159+
"smoothed_wdontneed_reason_precautions", "weight", "v_dontneed_reason_precautions", 6, compute_binary_response, jeffreys_binary,
160+
"smoothed_dontneed_reason_not_serious", "weight_unif", "v_dontneed_reason_not_serious", 6, compute_binary_response, jeffreys_binary,
161+
"smoothed_wdontneed_reason_not_serious", "weight", "v_dontneed_reason_not_serious", 6, compute_binary_response, jeffreys_binary,
162+
"smoothed_dontneed_reason_not_beneficial", "weight_unif", "v_dontneed_reason_not_beneficial", 6, compute_binary_response, jeffreys_binary,
163+
"smoothed_wdontneed_reason_not_beneficial", "weight", "v_dontneed_reason_not_beneficial", 6, compute_binary_response, jeffreys_binary,
164+
"smoothed_dontneed_reason_other", "weight_unif", "v_dontneed_reason_other", 6, compute_binary_response, jeffreys_binary,
165+
"smoothed_wdontneed_reason_other", "weight", "v_dontneed_reason_other", 6, compute_binary_response, jeffreys_binary,
150166
)
151167

152168

facebook/delphiFacebook/R/variables.R

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,28 @@ code_vaccines <- function(input_data) {
389389
input_data$v_hesitancy_reason_pregnant <- NA_real_
390390
input_data$v_hesitancy_reason_religious <- NA_real_
391391
}
392+
393+
if ( "V6" %in% names(input_data) ) {
394+
# introduced in Wave 8
395+
dontneed_reasons <- split_options(input_data$V6)
396+
397+
input_data$v_dontneed_reason_had_covid <- is_selected(dontneed_reasons, "1")
398+
input_data$v_dontneed_reason_dont_spend_time <- is_selected(dontneed_reasons, "2")
399+
input_data$v_dontneed_reason_not_high_risk <- is_selected(dontneed_reasons, "3")
400+
input_data$v_dontneed_reason_precautions <- is_selected(dontneed_reasons, "4")
401+
input_data$v_dontneed_reason_not_serious <- is_selected(dontneed_reasons, "5")
402+
input_data$v_dontneed_reason_not_beneficial <- is_selected(dontneed_reasons, "7")
403+
input_data$v_dontneed_reason_other <- is_selected(dontneed_reasons, "8")
404+
405+
} else {
406+
input_data$v_dontneed_reason_had_covid <- NA
407+
input_data$v_dontneed_reason_dont_spend_time <- NA
408+
input_data$v_dontneed_reason_not_high_risk <- NA
409+
input_data$v_dontneed_reason_precautions <- NA
410+
input_data$v_dontneed_reason_not_serious <- NA
411+
input_data$v_dontneed_reason_not_beneficial <- NA
412+
input_data$v_dontneed_reason_other <- NA
413+
}
392414

393415
if ("V9" %in% names(input_data)) {
394416
input_data$v_worried_vaccine_side_effects <- (

0 commit comments

Comments
 (0)