shhh <- function(expr) suppressPackageStartupMessages(suppressWarnings(suppressMessages(expr))) shhh({ library(tidyverse) # Tables: library(gt) library(gtsummary) }) options(repr.plot.width = 15, repr.plot.height = 10) # Suppress summarise info options(dplyr.summarise.inform = FALSE) # load in mobile read as wiki edit attempt data edit_attempts_mobile <- read.csv( file = 'Data/edit_attempts_mobile.csv', header = TRUE, sep = ",", stringsAsFactors = FALSE ) #reformat and clean data edit_attempts_mobile$date <- as.Date(edit_attempts_mobile$date, format = "%Y-%m-%d") #clarfiy wiki names edit_attempts_mobile <- edit_attempts_mobile %>% mutate( wiki = case_when( #clarfiy participating project names wiki == 'azwiki' ~ "Azerbaijani Wikipedia", wiki == 'dewiki' ~ "German Wikipedia", wiki == 'eswiki' ~ "Spanish Wikipedia", wiki == 'fawiki' ~ 'Persian Wikipedia', wiki == 'hiwiki' ~ 'Hindi Wikipedia', wiki == 'idwiki' ~ 'Indonesian Wikipedia', wiki == 'itwiki' ~ 'Italian Wikipedia', wiki == 'nlwiki' ~ 'Dutch Wikipedia', wiki == 'plwiki' ~ 'Polish Wikipedia', wiki == 'ptwiki' ~ 'Portuguese Wikipedia', wiki == 'rowiki' ~ 'Romanian Wikipedia', wiki == 'ruwiki' ~ 'Russian Wikipedia', wiki == 'thwiki' ~ 'Thai Wikipedia', wiki == 'trwiki' ~ 'Turkish Wikipedia', wiki == 'ukwiki' ~ 'Ukrainian Wikipedia', ) ) #set factor levels edit_attempts_mobile$workflow <- factor( edit_attempts_mobile$workflow, levels = c( "reply_tool","new_topic_tool", "page"), ) edit_attempts_mobile$experiment_group <- factor( edit_attempts_mobile$experiment_group, levels = c( "control","test"), labels = c( "Read as wiki view (control)","DT-enhanced view (test)") ) #set factor levels edit_attempts_mobile$editor_experience <- factor( edit_attempts_mobile$editor_experience, levels = c( "0 edits","1-4 edits", "5-99 edits", "100-999 edits", "1000+"), labels = c( "0 edits","1-4 edits", "5-99 edits", "100-999 edits", "1000+ edits"), ) # load in mobile frontend overlay edit attempt data ## reply replies_mobilefrontend <- read.csv( file = 'Data/replies_mobilefrontend.csv', header = TRUE, sep = ",", stringsAsFactors = FALSE ) ##newtopic newtopic_mobilefrontend <- read.csv( file = 'Data/newtopic_mobilefrontend.csv', header = TRUE, sep = ",", stringsAsFactors = FALSE ) # combine data edit_attempts_mobilefrontend <- rbind(replies_mobilefrontend, newtopic_mobilefrontend) #reformat and clean data edit_attempts_mobilefrontend$date <- as.Date(edit_attempts_mobilefrontend$date, format = "%Y-%m-%d") #clarfiy wiki names edit_attempts_mobilefrontend <- edit_attempts_mobilefrontend %>% mutate( wiki = case_when( #clarfiy participating project names wiki == 'azwiki' ~ "Azerbaijani Wikipedia", wiki == 'dewiki' ~ "German Wikipedia", wiki == 'eswiki' ~ "Spanish Wikipedia", wiki == 'fawiki' ~ 'Persian Wikipedia', wiki == 'hiwiki' ~ 'Hindi Wikipedia', wiki == 'idwiki' ~ 'Indonesian Wikipedia', wiki == 'itwiki' ~ 'Italian Wikipedia', wiki == 'nlwiki' ~ 'Dutch Wikipedia', wiki == 'plwiki' ~ 'Polish Wikipedia', wiki == 'ptwiki' ~ 'Portuguese Wikipedia', wiki == 'rowiki' ~ 'Romanian Wikipedia', wiki == 'ruwiki' ~ 'Russian Wikipedia', wiki == 'thwiki' ~ 'Thai Wikipedia', wiki == 'trwiki' ~ 'Turkish Wikipedia', wiki == 'ukwiki' ~ 'Ukrainian Wikipedia', ), view = 'MobileFrontend overlay (control)' #add column to specific view ) #set factor levels edit_attempts_mobilefrontend$workflow <- factor( edit_attempts_mobilefrontend$workflow, levels = c("talkpage.focus-comment", "talkpage.add-topic"), labels = c("replying workflow", "new topic workflow") ) edit_attempts_mobilefrontend["save_clicks"][is.na(edit_attempts_mobilefrontend["save_clicks"])] <- 0 edit_attempts_mobilefrontend$save_clicks <- as.integer(edit_attempts_mobilefrontend$save_clicks) # show overall edit attempts per group edit_attempts_overall <- edit_attempts_mobile %>% filter(is_anon == 'False', is_oversample == 'False') %>% # double checking there are no oversampled events group_by(experiment_group) %>% summarise(n_edit_attempts = n_distinct(edit_attempt_id), n_saves = n_distinct(edit_attempt_id[edit_success == 1])) # show overall edit attempts and users per group # Note: The mobile frontend overlay was disabled in the test group # so all these events can be assumed to be from the control group. edit_attempts_overlay_overall <- edit_attempts_mobilefrontend %>% summarise(n_edit_attempts = sum(init_clicks), n_saves = sum(save_clicks)) %>% mutate(experiment_group = 'MobileFrontend overlay (control)') %>% relocate(experiment_group) %>% head() edit_attempts_all <- rbind(edit_attempts_overlay_overall, edit_attempts_overall) edit_attempts_all # edit revert rate edit_reverts_overall <- edit_attempts_mobile %>% filter(is_anon == 'False', edit_success == 1) %>% # only published edits group_by(experiment_group) %>% summarise(n_saves = n_distinct(edit_attempt_id), n_reverts = n_distinct(edit_attempt_id[edit_reverted ==1 ]), pct_reverted = paste0(round(n_reverts/n_saves * 100, 2), '%')) edit_reverts_overall edit_reverts_daily <- edit_attempts_mobile %>% filter(is_anon == 'False', edit_success == 1) %>% # only published edits group_by(date, experiment_group) %>% summarise(n_saves = n_distinct(edit_attempt_id), n_reverts = n_distinct(edit_attempt_id[edit_reverted ==1 ]), pct_reverted = n_reverts/n_saves) p <- edit_reverts_daily %>% ggplot(aes(x= date, y = pct_reverted , color = experiment_group)) + geom_line(size =1.5) + scale_y_continuous(labels = scales::percent) + scale_x_date("Date", date_breaks = "2 days", date_labels = "%b-%d") + scale_color_manual(values= c("#999999", "steelblue2")) + labs(title = "Daily revert rate by experiment group", y = "percent of edits reverted", x= "Date") + theme( panel.grid.minor = element_blank(), panel.background = element_blank(), plot.title = element_text(hjust = 0.5), text = element_text(size=18), legend.position="bottom", axis.line = element_line(colour = "black")) ggsave("Figures/edit_reverts_daily.png", p, width = 16, height = 8, units = "in", dpi = 300) p # edit revert rate edit_reverts_byworkflow <- edit_attempts_mobile %>% filter(is_anon == 'False', edit_success == 1) %>% # only published edits group_by(experiment_group, workflow) %>% summarise(n_saves = n_distinct(edit_attempt_id), n_reverts = n_distinct(edit_attempt_id[edit_reverted ==1 ]), pct_reverted = round(n_reverts/n_saves,2)) options(repr.plot.width = 18, repr.plot.height = 8) p <- edit_reverts_byworkflow %>% ggplot(aes(x= workflow, y = pct_reverted, fill = experiment_group)) + geom_col(position = position_dodge2(preserve = "single")) + geom_text(aes(label = paste(pct_reverted * 100, "%"), fontface=2), vjust=1.5, size = 7, color = "white", position = position_dodge(0.9)) + #facet_wrap(~ experiment_group) + scale_y_continuous(labels = scales::percent) + labs (y = "Percent of edits reverted ", title = "Revert rate by editing workflow", caption = "Defined as percent of all mobile talk page edits reverted within 48 hours") + scale_fill_manual(values= c( "#999999", "steelblue2"), name = "Experiment Group" ) + theme( panel.grid.minor = element_blank(), panel.background = element_blank(), plot.title = element_text(hjust = 0.5), text = element_text(size=20), legend.position="right", axis.line = element_line(colour = "black")) p ggsave("Figures/edit_reverts_byworkflow.png", p, width = 16, height = 8, units = "in", dpi = 300) # edit revert rate by anon edit_reverts_byexp <- edit_attempts_mobile %>% filter(is_anon == 'False', edit_success == 1) %>% # only published edits group_by(editor_experience, experiment_group) %>% summarise(n_saves = n_distinct(edit_attempt_id), n_reverts = n_distinct(edit_attempt_id[edit_reverted ==1 ]), pct_reverted = round(n_reverts/n_saves, 2)) # Plot revert rates for each exp group p <- edit_reverts_byexp %>% ggplot(aes(x= experiment_group, y = pct_reverted, fill = experiment_group)) + geom_col(position = 'dodge') + geom_text(aes(label = paste(pct_reverted * 100, "%"), fontface=2), vjust=1.2, size = 5, color = "white") + facet_wrap(~ editor_experience) + scale_y_continuous(labels = scales::percent) + labs (y = "Percent of edits reverted ", title = "Revert rate by user experience", caption = "Defined as percent of all mobile talk page edits reverted within 48 hours") + scale_fill_manual(values= c("#999999", "steelblue2"), name = "Experiment Group") + theme( panel.grid.minor = element_blank(), panel.background = element_blank(), plot.title = element_text(hjust = 0.5), text = element_text(size=16), legend.position="bottom", axis.text.x = element_blank(), axis.title.x=element_blank(), axis.line = element_line(colour = "black")) p ggsave("Figures/edit_reverts_byexp.png", p, width = 16, height = 8, units = "in", dpi = 300) # edit reverts by wiki edit_reverts_bywiki<- edit_attempts_mobile %>% filter(is_anon == 'False', edit_success == 1) %>% # only published edits group_by(wiki, experiment_group) %>% summarise(n_saves = n_distinct(edit_attempt_id), n_reverts = n_distinct(edit_attempt_id[edit_reverted ==1 ]), pct_reverted = round(n_reverts/n_saves, 2), .groups = 'drop') # Plot revert rates for each wiki p <- edit_reverts_bywiki %>% filter(!(wiki %in% c('Romanian Wikipedia', 'Dutch Wikipedia'))) %>% # remove wikis where no reverts logged ggplot(aes(x= experiment_group, y = pct_reverted, fill = experiment_group)) + geom_col(position = 'dodge') + geom_text(aes(label = paste(pct_reverted * 100,"%"), fontface=2), vjust=1.2, size = 5, color = "white") + facet_wrap(~ wiki) + scale_y_continuous(labels = scales::percent_format(accuracy=1)) + labs (y = "Percent of edits reverted ", title = "Revert rate by participating Wikipedia", caption = "Romanian and Dutch Wikipedia did not have any reverted edits during the reviewed timeframe") + scale_fill_manual(values= c("#999999", "steelblue2"), name = "Experiment Group") + theme( panel.grid.minor = element_blank(), panel.background = element_blank(), plot.title = element_text(hjust = 0.5), text = element_text(size=16), legend.position="bottom", axis.text.x = element_blank(), axis.title.x=element_blank(), axis.line = element_line(colour = "black")) p ggsave("Figures/edit_reverts_bywiki.png", p, width = 16, height = 8, units = "in", dpi = 300) # edit completion rate edit_completes_overall <- edit_attempts_mobile %>% filter(is_anon == 'False') %>% group_by(experiment_group) %>% summarise(n_attempts = n_distinct(edit_attempt_id), n_published = n_distinct(edit_attempt_id[edit_success ==1 ]), pct_completed = paste0(round(n_published/n_attempts * 100, 2), "%")) edit_completes_overall edit_completes_daily <- edit_attempts_mobile %>% filter(is_anon == 'False') %>% group_by(date, experiment_group) %>% summarise(n_attempts = n_distinct(edit_attempt_id), n_published = n_distinct(edit_attempt_id[edit_success ==1]), pct_completed = n_published/n_attempts) p <- edit_completes_daily %>% ggplot(aes(x= date, y = pct_completed , color = experiment_group)) + geom_line(size =1.5) + scale_y_continuous(labels = scales::percent) + scale_x_date("Date", date_breaks = "2 days", date_labels = "%b-%d") + scale_color_manual(values= c("#999999", "steelblue2")) + labs(title = "Daily edit completion rate by experiment group", subtitle = "DT-Enhanced (test) vs Read as Wiki View (control)", y = "percent of edits completed", x= "Date") + theme( panel.grid.minor = element_blank(), panel.background = element_blank(), plot.title = element_text(hjust = 0.5), text = element_text(size=18), legend.position="bottom", axis.line = element_line(colour = "black")) ggsave("Figures/edit_completes_daily.png", p, width = 16, height = 8, units = "in", dpi = 300) p # edit completion rate edit_completes_byintegration <- edit_attempts_mobile %>% filter(is_anon == 'False') %>% group_by(experiment_group, workflow) %>% summarise(n_attempts = n_distinct(edit_attempt_id), n_published = n_distinct(edit_attempt_id[edit_success ==1 ]), pct_completed = round(n_published/n_attempts, 2)) options(repr.plot.width = 18, repr.plot.height = 8) p <- edit_completes_byintegration %>% ggplot(aes(x= workflow, y = pct_completed, fill = experiment_group)) + geom_col(position = position_dodge2(preserve = "single")) + geom_text(aes(label = paste(pct_completed * 100, "%"), fontface=2), vjust=1.5, size = 7, color = "white", position = position_dodge(0.9)) + #facet_wrap(~ experiment_group) + scale_y_continuous(labels = scales::percent) + labs (y = "Percent of edits completed ", title = "Edit completion rate by editing workflow", subtitle = "DT-Enhanced (test) vs Read as Wiki View (control)", caption = "Defined as the proportion of edits initiated that are saved") + scale_fill_manual(values= c( "#999999", "steelblue2"), name = "Experiment Group" ) + theme( panel.grid.minor = element_blank(), panel.background = element_blank(), plot.title = element_text(hjust = 0.5), text = element_text(size=20), legend.position="right", axis.line = element_line(colour = "black")) p ggsave("Figures/edit_completes_byintegration.png", p, width = 16, height = 8, units = "in", dpi = 300) # edit completion rate edit_completes_byexp <- edit_attempts_mobile %>% group_by(editor_experience, experiment_group) %>% summarise(n_attempts = n_distinct(edit_attempt_id), n_published = n_distinct(edit_attempt_id[edit_success ==1 ]), pct_completed = round(n_published/n_attempts, 2)) # Plot edit completion rate for each wiki options(repr.plot.width = 15, repr.plot.height = 10) p <- edit_completes_byexp %>% ggplot(aes(x= experiment_group, y = pct_completed, fill = experiment_group)) + geom_col(position = 'dodge') + geom_text(aes(label = paste(pct_completed * 100, "%"), fontface=2), vjust=1.2, size = 5, color = "white") + facet_wrap(~ editor_experience) + scale_y_continuous(labels = scales::percent) + labs (y = "Percent of edits completed ", title = "Edit completion rate by user experience", subtitle = "DT-Enhanced (test) vs Read as Wiki View (control)", caption = "Defined as the proportion of edits initiated that are saved") + scale_fill_manual(values= c("#999999", "steelblue2"), name = "Experiment Group") + theme( panel.grid.minor = element_blank(), panel.background = element_blank(), plot.title = element_text(hjust = 0.5), text = element_text(size=16), legend.position="bottom", axis.text.x = element_blank(), axis.title.x=element_blank(), axis.line = element_line(colour = "black")) p ggsave("Figures/edit_completes_byexp.png", p, width = 16, height = 8, units = "in", dpi = 300) # edit completion rate by wiki edit_completes_bywiki <- edit_attempts_mobile %>% filter(is_anon == 'False') %>% group_by(wiki, experiment_group) %>% summarise(n_attempts = n_distinct(edit_attempt_id), n_published = n_distinct(edit_attempt_id[edit_success ==1 ]), pct_completed = round(n_published/n_attempts, 2)) # Plot edit completion rates for each wiki p <- edit_completes_bywiki %>% ggplot(aes(x= experiment_group, y = pct_completed, fill = experiment_group)) + geom_col(position = 'dodge') + geom_text(aes(label = paste(pct_completed * 100, "%"), fontface=2), vjust=1.2, size = 5, color = "white") + facet_wrap(~ wiki) + scale_y_continuous(labels = scales::percent) + labs (y = "Percent of edits completed ", title = "Edit completion rate by Participating Wikipedia", subtitle = "DT-Enhanced (test) vs Read as Wiki View (control)", caption = "Defined as the proportion of edits initiated that are saved") + scale_fill_manual(values= c("#999999", "steelblue2"), name = "Experiment Group", labels = c("Control", "Test")) + theme( panel.grid.minor = element_blank(), panel.background = element_blank(), plot.title = element_text(hjust = 0.5), text = element_text(size=16), legend.position="bottom", axis.text.x = element_blank(), axis.title.x=element_blank(), axis.line = element_line(colour = "black")) p ggsave("Figures/edit_completes_bywiki.png", p, width = 16, height = 8, units = "in", dpi = 300) # reformat read as wiki dataset to be comparable to mobile edit_attempts_mobile_for_overlay_compare <- edit_attempts_mobile %>% filter(workflow != 'page') %>% #only look at replies and new topics in test group group_by(date, wiki, session, is_anon, workflow, editor_experience) %>% summarise(init_clicks = sum(edit_change), #look at first change edits as denominator save_clicks = sum(edit_success), edit_success = as.integer(if_else(save_clicks > 0, 1, 0))) %>% mutate(view = 'DT-Enhanced view (test)') %>% # add column to specify view mode ungroup() # combine tables edit_attempts_mobilefrontend_compare <- rbind(edit_attempts_mobile_for_overlay_compare, edit_attempts_mobilefrontend) # add row to only count replies that reach first change as attempted for reply workflow comparison edit_attempts_mobilefrontend_compare <- edit_attempts_mobilefrontend_compare %>% mutate(attempted = if_else(workflow %in% c('reply_tool', 'reply') & init_clicks == 0, 0, 1)) #set factor levels edit_attempts_mobilefrontend_compare$view <- factor( edit_attempts_mobilefrontend_compare$view, levels = c("MobileFrontend overlay (control)", "DT-Enhanced view (test)") ) edit_attempts_mobilefrontend_compare$workflow <- factor( edit_attempts_mobilefrontend_compare$workflow, levels = c("replying workflow", "reply_tool", "new topic workflow", "new_topic_tool") ) # edit completion rate edit_completes_overlay_compare_overall <- edit_attempts_mobilefrontend_compare %>% filter(is_anon == 'False') %>% group_by(view) %>% summarise(n_attempts = n_distinct(session[attempted ==1]), n_published = n_distinct(session[edit_success ==1 ]), pct_completed = paste0(round(n_published/n_attempts * 100, 2), "%")) edit_completes_overlay_compare_overall edit_completes_daily_overlay <- edit_attempts_mobilefrontend_compare %>% filter(is_anon == 'False') %>% group_by(date, view) %>% summarise(n_attempts = n_distinct(session[attempted ==1]), n_published = n_distinct(session[edit_success ==1 ]), pct_completed = round(n_published/n_attempts, 2)) options(repr.plot.width = 15, repr.plot.height = 10) p <- edit_completes_daily_overlay %>% ggplot(aes(x= date, y = pct_completed , color = view)) + geom_line(size =1.5) + scale_y_continuous(labels = scales::percent) + scale_x_date("Date", date_breaks = "2 days", date_labels = "%b-%d") + scale_color_manual(values= c("#999999","steelblue2"),name = "Experiment Group") + labs(title = "Daily edit completion rate by experiment group", subtitle = "DT-Enhanced (test) vs MobileFrontEnd overlay (control)", y = "daily edit completion rate rate", x= "Date") + theme( panel.grid.minor = element_blank(), panel.background = element_blank(), plot.title = element_text(hjust = 0.5), text = element_text(size=18), legend.position="bottom", axis.line = element_line(colour = "black")) ggsave("Figures/edit_completes_daily_overlay.png", p, width = 16, height = 8, units = "in", dpi = 300) p # edit completion rate edit_completes_overlay_compare_byworkflow <- edit_attempts_mobilefrontend_compare %>% filter(is_anon == 'False') %>% group_by(view, workflow) %>% summarise(n_attempts = n_distinct(session[attempted ==1]), n_published = n_distinct(session[edit_success ==1 ]), pct_completed = round(n_published/n_attempts, 2)) options(repr.plot.width = 18, repr.plot.height = 8) p <- edit_completes_overlay_compare_byworkflow %>% ggplot(aes(x= workflow, y = pct_completed, fill = view)) + geom_col(position = position_dodge2(preserve = "single")) + geom_text(aes(label = paste(pct_completed * 100, "%"), fontface=2), vjust=1.5, size = 7, color = "white", position = position_dodge(0.9)) + scale_y_continuous(labels = scales::percent) + labs (y = "Percent of edits completed ", title = "Edit completion rate by editing workflow", subtitle = "DT-Enhanced (test) vs MobileFrontEnd overlay (control)") + scale_fill_manual(values= c("#999999", "steelblue2"), name = "Experiment Group" ) + theme( panel.grid.minor = element_blank(), panel.background = element_blank(), plot.title = element_text(hjust = 0.5), text = element_text(size=20), legend.position="right", axis.line = element_line(colour = "black")) p ggsave("Figures/edit_completes_byintegration_overlay.png", p, width = 16, height = 8, units = "in", dpi = 300) edit_completes_overlay_compare_byexp <- edit_attempts_mobilefrontend_compare %>% filter(is_anon == 'False') %>% group_by(editor_experience, view) %>% summarise(n_attempts = n_distinct(session[attempted ==1]), n_published = n_distinct(session[edit_success ==1 ]), pct_completed = round(n_published/n_attempts ,2)) # Plot edit completion rate for each wiki options(repr.plot.width = 15, repr.plot.height = 10) p <- edit_completes_overlay_compare_byexp %>% ggplot(aes(x= view, y = pct_completed, fill = view)) + geom_col(position = 'dodge') + geom_text(aes(label = paste(pct_completed * 100, "%"), fontface=2), vjust=1.2, size = 5, color = "white") + facet_wrap(~ editor_experience) + scale_y_continuous(labels = scales::percent) + labs (y = "Percent of edits completed ", title = "Edit completion rate by user experience", subtitle = "DT-Enhanced (test) vs MobileFrontEnd overlay (control)", caption = "Defined as the proportion of edits initiated that are saved") + scale_fill_manual(values= c("#999999", "steelblue2"), name = "Experiment Group") + theme( panel.grid.minor = element_blank(), panel.background = element_blank(), plot.title = element_text(hjust = 0.5), text = element_text(size=16), legend.position="bottom", axis.text.x = element_blank(), axis.title.x=element_blank(), axis.line = element_line(colour = "black")) p ggsave("Figures/edit_completes_byexp_overlay.png", p, width = 16, height = 8, units = "in", dpi = 300) # edit completion rate edit_completes_overlay_compare_bywiki <- edit_attempts_mobilefrontend_compare %>% filter(is_anon == 'False') %>% group_by(wiki, view) %>% summarise(n_attempts = n_distinct(session[attempted ==1]), n_published = n_distinct(session[edit_success ==1 ]), pct_completed = round(n_published/n_attempts, 2)) # Plot completion rates for each wiki p <- edit_completes_overlay_compare_bywiki %>% ggplot(aes(x= view, y = pct_completed, fill = view)) + geom_col(position = 'dodge') + geom_text(aes(label = paste(pct_completed, "%"), fontface=2), vjust=1.2, size = 5, color = "white") + facet_wrap(~ wiki) + scale_y_continuous(labels = scales::percent) + labs (y = "Percent of edits completed ", title = "Edit Completion Rate by Participating Wikipedia", subtitle = "DT-Enhanced (test) vs MobileFrontEnd overlay (control)") + scale_fill_manual(values= c("#999999", "steelblue2"), name = "Talk Page Version", labels = c("MobileFrontEnd", "DT-Enhanced")) + theme( panel.grid.minor = element_blank(), panel.background = element_blank(), plot.title = element_text(hjust = 0.5), text = element_text(size=16), legend.position="bottom", axis.text.x = element_blank(), axis.title.x=element_blank(), axis.line = element_line(colour = "black")) p ggsave("Figures/edit_completes_bywiki_overlay.png", p, width = 16, height = 8, units = "in", dpi = 300) Edit completion rate increase were also observed across all participating Wikipedias. # edit completion rate user_completes_overall <- edit_attempts_mobile %>% filter(is_anon == 'False') %>% group_by(experiment_group) %>% summarise(n_users = n_distinct(user_id), n_users_published = n_distinct(user_id[edit_success == 1]), pct_completed = paste0(round(n_users_published/n_users * 100, 2), "%")) user_completes_overall user_completes_byworkflow <- edit_attempts_mobile %>% filter(is_anon == 'False') %>% group_by(experiment_group, workflow) %>% summarise(n_users = n_distinct(user_id), n_users_published = n_distinct(user_id[edit_success == 1]), pct_completed = round(n_users_published/n_users, 2)) options(repr.plot.width = 18, repr.plot.height = 8) p <- user_completes_byworkflow %>% ggplot(aes(x= workflow, y = pct_completed, fill = experiment_group)) + geom_col(position = position_dodge2(preserve = "single")) + geom_text(aes(label = paste(pct_completed * 100, "%"), fontface=2), vjust=1.5, size = 7, color = "white", position = position_dodge(0.9)) + scale_y_continuous(labels = scales::percent) + labs (y = "Percent of users ", title = "Proportion of users that save an edit by editing workflow", subtitle = "DT-Enhanced (test) vs Read as Wiki View (control)") + scale_fill_manual(values= c( "#999999", "steelblue2"), name = "Experiment Group" ) + theme( panel.grid.minor = element_blank(), panel.background = element_blank(), plot.title = element_text(hjust = 0.5), text = element_text(size=20), legend.position="right", axis.line = element_line(colour = "black")) p ggsave("Figures/user_completes_byworkflow.png", p, width = 16, height = 8, units = "in", dpi = 300) # edit completion rate user_completes_byexp <- edit_attempts_mobile %>% group_by(editor_experience, experiment_group) %>% summarise(n_users = n_distinct(user_id), n_users_published = n_distinct(user_id[edit_success == 1]), pct_completed = round(n_users_published/n_users, 2)) # Plot edit completion rate for each wiki options(repr.plot.width = 15, repr.plot.height = 10) p <- user_completes_byexp %>% ggplot(aes(x= experiment_group, y = pct_completed, fill = experiment_group)) + geom_col(position = 'dodge') + geom_text(aes(label = paste(pct_completed * 100, "%"), fontface=2), vjust=1.2, size = 5, color = "white") + facet_wrap(~ editor_experience) + scale_y_continuous(labels = scales::percent) + labs (y = "Percent of users", title = "Proportion of users that save an edit by user experience", subtitle = "DT-Enhanced (test) vs Read as Wiki View (control)") + scale_fill_manual(values= c("#999999", "steelblue2"), name = "Experiment Group") + theme( panel.grid.minor = element_blank(), panel.background = element_blank(), plot.title = element_text(hjust = 0.5), text = element_text(size=16), legend.position="bottom", axis.text.x = element_blank(), axis.title.x=element_blank(), axis.line = element_line(colour = "black")) p ggsave("Figures/user_completes_byexp.png", p, width = 16, height = 8, units = "in", dpi = 300) # edit completion rate user_completes_bywiki <- edit_attempts_mobile %>% filter(is_anon == 'False') %>% group_by(wiki, experiment_group) %>% summarise(n_users = n_distinct(user_id), n_users_published = n_distinct(user_id[edit_success == 1]), pct_completed = round(n_users_published/n_users, 2)) # Plot completion rates for each wiki p <- user_completes_bywiki %>% ggplot(aes(x= experiment_group, y = pct_completed, fill = experiment_group)) + geom_col(position = 'dodge') + geom_text(aes(label = paste(pct_completed, "%"), fontface=2), vjust=1.2, size = 5, color = "white") + facet_wrap(~ wiki) + scale_y_continuous(labels = scales::percent) + labs (y = "Percent of users ", title = "Proprotion of users that save an edit by participating Wikipedia", subtitle = "DT-Enhanced (test) vs Read as Wiki View (control)") + scale_fill_manual(values= c("#999999", "steelblue2"), name = "Talk Page Version", labels = c("Read as Wiki Page", "DT-Enhanced")) + theme( panel.grid.minor = element_blank(), panel.background = element_blank(), plot.title = element_text(hjust = 0.5), text = element_text(size=16), legend.position="bottom", axis.text.x = element_blank(), axis.title.x=element_blank(), axis.line = element_line(colour = "black")) p ggsave("Figures/user_completes_bywiki.png", p, width = 16, height = 8, units = "in", dpi = 300)