Set params

MIN_PARTICIPANTS_PER_COUNTRY <- 400

Gender-career

From wiki:

From 2005 to present, the Gender-Career IAT was available on the Project Implicit demonstration website (https://implicit.harvard.edu/implicit/selectatest.html Click on “Gender-Career IAT” to try it yourself). The Gender-Career IAT includes one standard IAT (Male vs. Female; Career vs. Family), sets of explicit measures on gender roles (such as association between career with females or males, personal importance of career or family), set of demographic questions (age, gender, education level, number of children, etc.), and debriefing questions about how respondents thought about their IAT score after the task.

From 2005 to the end of 2016, there are more than 1,645,902 session IDs created for Gender-Career IAT, and the overall completion rate is around 49.8%. There were 1,052,013 respondents who completed the standard IAT part of the task, which is 63.9% of the total respondents

Note that the DV here is the pre-calculated “D” score from the D alogrithm by Greenwald and colleagues (2003). This monotonically scales with cohen’s d, but I have not calculated cohen’s d here.

https://osf.io/f6mnr/ http://projectimplicit.net/nosek/iat/


Pre-processing

Read in career-gender IAT data.

#d <- read_sav("../data/IAT/Gender-Career/Gender-Career IAT.public.2005-2016.sav") 

#write_feather(d, "../data/IAT/Gender-Career/Gender-Career IAT.public.2005-2016.feather") %>%

d_raw <- read_feather("../../data/IAT/Gender-Career/Gender-Career IAT.public.2005-2016.feather") %>%
  select(D_biep.Male_Career_all, sex, countryres, PCT_error_3467, 
         Mn_RT_all_3467, Mn_RT_all_3, Mn_RT_all_4, Mn_RT_all_6, Mn_RT_all_7,
         assocareer, assofamily, impcareer, impfamily, actualduties, idealduties, femaleceos)

Do same exclusions as Nosek (2002), pg. 104. Also exclude NA sex, D, country.

d <- d_raw %>%
  filter(PCT_error_3467 <= 25,
         Mn_RT_all_3467 <= 1500,
         Mn_RT_all_3 <= 1800,
         Mn_RT_all_4 <= 1800,
         Mn_RT_all_6 <= 1800,
         Mn_RT_all_7 <= 1800) %>%
    filter(sex %in% c("f", "m")) %>%
    filter(!is.na(D_biep.Male_Career_all) & !is.na(countryres)) %>%
    rename(overall_iat_score = D_biep.Male_Career_all) 

Filter to include only countries with many participants

countries <- rev(sort(unique(d$countryres)))[1:233]

d_clean <- d %>% 
  mutate(countryres = as.factor(countryres)) %>%
  filter(countryres %in% countries) %>%
  mutate(country_name = countrycode(countryres,
                                    "iso2c",
                                    "country.name")) %>%
  mutate(country_name = replace(country_name, 
                                countryres == "UK", "UK")) 

country_ns <- count(d_clean, countryres)  %>%
  filter(n >= MIN_PARTICIPANTS_PER_COUNTRY) %>%
  arrange(-n)

d_clean_frequent <- d_clean %>%
  inner_join(country_ns) %>%
  filter(!is.na(country_name))

# write_csv(country_ns, "../../data/other/iat_behavior_langs.csv")

There are 44 with at least 400 participants. This includes 714697 participants.

Country means

country_means_career <- d_clean_frequent %>%
  group_by(country_name) %>%
  multi_boot_standard(col = "overall_iat_score")  %>%
  mutate(type = "country_means_D_score")
ggplot(country_means_career, aes(x = reorder(country_name, mean), 
                                 y = mean)) +
  geom_bar(stat = "identity", position = "dodge") +
  ggtitle("IAT gender-career bias (2005 - 2016 data)") +
  ylab("IAT gender bias") +
  xlab("Country") +
  geom_linerange(aes(ymin = ci_lower, ymax = ci_upper),  
                 position = position_dodge(width = .9)) +
  theme_bw() +
  theme(axis.text.x = element_text(angle = 60, hjust = 1),
        legend.position = "none") 

World map

map_world <- map_data(map = "world") %>%
  mutate(country_name = region) %>%
  mutate(country_name = fct_recode(country_name,
    `United States of America` = "USA", 
    `Russian Federation` = "Russia",
    `Republic of Korea` = "South Korea")) 

map_data <- left_join(map_world, country_means_career) %>%
  rename(gender_bias = mean) %>%
  filter(lat > -57, 
         long > -165) 

ggplot(map_data, aes(x = long, y = lat, 
                            group = group, 
                            fill = gender_bias)) + 
  scale_fill_gradient2(midpoint = mean(map_data$gender_bias, na.rm = T), 
                       low = "blue", high = "red") +
  #scale_fill_continuous(low ="white", high = "blue") + 
  geom_polygon(color = "black", size = .1) +
  #geom_polygon() +
  theme_bw()

Europe map

ggplot(map_data, aes(x = long, y = lat, 
                            group = group, 
                            fill = gender_bias)) + 
  scale_fill_gradient2(midpoint = mean(map_data$gender_bias, na.rm = T), low = "blue", high = "red") +
  #scale_fill_continuous(low ="white", high = "blue") + 
  geom_polygon(color = "black", size = .1) +
  #geom_polygon() +
  theme_bw() +
  coord_map(xlim = c(-13, 35),  ylim = c(32, 71))

Country x Gender means

Women > men. This is consistent with Harvesting Implicit Group Attitudes and Beliefs From a Demonstration Web Site (Nosek, 2002).

Get country means

country_means_career_gender <- d_clean_frequent %>%
  group_by(country_name, sex) %>%
  multi_boot_standard(col = "overall_iat_score") %>%
  mutate(type = "country_gender_D_score")
ggplot(country_means_career_gender, aes(x = reorder(country_name, mean), 
                                 y = mean, fill = sex)) +
  geom_bar(stat = "identity", position = "dodge") +
  ggtitle("IAT gender-career bias (2005 - 2016 data)") +
  ylab("IAT gender bias (D-score)") +
  xlab("Country") +
  geom_linerange(aes(ymin = ci_lower, ymax = ci_upper, group = sex),  
                 position = position_dodge(width = .9)) +
  theme_bw() +
  theme(axis.text.x = element_text(angle = 60, hjust = 1)) 

Males have far more variability:

ggplot(country_means_career_gender, 
                                 aes(x = sex, 
                                     y = mean, 
                                     fill = sex, 
                                     color = sex, 
                                     group = sex)) +
  geom_violin(draw_quantiles = c(0.25, 0.5, 0.75)) +
  theme_bw()

Genders separately

country_means_career_gender %>%
  filter(sex == "f") %>%
  ggplot(aes(x = reorder(country_name, mean), 
                                 y = mean, fill = sex)) +
  geom_bar(stat = "identity", position = "dodge") +
  ggtitle("IAT gender-career bias (2005 - 2016 data)") +
  ylab("IAT gender bias (D-score), Females only") +
  xlab("Country") +
  geom_linerange(aes(ymin = ci_lower, ymax = ci_upper),  
                 position = position_dodge(width = .9)) +
  theme_bw() +
  theme(axis.text.x = element_text(angle = 60, hjust = 1),
        legend.position = "none") 

country_means_career_gender %>%
  filter(sex == "m") %>%
  ggplot(aes(x = reorder(country_name, mean), 
                                 y = mean, fill = sex)) +
  geom_bar(stat = "identity", position = "dodge") +
  ggtitle("IAT gender-career bias (2005 - 2016 data)") +
  ylab("IAT gender bias (D-score), Males only") +
  xlab("Country") +
  geom_linerange(aes(ymin = ci_lower, ymax = ci_upper),  
                 position = position_dodge(width = .9)) +
  theme_bw() +
  theme(axis.text.x = element_text(angle = 60, hjust = 1),
        legend.position = "none") 

Country x Genders mean differences

country_means_career_diff <- d_clean_frequent %>%
  select(country_name, sex, overall_iat_score) %>%
  group_by(country_name) %>%
  do(tidy(t.test(overall_iat_score ~ sex, .))) %>%
  mutate(type = "country_gender_D_score_diff") %>%
  rename(mean = estimate, 
         ci_lower = conf.low,
         ci_upper = conf.high) %>%
    select(country_name, ci_lower, ci_upper, mean, type)


ggplot(country_means_career_diff, aes(x = reorder(country_name, mean), 
                                 y = mean)) +
  geom_bar(stat = "identity", position = "dodge") +
  ggtitle("IAT gender-career bias (2005 - 2016 data)") +
  ylab("IAT gender bias (F-M difference)") +
  xlab("Country") +
  geom_linerange(aes(ymin = ci_lower, ymax = ci_upper),  
                 position = position_dodge(width = .9)) +
  theme_bw() +
  theme(axis.text.x = element_text(angle = 60, hjust = 1),
        legend.position = "none") 

World map

map_data <- left_join(map_world, country_means_career_diff) %>%
  rename(gender_bias = mean) %>%
  filter(lat > -57, 
         long > -165) 

ggplot(map_data, aes(x = long, y = lat, 
                            group = group, 
                            fill = gender_bias)) + 
  scale_fill_gradient2(midpoint = mean(map_data$gender_bias, na.rm = T), 
                       low = "blue", high = "red") +
  #scale_fill_continuous(low ="white", high = "blue") + 
  geom_polygon(color = "black", size = .1) +
  #geom_polygon() +
  theme_bw()

Europe map

ggplot(map_data, aes(x = long, y = lat, 
                            group = group, 
                            fill = gender_bias)) + 
  scale_fill_gradient2(midpoint = mean(map_data$gender_bias, na.rm = T), low = "blue", high = "red") +
  #scale_fill_continuous(low ="white", high = "blue") + 
  geom_polygon(color = "black", size = .1) +
  #geom_polygon() +
  theme_bw() +
  coord_map(xlim = c(-13, 35),  ylim = c(32, 71))

ratio (within subjects)

country_RT_ratio_career <- d_clean_frequent %>%
  rowwise()%>%
  mutate(ratio_RT = mean(c(Mn_RT_all_7, Mn_RT_all_6))/mean(c(Mn_RT_all_3, Mn_RT_all_4))) %>%
  group_by(country_name) %>%
  multi_boot_standard(col = "ratio_RT")  %>%
  mutate(type = "country_RT_ratio")

mean reaction time overall

country_gender_RT_mean_career <- d_clean_frequent %>%
  mutate(mean_RT = Mn_RT_all_3467) %>%
  group_by(country_name, sex) %>%
  multi_boot_standard(col = "mean_RT")  %>%
  mutate(type = "country_RT_mean")

explict measure of bias in project implict

https://mfr.osf.io/render?url=https://osf.io/thvzf/?action=download%26mode=render

assocareer: ‘How strongly do you associate the following with males and females?

Career’ 1=female 7= male

assofamily: ‘How strongly do you associate the following with males and females?

Family’ 1=female 7= male

country_fam_male_family_gender <- d_clean_frequent %>%
  group_by(country_name, sex) %>%
  multi_boot_standard(col = "assofamily", na.rm = T)  %>%
  mutate(type = "country_fam_male")

country_fam_male_family <- d_clean_frequent %>%
  group_by(country_name) %>%
  multi_boot_standard(col = "assofamily", na.rm = T)  %>%
  mutate(type = "country_fam_male",
         sex = "all")

country_career_male_career_gender <- d_clean_frequent %>%
  group_by(country_name, sex) %>%
  multi_boot_standard(col = "assocareer", na.rm = T)  %>%
  mutate(type = "country_career_male")

country_career_importance_gender <- d_clean_frequent %>%
  group_by(country_name, sex) %>%
  multi_boot_standard(col = "impcareer", na.rm = T)  %>%
  mutate(type = "career_importance")

country_family_importance_gender <- d_clean_frequent %>%
  group_by(country_name, sex) %>%
  multi_boot_standard(col = "impfamily", na.rm = T)  %>%
  mutate(type = "family_importance")

country_actual_duties_gender <- d_clean_frequent %>%
  group_by(country_name, sex) %>%
  multi_boot_standard(col = "actualduties", na.rm = T)  %>%
  mutate(type = "actual_duties")

Write all

all_measures <- bind_rows(list(
             country_means_career, 
             country_means_career_gender, 
             country_means_career_diff, 
             country_gender_RT_mean_career, 
             country_RT_ratio_career,
             country_fam_male_family_gender, 
             country_fam_male_family,
             country_career_male_career_gender,
             country_career_importance_gender,
             country_family_importance_gender,
             country_actual_duties_gender)) %>%
  mutate_if(is.character, as.factor)


# write_csv(all_measures, "IAT_behavior_measures.csv")