library(ggplot2) data1 <- read_csv('../power_data_111023_mmt.csv',show_col_types = FALSE) data2 <- read_csv('../inst_all_packages_full_results.csv') data1 <- read_csv('../kk_final_expanded_data_final.csv',show_col_types = FALSE) library(readr) library(ggplot2) library(tidyverse) data1 <- read_csv('../kk_final_expanded_data_final.csv',show_col_types = FALSE) # this is the file with the lmer multi-level rddAnalysis library(tidyverse) library(plyr) # 0 loading the readme data in try(setwd(dirname(rstudioapi::getActiveDocumentContext()$path))) readme_df <- read_csv("../final_data/deb_readme_did.csv") # 1 preprocessing #colnames(readme_df) <- c("upstream_vcs_link", "event_date", "event_hash", "before_all_ct", "before_mrg_ct", "after_all_ct", "after_mrg_ct", "before_auth_new", "after_commit_new", "after_auth_new", "before_commit_new") col_order <- c("upstream_vcs_link", "age_of_project", "event_date", "event_hash", "before_all_ct", "after_all_ct", "before_mrg_ct", "after_mrg_ct", "before_auth_new", "after_auth_new", "before_commit_new", "after_commit_new") readme_df <- readme_df[,col_order] readme_df$ct_before_all <- str_split(gsub("[][]","", readme_df$before_all_ct), ", ") readme_df$ct_after_all <- str_split(gsub("[][]","", readme_df$after_all_ct), ", ") readme_df$ct_before_mrg <- str_split(gsub("[][]","", readme_df$before_mrg_ct), ", ") readme_df$ct_after_mrg <- str_split(gsub("[][]","", readme_df$after_mrg_ct), ", ") drop <- c("before_all_ct", "before_mrg_ct", "after_all_ct", "after_mrg_ct") readme_df = readme_df[,!(names(readme_df) %in% drop)] # 2 some expansion needs to happens for each project expand_timeseries <- function(project_row) { longer <- project_row |> pivot_longer(cols = starts_with("ct"), names_to = "window", values_to = "count") |> unnest(count) longer$observation_type <- gsub("^.*_", "", longer$window) longer <- ddply(longer, "observation_type", transform, week=seq(from=0, by=1, length.out=length(observation_type))) longer$count <- as.numeric(longer$count) #longer <- longer[which(longer$observation_type == "all"),] return(longer) } expanded_data <- expand_timeseries(readme_df[1,]) for (i in 2:nrow(readme_df)){ expanded_data <- rbind(expanded_data, expand_timeseries(readme_df[i,])) } #filter out the windows of time that we're looking at window_num <- 8 windowed_data <- expanded_data |> filter(week >= (27 - window_num) & week <= (27 + window_num)) |> mutate(D = ifelse(week > 27, 1, 0)) #scale the age numbers windowed_data$scaled_project_age <- scale(windowed_data$age_of_project) windowed_data$week_offset <- windowed_data$week - 27 #separate out the cleaning d all_actions_data <- windowed_data[which(windowed_data$observation_type == "all"),] mrg_actions_data <- windowed_data[which(windowed_data$observation_type == "mrg"),] all_actions_data$log1p_count <- log1p(all_actions_data$count) # 3 rdd in lmer analysis # rdd: https://rpubs.com/phle/r_tutorial_regression_discontinuity_design # lmer: https://www.youtube.com/watch?v=LzAwEKrn2Mc library(lme4) # https://www.bristol.ac.uk/cmm/learning/videos/random-intercepts.html#exvar library(optimx) library(lattice) all_model <- lmer(log1p_count ~ D * I(week_offset)+ scaled_project_age + (D * I(week_offset)| upstream_vcs_link), data=all_actions_data, REML=FALSE, control = lmerControl( optimizer ='optimx', optCtrl=list(method='L-BFGS-B'))) #identifying the quartiles of effect for D all_model_ranef <- as.data.frame(ranef(all_model, condVar=TRUE)) View(all_model_ranef) d_effect_ranef_all <- all_model_ranef[all_model_ranef$term=="D",] #identifying the quartiles of effect for D all_model_ranef <- ranef(all_model, condVar=TRUE) d_effect_ranef_all <- all_model_ranef[all_model_ranef$term=="D",] dotplot(all_model_ranef) d_effect_ranef_all <- all_model_ranef['upstream_vcs_link']['D'] View(all_model_ranef) d_effect_ranef_all <- all_model_ranef[upstream_vcs_link,2] d_effect_ranef_all <- all_model_ranef['upstream_vcs_link',2] d_effect_ranef_all <- all_model_ranef$upstream_vcs_link View(d_effect_ranef_all) dotplot(all_model_ranef)[["D"]] dotplot(all_model_ranef)[["upstream_vcs_link"]] dotplot(all_model_ranef)[["upstream_vcs_link"]["D"]] dotplot(all_model_ranef)$D View(all_model_ranef) for (j in 1:nschool) { jj <- order(all_model_ranef)[j] lines (x=c(j,j),y=c(ranef.lower[jj],ranef.upper[jj])) } for (j in 1:upstream_vcs_link) { jj <- order(all_model_ranef)[j] lines (x=c(j,j),y=c(ranef.lower[jj],ranef.upper[jj])) } View(all_model_ranef) df_ranefs <- as.data.frame(all_model_ranef) View(df_ranefs) #identifying the quartiles of effect for D all_model_ranef <- ranef(all_model, condVar=TRUE)$upstream_vcs_link[[2]] #identifying the quartiles of effect for D all_model_ranef <- ranef(all_model, condVar=TRUE)$upstream_vcs_link dotplot(all_model_ranef) dotplot(all_model_ranef) # this is the file with the lmer multi-level rddAnalysis library(tidyverse) library(plyr) # 0 loading the readme data in try(setwd(dirname(rstudioapi::getActiveDocumentContext()$path))) readme_df <- read_csv("../final_data/deb_readme_did.csv") # 1 preprocessing #colnames(readme_df) <- c("upstream_vcs_link", "event_date", "event_hash", "before_all_ct", "before_mrg_ct", "after_all_ct", "after_mrg_ct", "before_auth_new", "after_commit_new", "after_auth_new", "before_commit_new") col_order <- c("upstream_vcs_link", "age_of_project", "event_date", "event_hash", "before_all_ct", "after_all_ct", "before_mrg_ct", "after_mrg_ct", "before_auth_new", "after_auth_new", "before_commit_new", "after_commit_new") readme_df <- readme_df[,col_order] readme_df$ct_before_all <- str_split(gsub("[][]","", readme_df$before_all_ct), ", ") readme_df$ct_after_all <- str_split(gsub("[][]","", readme_df$after_all_ct), ", ") readme_df$ct_before_mrg <- str_split(gsub("[][]","", readme_df$before_mrg_ct), ", ") readme_df$ct_after_mrg <- str_split(gsub("[][]","", readme_df$after_mrg_ct), ", ") drop <- c("before_all_ct", "before_mrg_ct", "after_all_ct", "after_mrg_ct") readme_df = readme_df[,!(names(readme_df) %in% drop)] # 2 some expansion needs to happens for each project expand_timeseries <- function(project_row) { longer <- project_row |> pivot_longer(cols = starts_with("ct"), names_to = "window", values_to = "count") |> unnest(count) longer$observation_type <- gsub("^.*_", "", longer$window) longer <- ddply(longer, "observation_type", transform, week=seq(from=0, by=1, length.out=length(observation_type))) longer$count <- as.numeric(longer$count) #longer <- longer[which(longer$observation_type == "all"),] return(longer) } expanded_data <- expand_timeseries(readme_df[1,]) for (i in 2:nrow(readme_df)){ expanded_data <- rbind(expanded_data, expand_timeseries(readme_df[i,])) } #filter out the windows of time that we're looking at window_num <- 8 windowed_data <- expanded_data |> filter(week >= (27 - window_num) & week <= (27 + window_num)) |> mutate(D = ifelse(week > 27, 1, 0)) #scale the age numbers windowed_data$scaled_project_age <- scale(windowed_data$age_of_project) windowed_data$week_offset <- windowed_data$week - 27 #separate out the cleaning d all_actions_data <- windowed_data[which(windowed_data$observation_type == "all"),] mrg_actions_data <- windowed_data[which(windowed_data$observation_type == "mrg"),] all_actions_data$log1p_count <- log1p(all_actions_data$count) # 3 rdd in lmer analysis # rdd: https://rpubs.com/phle/r_tutorial_regression_discontinuity_design # lmer: https://www.youtube.com/watch?v=LzAwEKrn2Mc library(lme4) # https://www.bristol.ac.uk/cmm/learning/videos/random-intercepts.html#exvar library(optimx) library(lattice) all_model <- lmer(log1p_count ~ D * I(week_offset)+ scaled_project_age + (D * I(week_offset)| upstream_vcs_link), data=all_actions_data, REML=FALSE, control = lmerControl( optimizer ='optimx', optCtrl=list(method='L-BFGS-B'))) #identifying the quartiles of effect for D all_model_ranef <- ranef(all_model, condVar=TRUE) dotplot(all_model_ranef)$g[1] re <- ranef(all_model,postVar = TRUE) re$g$'(Intercept)' <- NULL re$g$'D:I(week_offset)' <- NULL re <- ranef(all_model, condVar=TRUE) re$g$'(Intercept)' <- NULL re$g$'D:I(week_offset)' <- NULL dotplot(re) dotplot(re) re <- ranef(all_model, condVar=TRUE) re$upstream_vcs_link$'(Intercept)' <- NULL re$upstream_vcs_link$'D:I(week_offset)' <- NULL View(re) re$upstream_vcs_link$'I(week_offset)' <- NULL dotplot(re) View(re) View(all_model_ranef) dotplot(all_model_ranef) #identifying the quartiles of effect for D all_model_ranef <- ranef(all_model, condVar=TRUE) dotplot(all_model_ranef) #identifying the quartiles of effect for D all_model_ranef <- ranef(all_model, condVar=TRUE) dotplot(all_model_ranef) re <- ranef(all_model, condVar=TRUE) re$upstream_vcs_link$'(Intercept)' <- NULL re$upstream_vcs_link$'D:I(week_offset)' <- NULL re$upstream_vcs_link$'I(week_offset)' <- NULL dotplot(re) dotplot(all_model_ranef) # this is the file with the lmer multi-level rddAnalysis library(tidyverse) library(plyr) # 0 loading the readme data in try(setwd(dirname(rstudioapi::getActiveDocumentContext()$path))) readme_df <- read_csv("../final_data/deb_readme_did.csv") # 1 preprocessing #colnames(readme_df) <- c("upstream_vcs_link", "event_date", "event_hash", "before_all_ct", "before_mrg_ct", "after_all_ct", "after_mrg_ct", "before_auth_new", "after_commit_new", "after_auth_new", "before_commit_new") col_order <- c("upstream_vcs_link", "age_of_project", "event_date", "event_hash", "before_all_ct", "after_all_ct", "before_mrg_ct", "after_mrg_ct", "before_auth_new", "after_auth_new", "before_commit_new", "after_commit_new") readme_df <- readme_df[,col_order] readme_df$ct_before_all <- str_split(gsub("[][]","", readme_df$before_all_ct), ", ") readme_df$ct_after_all <- str_split(gsub("[][]","", readme_df$after_all_ct), ", ") readme_df$ct_before_mrg <- str_split(gsub("[][]","", readme_df$before_mrg_ct), ", ") readme_df$ct_after_mrg <- str_split(gsub("[][]","", readme_df$after_mrg_ct), ", ") drop <- c("before_all_ct", "before_mrg_ct", "after_all_ct", "after_mrg_ct") readme_df = readme_df[,!(names(readme_df) %in% drop)] # 2 some expansion needs to happens for each project expand_timeseries <- function(project_row) { longer <- project_row |> pivot_longer(cols = starts_with("ct"), names_to = "window", values_to = "count") |> unnest(count) longer$observation_type <- gsub("^.*_", "", longer$window) longer <- ddply(longer, "observation_type", transform, week=seq(from=0, by=1, length.out=length(observation_type))) longer$count <- as.numeric(longer$count) #longer <- longer[which(longer$observation_type == "all"),] return(longer) } expanded_data <- expand_timeseries(readme_df[1,]) for (i in 2:nrow(readme_df)){ expanded_data <- rbind(expanded_data, expand_timeseries(readme_df[i,])) } #filter out the windows of time that we're looking at window_num <- 8 windowed_data <- expanded_data |> filter(week >= (27 - window_num) & week <= (27 + window_num)) |> mutate(D = ifelse(week > 27, 1, 0)) #scale the age numbers windowed_data$scaled_project_age <- scale(windowed_data$age_of_project) windowed_data$week_offset <- windowed_data$week - 27 #separate out the cleaning d all_actions_data <- windowed_data[which(windowed_data$observation_type == "all"),] mrg_actions_data <- windowed_data[which(windowed_data$observation_type == "mrg"),] all_actions_data$log1p_count <- log1p(all_actions_data$count) # 3 rdd in lmer analysis # rdd: https://rpubs.com/phle/r_tutorial_regression_discontinuity_design # lmer: https://www.youtube.com/watch?v=LzAwEKrn2Mc library(lme4) # https://www.bristol.ac.uk/cmm/learning/videos/random-intercepts.html#exvar library(optimx) library(lattice) all_model <- lmer(log1p_count ~ D * I(week_offset)+ scaled_project_age + (D * I(week_offset)| upstream_vcs_link), data=all_actions_data, REML=FALSE, control = lmerControl( optimizer ='optimx', optCtrl=list(method='L-BFGS-B'))) summary(all_model) #identifying the quartiles of effect for D all_model_ranef <- ranef(all_model, condVar=TRUE) dotplot(all_model_ranef) df_ranefs <- as.data.frame(all_model_ranef) View(df_ranefs) D_df_ranef <- df_ranefs[term == "D"] D_df_ranef <- df_ranefs[df_ranefs$term == "D"] library(tidyverse) library(plyr) #get the contrib data instead try(setwd(dirname(rstudioapi::getActiveDocumentContext()$path))) contrib_df <- read_csv("../final_data/deb_contrib_did.csv") #some preprocessing and expansion col_order <- c("upstream_vcs_link", "age_of_project", "event_date", "event_hash", "before_all_ct", "after_all_ct", "before_mrg_ct", "after_mrg_ct", "before_auth_new", "after_auth_new", "before_commit_new", "after_commit_new") contrib_df <- contrib_df[,col_order] contrib_df$ct_before_all <- str_split(gsub("[][]","", contrib_df$before_all_ct), ", ") contrib_df$ct_after_all <- str_split(gsub("[][]","", contrib_df$after_all_ct), ", ") contrib_df$ct_before_mrg <- str_split(gsub("[][]","", contrib_df$before_mrg_ct), ", ") contrib_df$ct_after_mrg <- str_split(gsub("[][]","", contrib_df$after_mrg_ct), ", ") drop <- c("before_all_ct", "before_mrg_ct", "after_all_ct", "after_mrg_ct") contrib_df = contrib_df[,!(names(contrib_df) %in% drop)] # 2 some expansion needs to happens for each project expand_timeseries <- function(project_row) { longer <- project_row |> pivot_longer(cols = starts_with("ct"), names_to = "window", values_to = "count") |> unnest(count) longer$observation_type <- gsub("^.*_", "", longer$window) longer <- ddply(longer, "observation_type", transform, week=seq(from=0, by=1, length.out=length(observation_type))) longer$count <- as.numeric(longer$count) #longer <- longer[which(longer$observation_type == "all"),] return(longer) } expanded_data <- expand_timeseries(contrib_df[1,]) for (i in 2:nrow(contrib_df)){ expanded_data <- rbind(expanded_data, expand_timeseries(contrib_df[i,])) } #filter out the windows of time that we're looking at window_num <- 8 windowed_data <- expanded_data |> filter(week >= (27 - window_num) & week <= (27 + window_num)) |> mutate(D = ifelse(week > 27, 1, 0)) #scale the age numbers windowed_data$scaled_project_age <- scale(windowed_data$age_of_project) windowed_data$week_offset <- windowed_data$week - 27 #separate out the cleaning d all_actions_data <- windowed_data[which(windowed_data$observation_type == "all"),] mrg_actions_data <- windowed_data[which(windowed_data$observation_type == "mrg"),] #EDA? hist(log(all_actions_data$count)) all_actions_data$logged_count <- log(all_actions_data$count) all_actions_data$log1p_count <- log1p(all_actions_data$count) # now for merge mrg_actions_data$logged_count <- log(mrg_actions_data$count) mrg_actions_data$log1p_count <- log1p(mrg_actions_data$count) #TKTK --------------------- #imports for models library(lme4) library(optimx) library(lattice) #models -- TKTK need to be fixed all_model <- lmer(log1p_count ~ D * I(week_offset)+ scaled_project_age + (week_offset| upstream_vcs_link), data=all_actions_data, REML=FALSE, control = lmerControl( optimizer ='optimx', optCtrl=list(method='L-BFGS-B'))) summary(all_model) #identifying the quartiles of effect for D all_model_ranef <- as.data.frame(ranef(all_model)) View(all_model_ranef) # mrg behavior for this mrg_model <- lmer(log1p_count ~ D * I(week_offset)+ scaled_project_age + (week_offset | upstream_vcs_link), data=mrg_actions_data, REML=FALSE, control = lmerControl( optimizer ='optimx', optCtrl=list(method='L-BFGS-B'))) summary(mrg_model) #identifying the quartiles of effect for D mrg_model_ranef <- ranef(mrg_model) View(mrg_model_ranef) dotplot(mrg_model_ranef) #load in data contrib_df <- read_csv("../final_data/deb_contrib_pop_change.csv") readme_df <- read_csv("../final_data/deb_readme_pop_change.csv") View(readme_df) #some expansion needs to happens for each project expand_timeseries <- function(project_row) { longer <- project_row |> pivot_longer(cols = ends_with("new"), names_to = "window", values_to = "count") |> unnest(count) #longer$observation_type <- gsub("^.*_", "", longer$window) #longer <- ddply(longer, "observation_type", transform, week=seq(from=0, by=1, length.out=length(observation_type))) #longer$count <- as.numeric(longer$count) #longer <- longer[which(longer$observation_type == "all"),] return(longer) } expanded_data <- expand_timeseries(readme_df[1,]) View(expand_timeseries) View(expanded_data) longer <- project_row |> pivot_longer(cols = ends_with("new"), names_to = "window", values_to = "count") |> unnest(count) |> mutate(after_doc = str_detect(window, "after")) #some expansion needs to happens for each project expand_timeseries <- function(project_row) { longer <- project_row |> pivot_longer(cols = ends_with("new"), names_to = "window", values_to = "count") |> unnest(count) |> mutate(after_doc = str_detect(window, "after")) return(longer) } expanded_data <- expand_timeseries(readme_df[1,]) longer <- project_row |> pivot_longer(cols = ends_with("new"), names_to = "window", values_to = "count") |> unnest(count) |> mutate(after_doc = as.numeric(str_detect(window, "after"))) return(longer) #some expansion needs to happens for each project expand_timeseries <- function(project_row) { longer <- project_row |> pivot_longer(cols = ends_with("new"), names_to = "window", values_to = "count") |> unnest(count) |> mutate(after_doc = as.numeric(str_detect(window, "after"))) return(longer) } expanded_data <- expand_timeseries(readme_df[1,]) #some expansion needs to happens for each project expand_timeseries <- function(project_row) { longer <- project_row |> pivot_longer(cols = ends_with("new"), names_to = "window", values_to = "count") |> unnest(count) |> mutate(after_doc = as.numeric(str_detect(window, "after"))) |> mutate(is_collab = as.numeric(str_detect(window, "collab"))) return(longer) } expanded_data <- expand_timeseries(readme_df[1,]) for (i in 2:nrow(readme_df)){ expanded_readme_data <- rbind(expanded_readme_data, expand_timeseries(readme_df[i,])) } expanded_readme_data <- expand_timeseries(readme_df[1,]) for (i in 2:nrow(readme_df)){ expanded_readme_data <- rbind(expanded_readme_data, expand_timeseries(readme_df[i,])) } expanded_contrib_data <- expand_timeseries(contrib_df[1,]) for (i in 2:nrow(contrib_df)){ expanded_contrib_data <- rbind(expanded_contrib_data, expand_timeseries(contrib_df[i,])) } View(expanded_contrib_data) readme_model <- lmer(count ~ after_doc + (1| upstream_vcs_link), data=expanded_readme_data, REML=FALSE) summary(readme_model) readme_model <- lmer(count ~ after_doc + ( after_doc | upstream_vcs_link), data=expanded_readme_data, REML=FALSE) summary(readme_model) contrib_model <- lmer(count ~ after_doc + ( after_doc | upstream_vcs_link), data=expanded_contrib_data, REML=FALSE) summary(contrib_model) collab_readme_model <- lmer(count ~ after_doc + ( after_doc | upstream_vcs_link), data=collab_pop_readme, REML=FALSE) #breaking out the types of population counts collab_pop_readme <- expanded_readme_data[which(expanded_readme_data$is_collab == 1),] contrib_pop_readme <- expanded_readme_data[which(expanded_readme_data$is_collab == 0),] collab_pop_contrib <- expanded_contrib_data[which(expanded_contrib_data$is_collab == 1),] contrib_pop_contrib <- expanded_contrib_data[which(expanded_contrib_data$is_collab == 0),] collab_readme_model <- lmer(count ~ after_doc + ( after_doc | upstream_vcs_link), data=collab_pop_readme, REML=FALSE) collab_readme_model <- lmer(count ~ after_doc + (1| upstream_vcs_link), data=collab_pop_readme, REML=FALSE) summary(collab_readme_model) contrib_readme_model <- lmer(count ~ after_doc + ( 1| upstream_vcs_link), data=contrib_pop_readme, REML=FALSE) summary(contrib_readme_model) collab_readme_model <- lmer(count ~ after_doc + (after_doc| upstream_vcs_link), data=collab_pop_readme, REML=FALSE) collab_readme_model <- lmer(count ~ after_doc + (1| upstream_vcs_link), data=collab_pop_readme, REML=FALSE) summary(collab_readme_model) contrib_readme_model <- lmer(count ~ after_doc + ( 1| upstream_vcs_link), data=contrib_pop_readme, REML=FALSE) summary(contrib_readme_model) collab_contrib_model <- lmer(count ~ after_doc + ( 1 | upstream_vcs_link), data=collab_pop_contrib, REML=FALSE) summary(collab_contrib_model) contrib_contrib_model <- lmer(count ~ after_doc + ( 1 | upstream_vcs_link), data=contrib_pop_contrib, REML=FALSE) summary(contrib_contrib_model) expanded_readme_data |> ggplot(aes(x = after_doc, y = count, col = is_collab)) + geom_point() ggplot(aes(x = after_doc, y = count, col = as.factor(is_collab)) + expanded_readme_data |> ggplot(aes(x = after_doc, y = count, col = as.factor(is_collab))) + geom_point() expanded_readme_data |> expanded_readme_data |> ggplot(aes(x = after_doc, y = count, col = as.factor(is_collab))) + geom_point() expanded_readme_data |> ggplot(aes(x = as.factor(after_doc), y = count, col = as.factor(is_collab))) + geom_point() expanded_readme_data |> ggplot(aes(x = as.factor(after_doc), y = scale(count), col = as.factor(is_collab))) + geom_point() expanded_readme_data$log1pcount <- log1p(expanded_readme_data$count) expanded_contrib_data$log1pcount <- log1p(expanded_contrib_data$count) expanded_readme_data |> ggplot(aes(x = as.factor(after_doc), y = log1pcount, col = as.factor(is_collab))) + geom_point() expanded_readme_data |> ggplot(aes(x = as.factor(after_doc), y = log1pcount, col = as.factor(is_collab))) + geom_point() + geom_smooth(method = 'lm', se = F) expanded_readme_data |> ggplot(aes(x = after_doc, y = log1pcount, col = as.factor(is_collab))) + geom_point() + geom_smooth(method = 'lm', se = F) expanded_contrib_data |> ggplot(aes(x = after_doc, y = log1pcount, col = as.factor(is_collab))) + geom_point() + geom_smooth(method = 'lm', se = F) expanded_readme_data |> ggplot(aes(x = after_doc, y = log1pcount, col = as.factor(is_collab))) + geom_point() + geom_smooth(method = 'lm', se = F) + geom_jitter() expanded_readme_data |> ggplot(aes(x = after_doc, y = count, col = as.factor(is_collab))) + geom_point() + geom_smooth(method = 'lm', se = F) + geom_jitter() expanded_readme_data$logcount <- log(expanded_readme_data$count) expanded_contrib_data$logcount <- log(expanded_contrib_data$count) expanded_readme_data |> ggplot(aes(x = after_doc, y = logcount, col = as.factor(is_collab))) + geom_point() + geom_smooth(method = 'lm', se = F) + geom_jitter() expanded_contrib_data |> ggplot(aes(x = after_doc, y = log1pcount, col = as.factor(is_collab))) + geom_point() + geom_smooth(method = 'lm', se = F) expanded_contrib_data |> ggplot(aes(x = after_doc, y = log1pcount, col = as.factor(is_collab))) + geom_point() + geom_smooth(method = 'lm', se = F) + geom_jitter() expanded_contrib_data |> ggplot(aes(x = after_doc, y = count, col = as.factor(is_collab))) + geom_point() + geom_smooth(method = 'lm', se = F) + geom_jitter() expanded_readme_data |> ggplot(aes(x = after_doc, y = logcount, col = as.factor(is_collab))) + geom_point() + geom_smooth(method = 'lm', se = F) + geom_jitter() collab_readme_model <- lmer(logcount ~ after_doc + (1| upstream_vcs_link), data=collab_pop_readme, REML=FALSE) #breaking out the types of population counts collab_pop_readme <- expanded_readme_data[which(expanded_readme_data$is_collab == 1),] contrib_pop_readme <- expanded_readme_data[which(expanded_readme_data$is_collab == 0),] collab_pop_contrib <- expanded_contrib_data[which(expanded_contrib_data$is_collab == 1),] contrib_pop_contrib <- expanded_contrib_data[which(expanded_contrib_data$is_collab == 0),] collab_readme_model <- lmer(logcount ~ after_doc + (1| upstream_vcs_link), data=collab_pop_readme, REML=FALSE) collab_readme_model <- lmer(log1pcount ~ after_doc + (1| upstream_vcs_link), data=collab_pop_readme, REML=FALSE) summary(collab_readme_model) contrib_readme_model <- lmer(log1pcount ~ after_doc + ( 1| upstream_vcs_link), data=contrib_pop_readme, REML=FALSE) summary(contrib_readme_model) collab_contrib_model <- lmer(log1pcount ~ after_doc + ( 1 | upstream_vcs_link), data=collab_pop_contrib, REML=FALSE) summary(collab_contrib_model) contrib_contrib_model <- lmer(log1pcount ~ after_doc + ( 1 | upstream_vcs_link), data=contrib_pop_contrib, REML=FALSE) summary(contrib_contrib_model) library(ggplot2) expanded_readme_data |> ggplot(aes(x = after_doc, y = logcount, col = as.factor(is_collab))) + geom_point() + geom_smooth(method = 'lm', se = F) + geom_jitter() expanded_readme_data |> ggplot(aes(x = after_doc, y = log1pcount, col = as.factor(is_collab))) + geom_point() + geom_smooth(method = 'lm', se = F) + geom_jitter() expanded_contrib_data |> ggplot(aes(x = after_doc, y = count, col = as.factor(is_collab))) + geom_point() + geom_smooth(method = 'lm', se = F) + geom_jitter()