## Analysis on subset of data - those who did not say they do all tasks on Prolific (898 observations kept)
####################################################################################################
# 0. Setup
####################################################################################################
# clears the environment
rm(list = ls())
source("0_setup.R") # need to make sure you are in correct directory for this to work
####################################################################################################
# 1. Load functions
####################################################################################################
setwd(functions.folder)
source("1_functions.r")
####################################################################################################
# 2. Read data
####################################################################################################
setwd(data.folder)
df <- read_rds("replication_data_prepped.rds")
setwd(output.folder)
####################################################################################################
# 3. Begin
####################################################################################################
#H2a: Women who apply for a masculine-typed task perform better when GIL is used in the task advertisement than when GM is used instead.
#H2b: Men who apply for a masculine-typed task have the same performance whether GIL or GM is used in the task advertisement.
## Women's performance depending on task advertisement
df_select <- df %>% filter(all!=1)
results_perf_ad <- func.performance_advertisement(df_select)
results_perf_ad$p.value
## Men's performance depending on task advertisement
results_perf_ad_men <- func.performance_advertisement_men(df_select)
results_perf_ad_men$p.value
# Get sample size
n_women <- table(df_select$woman)[2]
n_men <- table(df_select$woman)[1]
### Overall results - advertisement
women <- func.extract_results_ttest (results_perf_ad, n_women, "Women")
men <- func.extract_results_ttest(results_perf_ad_men, n_men, "Men")
results_table_ad <- as.data.frame(rbind(women, men))
results_table_ad <- results_table_ad %>%
mutate(across(c(`mean of x`, `mean of y`, t, df,  V6, V7, V8, V9), as.numeric))
results_table_ad <- results_table_ad %>%
mutate(across(c(`mean of x`, `mean of y`, t, df,  V6, V7, V8, V9), round,2))
names(results_table_ad)[names(results_table_ad) == "mean of x"] <- "GM"
names(results_table_ad)[names(results_table_ad) == "mean of y"] <- "GIL"
names(results_table_ad)[names(results_table_ad) == "V7"] <- "lower CI"
names(results_table_ad)[names(results_table_ad) == "V8"] <- "upper CI"
names(results_table_ad)[names(results_table_ad) == "V9"] <- "SE"
names(results_table_ad)[names(results_table_ad) == "V1"] <- "Group"
names(results_table_ad)[names(results_table_ad) == "1"] <- "n"
# calculate difference
results_table_ad$Difference <- results_table_ad$GIL-results_table_ad$GM
# add significance stars
results_table_ad <- results_table_ad %>%
mutate(V6 = case_when(
V6 <= 0.001 ~ paste0(V6,"***"),
V6 <= 0.01  ~ paste0(V6,"**"),
V6 <= 0.05  ~ paste0(V6,"*"),
V6 <= 0.10  ~ paste0(V6,"+"),
TRUE             ~ paste0(V6,"")
))
names(results_table_ad)[names(results_table_ad) == "V6"] <- "p value"
# Generate latex table
results_table_ad <- kbl(results_table_ad,
row.names = F,
booktabs = T,
linesep = "",
"latex",
caption = "Mean performance after seeing either a GIL or GM advertisement (subset of data)",
label = "performance_ad_not_all") %>%
kable_styling(latex_options = c("hold_position", "scale_down"))
# save
writeLines(results_table_ad, "tables/performance_ad_all_takers_removed.tex")
setwd(functions.folder)
# Project: The equalising potential of language
# Date: 13.01.2025
# Paper authors: Anica Waldendorf, Klarita Gërxhani, Arnout van de Rijt
# Code author: Anica Waldendorf
## Analysis on subset of data - those who did not say they do all tasks on Prolific (898 observations kept)
####################################################################################################
# 0. Setup
####################################################################################################
# clears the environment
rm(list = ls())
source("0_setup.R") # need to make sure you are in correct directory for this to work
####################################################################################################
# 1. Load functions
####################################################################################################
setwd(functions.folder)
source("1_functions.r")
####################################################################################################
# 2. Read data
####################################################################################################
setwd(data.folder)
df <- read_rds("replication_data_prepped.rds")
setwd(output.folder)
####################################################################################################
# 3. Begin
####################################################################################################
#H3a: Women who apply for a masculine-typed task perform better when GIL is used in the task description than when GM is used instead.
#H3b: Men who apply for a masculine-typed task have the same performance whether GIL or GM is used in the task description.
# Remove participants who said they take all tasks on Prolific
df_select <- df %>% filter(all!=1)
## Women's performance depending on task description
results_perf_des <- func.performance_description(df_select)
results_perf_des$p.value
## Men's performance depending on task description
results_perf_des_men <- func.performance_description_men(df_select)
results_perf_des_men$p.value
# Get sample size
n_women <- table(df_select$woman)[2]
n_men <- table(df_select$woman)[1]
### Overall results - description
women <- func.extract_results_ttest (results_perf_des, n_women, "Women")
men <- func.extract_results_ttest(results_perf_des_men, n_men, "Men")
results_table_des <- as.data.frame(rbind(women, men))
results_table_des <- results_table_des %>%
mutate(across(c(`mean of x`, `mean of y`, t, df,  V6, V7, V8, V9), as.numeric))
results_table_des <- results_table_des %>%
mutate(across(c(`mean of x`, `mean of y`, t, df,  V6, V7, V8, V9), round,2))
names(results_table_des)[names(results_table_des) == "mean of x"] <- "GM"
names(results_table_des)[names(results_table_des) == "mean of y"] <- "GIL"
names(results_table_des)[names(results_table_des) == "V7"] <- "lower CI"
names(results_table_des)[names(results_table_des) == "V8"] <- "upper CI"
names(results_table_des)[names(results_table_des) == "V9"] <- "SE"
names(results_table_des)[names(results_table_des) == "V1"] <- "Group"
names(results_table_des)[names(results_table_des) == "1"] <- "n"
# calculate difference
results_table_des$Difference <- results_table_des$GIL-results_table_des$GM
# add significance stars
results_table_des <- results_table_des %>%
mutate(V6 = case_when(
V6 <= 0.001 ~ paste0(V6,"***"),
V6 <= 0.01  ~ paste0(V6,"**"),
V6 <= 0.05  ~ paste0(V6,"*"),
V6 <= 0.10  ~ paste0(V6,"+"),
TRUE             ~ paste0(V6,"")
))
names(results_table_des)[names(results_table_des) == "V6"] <- "p value"
# Generate latex table
results_table_des <- kbl(results_table_des,
row.names = F,
booktabs = T,
linesep = "",
"latex",
caption = "Mean performance after seeing either a GIL or GM task description (subset of data)",
label = "performance_des_not_all") %>%
kable_styling(latex_options = c("hold_position", "scale_down"))
# save
writeLines(results_table_des, "tables/performance_des_all_takers_removed.tex")
setwd(functions.folder)
# Project: The equalising potential of language
# Date: 13.01.2025
# Paper authors: Anica Waldendorf, Klarita Gërxhani, Arnout van de Rijt
# Code author: Anica Waldendorf
## Analysis on subset of data - those who did not say they do all tasks on Prolific (915 observations kept)
## statistical testing based on those who did not do everything or for money
####################################################################################################
# 0. Setup
####################################################################################################
# clears the environment
rm(list = ls())
source("0_setup.R") # need to make sure you are in correct directory for this to work
####################################################################################################
# 1. Load functions
####################################################################################################
setwd(functions.folder)
source("1_functions.r")
####################################################################################################
# 2. Read data
####################################################################################################
setwd(data.folder)
df <- read_rds("replication_data_prepped.rds")
setwd(output.folder)
####################################################################################################
# 3. Begin
####################################################################################################
df_select <- df %>% filter(money!=1)
share <- func.share_advertisement(df_select)
share$p.value
n_all <- nrow(df_select)
### Overall results - share
overall <- c(share$estimate[1],share$estimate[2], share$statistic, share$parameter, share$p.value, n_all )
results_table <- as.data.frame(rbind(overall))
results_table <- results_table %>%
mutate(across(c(`prop 1`, `prop 2`, `X-squared`, df,  V5), as.numeric))
results_table <- results_table %>%
mutate(across(c(`prop 1`, `prop 2`, `X-squared`, df,  V5), round,4))
names(results_table)[names(results_table) == "prop 1"] <- "GM"
names(results_table)[names(results_table) == "prop 2"] <- "GIL"
names(results_table)[names(results_table) == "V5"] <- "p value"
names(results_table)[names(results_table) == "V1"] <- "Group"
names(results_table)[names(results_table) == "V6"] <- "n"
# Have percentage instead of decimal
results_table$GIL <- results_table$GIL*100
results_table$GM <- results_table$GM*100
# calculate difference
results_table$Difference <- results_table$GIL-results_table$GM
# generate latex output
results_table <- kbl(results_table,
row.names = F,
booktabs = T,
linesep = "",
"latex",
caption = "Share of women participating in the task after seeing either a GIL or GM advertisement (subset of data)",
label = "share_not_money") %>%
kable_styling(latex_options = c("hold_position", "scale_down"))
# save
writeLines(results_table, "tables/share_money_removed.tex")
setwd(functions.folder)
# Project: The equalising potential of language
# Date: 13.01.2025
# Paper authors: Anica Waldendorf, Klarita Gërxhani, Arnout van de Rijt
# Code author: Anica Waldendorf
## Analysis on subset of data - those who did not say they do all tasks on Prolific (915 observations kept)
## statistical testing based on those who did not do everything or for money
####################################################################################################
# 0. Setup
####################################################################################################
# clears the environment
rm(list = ls())
source("0_setup.R") # need to make sure you are in correct directory for this to work
####################################################################################################
# 1. Load functions
####################################################################################################
setwd(functions.folder)
source("1_functions.r")
####################################################################################################
# 2. Read data
####################################################################################################
setwd(data.folder)
df <- read_rds("replication_data_prepped.rds")
setwd(output.folder)
####################################################################################################
# 3. Begin
####################################################################################################
#H2a: Women who apply for a masculine-typed task perform better when GIL is used in the task advertisement than when GM is used instead.
#H2b: Men who apply for a masculine-typed task have the same performance whether GIL or GM is used in the task advertisement.
## Women's performance depending on task advertisement
df_select <- df %>% filter(money!=1)
results_perf_ad <- func.performance_advertisement(df_select)
results_perf_ad$p.value
## Men's performance depending on task advertisement
results_perf_ad_men <- func.performance_advertisement_men(df_select)
results_perf_ad_men$p.value
# Get sample size
n_women <- table(df_select$woman)[2]
n_men <- table(df_select$woman)[1]
### Overall results - advertisement
women <- func.extract_results_ttest (results_perf_ad, n_women, "Women")
men <- func.extract_results_ttest(results_perf_ad_men, n_men, "Men")
results_table_ad <- as.data.frame(rbind(women, men))
results_table_ad <- results_table_ad %>%
mutate(across(c(`mean of x`, `mean of y`, t, df,  V6, V7, V8, V9), as.numeric))
results_table_ad <- results_table_ad %>%
mutate(across(c(`mean of x`, `mean of y`, t, df,  V6, V7, V8, V9), round,2))
names(results_table_ad)[names(results_table_ad) == "mean of x"] <- "GM"
names(results_table_ad)[names(results_table_ad) == "mean of y"] <- "GIL"
names(results_table_ad)[names(results_table_ad) == "V7"] <- "lower CI"
names(results_table_ad)[names(results_table_ad) == "V8"] <- "upper CI"
names(results_table_ad)[names(results_table_ad) == "V9"] <- "SE"
names(results_table_ad)[names(results_table_ad) == "V1"] <- "Group"
names(results_table_ad)[names(results_table_ad) == "1"] <- "n"
# calculate difference
results_table_ad$Difference <- results_table_ad$GIL-results_table_ad$GM
# add significance stars
results_table_ad <- results_table_ad %>%
mutate(V6 = case_when(
V6 <= 0.001 ~ paste0(V6,"***"),
V6 <= 0.01  ~ paste0(V6,"**"),
V6 <= 0.05  ~ paste0(V6,"*"),
V6 <= 0.10  ~ paste0(V6,"+"),
TRUE             ~ paste0(V6,"")
))
names(results_table_ad)[names(results_table_ad) == "V6"] <- "p value"
# Generate latex table
results_table_ad <- kbl(results_table_ad,
row.names = F,
booktabs = T,
linesep = "",
"latex",
caption = "Mean performance after seeing either a GIL or GM advertisement (subset of data)",
label = "performance_ad_not_money") %>%
kable_styling(latex_options = c("hold_position", "scale_down"))
# save
writeLines(results_table_ad, "tables/performance_ad_money_removed.tex")
setwd(functions.folder)
# Project: The equalising potential of language
# Date: 13.01.2025
# Paper authors: Anica Waldendorf, Klarita Gërxhani, Arnout van de Rijt
# Code author: Anica Waldendorf
## Analysis on subset of data - those who did not say they do all tasks on Prolific (915 observations kept)
## statistical testing based on those who did not do everything or for money
####################################################################################################
# 0. Setup
####################################################################################################
# clears the environment
rm(list = ls())
source("0_setup.R") # need to make sure you are in correct directory for this to work
####################################################################################################
# 1. Load functions
####################################################################################################
setwd(functions.folder)
source("1_functions.r")
####################################################################################################
# 2. Read data
####################################################################################################
setwd(data.folder)
df <- read_rds("replication_data_prepped.rds")
setwd(output.folder)
####################################################################################################
# 3. Begin
####################################################################################################
#H2a: Women who apply for a masculine-typed task perform better when GIL is used in the task advertisement than when GM is used instead.
#H2b: Men who apply for a masculine-typed task have the same performance whether GIL or GM is used in the task advertisement.
## Women's performance depending on task advertisement
df_select <- df %>% filter(money!=1)
results_perf_ad <- func.performance_advertisement(df_select)
results_perf_ad$p.value
## Men's performance depending on task advertisement
results_perf_ad_men <- func.performance_advertisement_men(df_select)
results_perf_ad_men$p.value
# Get sample size
n_women <- table(df_select$woman)[2]
n_men <- table(df_select$woman)[1]
### Overall results - advertisement
women <- func.extract_results_ttest (results_perf_ad, n_women, "Women")
men <- func.extract_results_ttest(results_perf_ad_men, n_men, "Men")
results_table_ad <- as.data.frame(rbind(women, men))
results_table_ad <- results_table_ad %>%
mutate(across(c(`mean of x`, `mean of y`, t, df,  V6, V7, V8, V9), as.numeric))
results_table_ad <- results_table_ad %>%
mutate(across(c(`mean of x`, `mean of y`, t, df,  V6, V7, V8, V9), round,2))
names(results_table_ad)[names(results_table_ad) == "mean of x"] <- "GM"
names(results_table_ad)[names(results_table_ad) == "mean of y"] <- "GIL"
names(results_table_ad)[names(results_table_ad) == "V7"] <- "lower CI"
names(results_table_ad)[names(results_table_ad) == "V8"] <- "upper CI"
names(results_table_ad)[names(results_table_ad) == "V9"] <- "SE"
names(results_table_ad)[names(results_table_ad) == "V1"] <- "Group"
names(results_table_ad)[names(results_table_ad) == "1"] <- "n"
# calculate difference
results_table_ad$Difference <- results_table_ad$GIL-results_table_ad$GM
# add significance stars
results_table_ad <- results_table_ad %>%
mutate(V6 = case_when(
V6 <= 0.001 ~ paste0(V6,"***"),
V6 <= 0.01  ~ paste0(V6,"**"),
V6 <= 0.05  ~ paste0(V6,"*"),
V6 <= 0.10  ~ paste0(V6,"+"),
TRUE             ~ paste0(V6,"")
))
names(results_table_ad)[names(results_table_ad) == "V6"] <- "p value"
# Generate latex table
results_table_ad <- kbl(results_table_ad,
row.names = F,
booktabs = T,
linesep = "",
"latex",
caption = "Mean performance after seeing either a GIL or GM advertisement (subset of data)",
label = "performance_ad_not_money") %>%
kable_styling(latex_options = c("hold_position", "scale_down"))
# save
writeLines(results_table_ad, "tables/performance_ad_money_removed.tex")
setwd(functions.folder)
# Project: The equalising potential of language
# Date: 13.01.2025
# Paper authors: Anica Waldendorf, Klarita Gërxhani, Arnout van de Rijt
# Code author: Anica Waldendorf
## Create table with descrtiptive variables by country and task advertisement
####################################################################################################
# 0. Setup
####################################################################################################
# clears the environment
rm(list = ls())
source("0_setup.R") # need to make sure you are in correct directory for this to work
####################################################################################################
# 1. Load functions
####################################################################################################
setwd(functions.folder)
source("1_functions.r")
####################################################################################################
# 2. Read data
####################################################################################################
setwd(data.folder)
df <- read_rds("replication_data_prepped.rds")
setwd(output.folder)
####################################################################################################
# 3. Begin
####################################################################################################
df$female <- df$woman
class(df$education)
df$education <- as.numeric(df$education)
## By country and advertisement treatment
country_ad_des <- df %>%
group_by(country, treatment_ad) %>%
summarise(Female = round(mean(df$female, na.rm=TRUE),2),
age = round(mean(age, na.rm=TRUE),2),
education = round(mean(education, na.rm=TRUE),2),
political_orientation = round(mean(pol_1, na.rm=TRUE),2),
gender_identity = round(mean(identity_index, na.rm=TRUE),2),
use = round(mean(use_dummy, na.rm = TRUE),2),
attitude = round(mean(attitude_1, na.rm=TRUE),2),
interest = round(mean(interest_1, na.rm=TRUE),2),
n = n())
country_ad_des_t <- as_tibble(cbind(nms = names(country_ad_des), t(country_ad_des)))
# give full name to variable (rows)
country_ad_des_t$nms[country_ad_des_t$nms == 'Female'] <- 'Female (0 = male, 1 = female)'
country_ad_des_t$nms[country_ad_des_t$nms == 'education'] <- 'Education (1 = low, 3 = high)'
country_ad_des_t$nms[country_ad_des_t$nms == 'age'] <- 'Age (years)'
country_ad_des_t$nms[country_ad_des_t$nms == 'political_orientation'] <- 'Political orientation (1 = left, 7 = right)'
country_ad_des_t$nms[country_ad_des_t$nms == 'gender_identity'] <- 'Gender identity (1 = weak, 7 = strong) '
country_ad_des_t$nms[country_ad_des_t$nms == 'use'] <- 'Use of GIL (0 = no, 1 = yes)'
country_ad_des_t$nms[country_ad_des_t$nms == 'attitude'] <- 'Attitude towards GIL (1 = very positive, 7 = very negative)'
country_ad_des_t$nms[country_ad_des_t$nms == 'interest'] <- 'Interest in gender issues (1 = not at all; 7 = very much)'
country_ad_des_t$nms[country_ad_des_t$nms == 'treatment_ad'] <- 'Advertisement'
# rename variables (columns)
names(country_ad_des_t)[names(country_ad_des_t) == "nms"] <- "Variable"
names(country_ad_des_t)[names(country_ad_des_t) == "V2"] <- "GIL"
names(country_ad_des_t)[names(country_ad_des_t) == "V3"] <- "GM"
names(country_ad_des_t)[names(country_ad_des_t) == "V4"] <- "GIL"
names(country_ad_des_t)[names(country_ad_des_t) == "V5"] <- "GM"
# remove row with treatment split
country_ad_des_t <- country_ad_des_t[-1,]
# Generate latex table
results_table_ad <- kbl(country_ad_des_t,
row.names = F,
booktabs = T,
linesep = "",
"latex",
caption = "Means of descriptive variables by country and task advertisement",
label = "share_country_split") %>%
kable_styling(latex_options = c("hold_position", "scale_down"))
# save
writeLines(results_table_ad, "tables/country_split_table2_RR.tex")
setwd(functions.folder)
# Project: The equalising potential of language
# Date: 13.01.2025
# Paper authors: Anica Waldendorf, Klarita Gërxhani, Arnout van de Rijt
# Code author: Anica Waldendorf
## Analysis on subset of data - those who did not say they do all tasks on Prolific (915 observations kept)
## statistical testing based on those who did not do everything or for money
## Performance effect of task description
####################################################################################################
# 0. Setup
####################################################################################################
# clears the environment
rm(list = ls())
source("0_setup.R") # need to make sure you are in correct directory for this to work
####################################################################################################
# 1. Load functions
####################################################################################################
setwd(functions.folder)
source("1_functions.r")
####################################################################################################
# 2. Read data
####################################################################################################
setwd(data.folder)
df <- read_rds("replication_data_prepped.rds")
setwd(output.folder)
####################################################################################################
# 3. Begin
####################################################################################################
#H3a: Women who apply for a masculine-typed task perform better when GIL is used in the task description than when GM is used instead.
#H3b: Men who apply for a masculine-typed task have the same performance whether GIL or GM is used in the task description.
# Filter dataset
df_select <- df %>% filter(money!=1)
## Women's performance depending on task description
results_perf_des <- func.performance_description(df_select)
results_perf_des$p.value
## Men's performance depending on task description
results_perf_des_men <- func.performance_description_men(df_select)
results_perf_des_men$p.value
# Get sample size
n_women <- table(df_select$woman)[2]
n_men <- table(df_select$woman)[1]
### Overall results - description
women <- func.extract_results_ttest (results_perf_des, n_women, "Women")
men <- func.extract_results_ttest(results_perf_des_men, n_men, "Men")
results_table_des <- as.data.frame(rbind(women, men))
results_table_des <- results_table_des %>%
mutate(across(c(`mean of x`, `mean of y`, t, df,  V6, V7, V8, V9), as.numeric))
results_table_des <- results_table_des %>%
mutate(across(c(`mean of x`, `mean of y`, t, df,  V6, V7, V8, V9), round,2))
names(results_table_des)[names(results_table_des) == "mean of x"] <- "GM"
names(results_table_des)[names(results_table_des) == "mean of y"] <- "GIL"
names(results_table_des)[names(results_table_des) == "V7"] <- "lower CI"
names(results_table_des)[names(results_table_des) == "V8"] <- "upper CI"
names(results_table_des)[names(results_table_des) == "V9"] <- "SE"
names(results_table_des)[names(results_table_des) == "V1"] <- "Group"
names(results_table_des)[names(results_table_des) == "1"] <- "n"
# calculate difference
results_table_des$Difference <- results_table_des$GIL-results_table_des$GM
# add significance stars
results_table_des <- results_table_des %>%
mutate(V6 = case_when(
V6 <= 0.001 ~ paste0(V6,"***"),
V6 <= 0.01  ~ paste0(V6,"**"),
V6 <= 0.05  ~ paste0(V6,"*"),
V6 <= 0.10  ~ paste0(V6,"+"),
TRUE             ~ paste0(V6,"")
))
names(results_table_des)[names(results_table_des) == "V6"] <- "p value"
# Generate latex table
results_table_des <- kbl(results_table_des,
row.names = F,
booktabs = T,
linesep = "",
"latex",
caption = "Mean performance after seeing either a GIL or GM task description (subset of data)",
label = "performance_des_not_money") %>%
kable_styling(latex_options = c("hold_position", "scale_down"))
# save
writeLines(results_table_des, "tables/performance_des_money_removed.tex")
setwd(functions.folder)
