“How often do you order foie gras at a restaurant or purchase at a store?” % each option
About once a month Once or twice a year or less
2.6449644 83.5198372
Several times a month Several times a year
1.6276704 12.0040692
Weekly or more
0.2034588
var
1 how_often_do_you_order_foie_gras_at_a_restaurant_or_purchase_at_a_store
2 how_often_do_you_order_foie_gras_at_a_restaurant_or_purchase_at_a_store
3 how_often_do_you_order_foie_gras_at_a_restaurant_or_purchase_at_a_store
4 how_often_do_you_order_foie_gras_at_a_restaurant_or_purchase_at_a_store
5 how_often_do_you_order_foie_gras_at_a_restaurant_or_purchase_at_a_store
category proportion lb ub
1 About once a month 2.55 1.35 3.74
2 Once or twice a year or less 82.59 79.57 85.62
3 Several times a month 1.86 0.76 2.95
4 Several times a year 12.95 10.24 15.65
5 Weekly or more 0.06 -0.02 0.14
“How do you think foie gras is typically produced? (select one)” % each option
Before slaughter, ducks or geese are injected with a medication which causes their liver to swell to an abnormally large size, resulting in the taste of the liver.
2.191781
Ducks and geese are kept confined, unable to move their whole life, with supplementation of corn and fat. Limited exercise and increased fat consumption results in a larger and less lean animal, enhancing the taste of the liver.
34.162276
Ducks and geese are left to wander and forage for their food, with supplementation of corn and fat. This enhanced exercise and diet results in a healthier animal, enhancing the taste of the liver.
11.211802
Ducks or geese are force fed a diet of corn and fat. This involves having a tube with a funnel inserted down their esophagus to deliver food which causes their liver to swell to an abnormally large size, resulting in the taste of the liver for foie gras.
52.434141
var
1 how_do_you_think_foie_gras_is_typically_produced_select_one
2 how_do_you_think_foie_gras_is_typically_produced_select_one
3 how_do_you_think_foie_gras_is_typically_produced_select_one
4 how_do_you_think_foie_gras_is_typically_produced_select_one
category
1 Before slaughter, ducks or geese are injected with a medication which causes their liver to swell to an abnormally large size, resulting in the taste of the liver.
2 Ducks and geese are kept confined, unable to move their whole life, with supplementation of corn and fat. Limited exercise and increased fat consumption results in a larger and less lean animal, enhancing the taste of the liver.
3 Ducks and geese are left to wander and forage for their food, with supplementation of corn and fat. This enhanced exercise and diet results in a healthier animal, enhancing the taste of the liver.
4 Ducks or geese are force fed a diet of corn and fat. This involves having a tube with a funnel inserted down their esophagus to deliver food which causes their liver to swell to an abnormally large size, resulting in the taste of the liver for foie gras.
proportion lb ub
1 2.02 1.52 2.53
2 33.77 32.05 35.50
3 12.68 11.44 13.92
4 51.53 49.70 53.35
#Genderprop.table(table(df$gender_raw[!(df$gender_raw %in%c("Prefer not to say","Prefer to self-describe"))]))*100
Female Male Non-binary / third gender
57.453092 40.392634 2.154274
weighted_mean(df[!(df$gender_raw %in%c("Prefer not to say","Prefer to self-describe")),], "gender_raw")
var category proportion lb ub
1 gender_raw Female 52.99 51.33 54.64
2 gender_raw Male 45.76 44.10 47.42
3 gender_raw Non-binary / third gender 1.25 0.96 1.54
#incomeprop.table(table(df$income))*100
$100,000–$149,999 $150,000–$199,999
18.125324 8.406698
$200,000 or more $25,000–$49,999
6.266183 18.815812
$50,000–$74,999 $75,000–$99,999
18.815812 16.002071
<$25,000 Prefer not to say or missing
10.460901 3.107198
weighted_mean(df, "income")
var category proportion lb ub
1 income $100,000–$149,999 19.17 17.88 20.47
2 income $150,000–$199,999 9.86 8.86 10.86
3 income $200,000 or more 11.10 9.94 12.26
4 income $25,000–$49,999 16.33 15.15 17.51
5 income $50,000–$74,999 17.61 16.38 18.85
6 income $75,000–$99,999 14.85 13.69 16.00
7 income <$25,000 10.14 9.15 11.13
8 income Prefer not to say or missing 0.93 0.79 1.07
#Do you live in any of the following cities? prop.table(table(df$do_you_live_in_any_of_the_following_cities))*100
Denver, CO Portland, OR Washington DC
41.55844 40.58442 17.85714
var category proportion lb
1 do_you_live_in_any_of_the_following_cities Denver, CO 41.42 36.39
2 do_you_live_in_any_of_the_following_cities Portland, OR 39.09 34.12
3 do_you_live_in_any_of_the_following_cities Washington DC 19.49 15.36
ub
1 46.45
2 44.05
3 23.63
### In politics today, do you consider yourself a Republican, Democrat, an Independent or something else/no party?prop.table(table(df$political_affiliation))*100
### What is the highest level of education you have completed? prop.table(table(df$education))*100
Bachelor’s degree Graduate or professional degree
37.4072156 20.5420335
High school graduate or equivalent Less than high school diploma
11.7210426 0.5351286
Prefer not to say Some college or associate’s degree
0.2244088 29.5701709
weighted_mean(df, "education")
var category proportion lb ub
1 education Bachelor’s degree 30.30 28.85 31.75
2 education Graduate or professional degree 17.67 16.47 18.87
3 education High school graduate or equivalent 19.04 17.62 20.46
4 education Less than high school diploma 1.37 0.87 1.87
5 education Prefer not to say 0.07 0.03 0.10
6 education Some college or associate’s degree 31.55 30.01 33.09
### What was your total household income before taxes during the past 12 months? prop.table(table(df$income))*100
$100,000–$149,999 $150,000–$199,999
18.125324 8.406698
$200,000 or more $25,000–$49,999
6.266183 18.815812
$50,000–$74,999 $75,000–$99,999
18.815812 16.002071
<$25,000 Prefer not to say or missing
10.460901 3.107198
weighted_mean(df, "income")
var category proportion lb ub
1 income $100,000–$149,999 19.17 17.88 20.47
2 income $150,000–$199,999 9.86 8.86 10.86
3 income $200,000 or more 11.10 9.94 12.26
4 income $25,000–$49,999 16.33 15.15 17.51
5 income $50,000–$74,999 17.61 16.38 18.85
6 income $75,000–$99,999 14.85 13.69 16.00
7 income <$25,000 10.14 9.15 11.13
8 income Prefer not to say or missing 0.93 0.79 1.07
Do you own or have you owned a pet in the past?
No Yes
7.975142 92.024858
var category proportion lb
1 do_you_own_or_have_you_owned_a_pet_in_the_past No 8.66 7.71
2 do_you_own_or_have_you_owned_a_pet_in_the_past Yes 91.34 90.40
ub
1 9.60
2 92.29
I am vegan or vegetarian
No Not sure Yes
92.5427240 0.5351286 6.9221474
var category proportion lb ub
1 i_am_vegan_or_vegetarian No 93.40 92.60 94.21
2 i_am_vegan_or_vegetarian Not sure 0.48 0.25 0.70
3 i_am_vegan_or_vegetarian Yes 6.12 5.34 6.89
I hunt or fish
No Not sure Yes
78.508545 0.327982 21.163473
var category proportion lb ub
1 i_hunt_or_fish No 76.54 75.12 77.97
2 i_hunt_or_fish Not sure 0.37 0.15 0.59
3 i_hunt_or_fish Yes 23.09 21.67 24.50
I am or have been a farmer or rancher
No Not sure Yes
93.8373900 0.3797687 5.7828414
var category proportion lb ub
1 i_am_or_have_been_a_farmer_or_rancher No 94.11 93.35 94.87
2 i_am_or_have_been_a_farmer_or_rancher Not sure 0.34 0.14 0.53
3 i_am_or_have_been_a_farmer_or_rancher Yes 5.56 4.82 6.29
I have friends who are vegan or vegetarian
No Not sure Yes
25.012947 2.848265 72.138788
var category proportion lb ub
1 i_have_friends_who_are_vegan_or_vegetarian No 27.50 26.00 29.00
2 i_have_friends_who_are_vegan_or_vegetarian Not sure 3.42 2.75 4.08
3 i_have_friends_who_are_vegan_or_vegetarian Yes 69.09 67.53 70.64
More Descriptive Statistics
Moderately/Strongly Support for the following variables by message condition weighted and by state weighted for demographics
-need to stratify by state -also stratify by state and control vs most effective.
Support ban on sale of foie gras at the state level
Warning: package 'rlang' was built under R version 4.4.3
Attaching package: 'rlang'
The following objects are masked from 'package:purrr':
%@%, flatten, flatten_chr, flatten_dbl, flatten_int, flatten_lgl,
flatten_raw, invoke, splice
df$state<-df$what_state_do_you_live_in outcome_var ="bin_ban_forcefeeding_state" y_label ="Percent supportive (weighted)" title_state ="Support for state ban on forcefeeding by state" title_message ="Support for state ban on forcefeeding by message" state_col ="state"message_col ="tr_message"keep_category ="1"title_state_unweighted =NULLrotate_x =45run_support_tables_and_plots <-function(df, outcome_var,y_label ="Percent (weighted)",title_state =NULL,title_message =NULL,title_state_unweighted =NULL,rotate_x =25,state_col ="state",message_col ="tr_message",keep_category ="1") {stopifnot(is.character(outcome_var), length(outcome_var) ==1)stopifnot(is.character(state_col), length(state_col) ==1)stopifnot(is.character(message_col), length(message_col) ==1)# Default titles if not providedif (is.null(title_state)) { title_state <-paste0(outcome_var, " by ", state_col, " (weighted)") }if (is.null(title_message)) { title_message <-paste0(outcome_var, " by ", message_col, " (weighted)") }if (is.null(title_state_unweighted)) { title_state_unweighted <-paste0(outcome_var, " by ", state_col, " (unweighted)") }# --- 1) Unweighted by state (percent) --- unweighted_state <- df %>%group_by(.data[[state_col]]) %>%summarise(prop =mean(.data[[outcome_var]], na.rm =TRUE) *100,n =sum(!is.na(.data[[outcome_var]])),.groups ="drop" ) %>%arrange(desc(prop))# --- 2) Weighted by state --- state_res <- df %>%group_by(.data[[state_col]]) %>%do(weighted_mean(., outcome_var)) %>%filter(category == keep_category) %>%select(state = .data[[state_col]], var, proportion, lb, ub ) %>%as.data.frame()# Plot: weighted by state p_state <-ggplot(state_res, aes(x =reorder(state, -proportion), y = proportion)) +geom_bar(stat ="identity") +geom_errorbar(aes(ymin = lb, ymax = ub), width =0.2) +labs(x ="State", y = y_label, title = title_state) +theme_minimal() +theme(axis.text.x =element_text(angle = rotate_x, hjust =1))# --- 3) Weighted by message --- message_res <- df %>%group_by(.data[[message_col]]) %>%do(weighted_mean(., outcome_var)) %>%filter(category == keep_category) %>%select(tr_message = .data[[message_col]], var, proportion, lb, ub ) %>%as.data.frame() # Plot: weighted by message p_message <-ggplot(message_res, aes(x =reorder(tr_message, -proportion), y = proportion)) +geom_bar(stat ="identity") +geom_errorbar(aes(ymin = lb, ymax = ub), width =0.2) +labs(x ="Message", y = y_label, title = title_message) +theme_minimal() +theme(axis.text.x =element_text(angle = rotate_x, hjust =1))# --- 4) Weighted by message x state (table only) --- message_state_res <- df %>%group_by(.data[[message_col]], .data[[state_col]]) %>%filter(n()>5, length(unique(.data[[outcome_var]]))>1) %>%do(weighted_mean(., outcome_var)) %>%filter(category == keep_category) %>%select(tr_message = .data[[message_col]],state = .data[[state_col]], var, proportion, lb, ub ) %>%as.data.frame()# Print all outputs (tables + plots)print(unweighted_state)print(state_res)print(p_state)print(message_res)print(p_message)print(message_state_res)# Return them invisibly for programmatic useinvisible(list(unweighted_state = unweighted_state,state_res =kable(state_res),plot_state = p_state,message_res =kable(message_res),plot_message = p_message,message_state_res =kable(message_state_res) ))}run_support_tables_and_plots(df = df,outcome_var ="bin_ban_sale_state",y_label ="Percent supportive (weighted)",title_state ="Support for state ban on sale of foie gras by state",title_message ="Support for state ban on sale of foie gras by message")
Warning: Use of .data in tidyselect expressions was deprecated in tidyselect 1.2.0.
ℹ Please use `all_of(var)` (or `any_of(var)`) instead of `.data[[var]]`
# A tibble: 12 × 3
state prop n
<chr> <dbl> <int>
1 No response 84.4 128
2 Pennsylvania 84.1 804
3 Ohio 82.6 657
4 North Carolina 82.4 648
5 Maryland 81.5 373
6 Oregon 81.2 388
7 Massachuttes 81.0 379
8 Washington 81.0 420
9 Colorado 80.8 400
10 Florida 79.5 1138
11 District of Columbia 78.6 56
12 New Jersey 78.1 402
state var proportion lb ub
1 Colorado bin_ban_sale_state 76.78 71.21 82.36
2 District of Columbia bin_ban_sale_state 72.84 56.45 89.22
3 Florida bin_ban_sale_state 79.29 76.37 82.21
4 Maryland bin_ban_sale_state 81.16 76.16 86.15
5 Massachuttes bin_ban_sale_state 80.75 75.81 85.69
6 New Jersey bin_ban_sale_state 80.48 75.85 85.11
7 No response bin_ban_sale_state 84.74 77.18 92.30
8 North Carolina bin_ban_sale_state 78.63 74.29 82.97
9 Ohio bin_ban_sale_state 83.29 79.75 86.82
10 Oregon bin_ban_sale_state 79.05 73.71 84.39
11 Pennsylvania bin_ban_sale_state 81.46 77.80 85.11
12 Washington bin_ban_sale_state 80.10 75.16 85.04