# Load the four data files and only keep the useful columns
prolific_export = read_csv("../data/prolific_export.csv") %>%
  select(participant_id,
         entered_code,
         time_taken,
         age,
         country = `Current Country of Residence`,
         sex = Sex)

results = read_csv("../data/results.csv") %>%
  select(participant_id,
         fund_allocation_southeast_asia = fundAllocation_UNHCR,
         fund_allocation_middle_east = fundAllocation_IOM,
         donation_allocation_southeast_asia = donationAllocation) %>%
  mutate(fund_allocation_difference = fund_allocation_southeast_asia - fund_allocation_middle_east)

excluded = read_csv("../data/excluded.csv") %>%
  select(participant_id,
         failed_attention_check,
         reloaded) %>%
  mutate(participant_id = as.character(participant_id)) # necessary if all are NAs 

agreed = read_csv("../data/all_who_agreed.csv") %>%
  select(participant_id,
         condition)

# Join the four datasets and clean up a bit
data_all = agreed %>%
  left_join(excluded, by = "participant_id") %>%
  left_join(prolific_export, by = "participant_id") %>%
  full_join(results, by = "participant_id") %>%
  subset(!participant_id %in% exclude_participant_ids) %>% 
  mutate(failed_attention_check = coalesce(failed_attention_check, 0), # replace NAs with zeros
         reloaded = coalesce(reloaded, 0))

# Clean up possibly serious anomalies in the data and issue warnings if necessary
data_all_original = data_all
data_all = data_all %>%
  drop_na(participant_id, condition) %>%
  distinct(participant_id, .keep_all= TRUE)
# if (nrow(data_all) != nrow(data_all_original)) {
#   cat("WARNING -- Data has duplicate participants, missing participant IDs, or missing conditions:")
#   anti_join(data_all_original, data_all)
# }

# Create another dataset with completed submissions only
data = data_all %>%
  filter(entered_code == completion_code)

# Split datasets according to the condition
data_all_rich_first = data_all %>% filter(condition == "richFirst")
data_all_poor_first = data_all %>% filter(condition == "poorFirst")
data_rich_first = data %>% filter(condition == "richFirst")
data_poor_first = data %>% filter(condition == "poorFirst")

0.1 Data

The final dataset has 64 participants in the rich first condition and 64 in the poor first condition.

We use Cohenโ€™s d and probability of superiority as standardized effect sizes. We interpret the effect sizes based on the work of Lakens (2013).

0.2 Primary effect

DV1 = standardized mean difference between funds allocated to the rich visualization and the poor visualization

DV1_rich = c(data_rich_first %>% pull(fund_allocation_southeast_asia),
             data_poor_first %>% pull(fund_allocation_middle_east))
DV1_poor = c(data_rich_first %>% pull(fund_allocation_middle_east),
             data_poor_first %>% pull(fund_allocation_southeast_asia))
effect1.d = cohen.d(DV1_rich, DV1_poor)
effect1.ps = ps(effect1.d)

print_effect("Cohen's d", effect1.d)
print_effect("Probability of superiority", effect1.ps, plot = F)
## Cohen's d :  0.12, 95% CI [-0.13, 0.37] 
## Probability of superiority :  0.53, 95% CI [0.46, 0.6]

There is a 53.4% probability that an individual allocated more funds when s/he saw the rich visualization than the poor one.

0.3 Secondary effect

DV2 = Percentage of global UNHCR funds allocated to SouthEast Asia (the rest being allocated to other parts of the world)

DV2_rich = data_rich_first %>% pull(fund_allocation_southeast_asia)
DV2_poor = data_poor_first %>% pull(fund_allocation_southeast_asia)
effect2.d = cohen.d(DV2_rich, DV2_poor)
effect2.ps = ps(effect2.d)

print_effect("Cohen's d", effect2.d)
print_effect("Probability of superiority", effect2.ps, plot = F)
## Cohen's d :  0.18, 95% CI [-0.17, 0.53] 
## Probability of superiority :  0.55, 95% CI [0.45, 0.65]

There is a 55.02% probability that a randomly sampled person who saw the rich visualization will allocate more funds than a randomly sampled person who saw the poor visualization.

DV3 = Percentage of personal money donated to the rich visualization compared to the amount donated to the poor visualization scenario

DV3_rich = c(data_rich_first %>% pull(donation_allocation_southeast_asia),
             data_poor_first %>%
               mutate(donation_allocation_middle_east = 100 - donation_allocation_southeast_asia) %>%
               pull(donation_allocation_middle_east))
DV3_poor = c(data_rich_first %>%
               mutate(donation_allocation_middle_east = 100 - donation_allocation_southeast_asia) %>%
               pull(donation_allocation_middle_east),
             data_poor_first %>% pull(donation_allocation_southeast_asia))
effect3.d = cohen.d(DV3_rich, DV3_poor)
effect3.ps = ps(effect3.d)

print_effect("Cohen's d", effect3.d)
print_effect("Probability of superiority", effect3.ps, plot = F)
## Cohen's d :  -0.12, 95% CI [-0.37, 0.13] 
## Probability of superiority :  0.47, 95% CI [0.4, 0.54]

There is a 46.6% probability that an individual donated more money to the organization related to the rich visualization.

plotAllCIs(lim = c(-1, 1), xlabel = "Percent increase in donations for information-rich visualizations")