fit models to subset data
This commit is contained in:
parent
918066e98b
commit
085b520267
13
110124_supp_analysis/110124_supp_analysis.Rproj
Normal file
13
110124_supp_analysis/110124_supp_analysis.Rproj
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
Version: 1.0
|
||||||
|
|
||||||
|
RestoreWorkspace: Default
|
||||||
|
SaveWorkspace: Default
|
||||||
|
AlwaysSaveHistory: Default
|
||||||
|
|
||||||
|
EnableCodeIndexing: Yes
|
||||||
|
UseSpacesForTab: Yes
|
||||||
|
NumSpacesForTab: 2
|
||||||
|
Encoding: UTF-8
|
||||||
|
|
||||||
|
RnwWeave: Sweave
|
||||||
|
LaTeX: pdfLaTeX
|
BIN
110124_supp_analysis/110224_contrib_length_subset.rda
Normal file
BIN
110124_supp_analysis/110224_contrib_length_subset.rda
Normal file
Binary file not shown.
BIN
110124_supp_analysis/110224_log1p_readme_strict_subset.rda
Normal file
BIN
110124_supp_analysis/110224_log1p_readme_strict_subset.rda
Normal file
Binary file not shown.
BIN
110124_supp_analysis/110224_readme_strict_subset.rda
Normal file
BIN
110124_supp_analysis/110224_readme_strict_subset.rda
Normal file
Binary file not shown.
@ -1,7 +1,7 @@
|
|||||||
#library(tidyverse)
|
library(tidyverse)
|
||||||
#library(plyr)
|
library(plyr)
|
||||||
|
|
||||||
contrib_df <- read_csv("110124_contrib_strict_subset.csv")
|
contrib_df <- read_csv("110124_contrib_length_subset.csv")
|
||||||
#some preprocessing and expansion
|
#some preprocessing and expansion
|
||||||
col_order <- c("upstream_vcs_link", "age_in_days", "first_commit", "first_commit_dt", "event_gap", "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")
|
col_order <- c("upstream_vcs_link", "age_in_days", "first_commit", "first_commit_dt", "event_gap", "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 <- contrib_df[,col_order]
|
||||||
@ -43,9 +43,10 @@ mrg_actions_data <- windowed_data[which(windowed_data$observation_type == "mrg")
|
|||||||
all_actions_data$logged_count <- 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)
|
all_actions_data$log1p_count <- log1p(all_actions_data$count)
|
||||||
|
|
||||||
#all_gmodel <- glmer.nb(log1p_count ~ D * week_offset + scaled_project_age + scaled_event_gap + (D * week_offset | upstream_vcs_link),
|
all_gmodel <- glmer.nb(count ~ D * week_offset + (D * week_offset | upstream_vcs_link),
|
||||||
# control=glmerControl(optimizer="bobyqa",
|
control=glmerControl(optimizer="bobyqa",
|
||||||
# optCtrl=list(maxfun=2e5)), nAGQ=0, data=all_actions_data)
|
optCtrl=list(maxfun=2e5)), nAGQ=0, data=all_actions_data)
|
||||||
#saveRDS(all_gmodel, "0711_contrib_all_01.rda")
|
summary(all_gmodel)
|
||||||
|
saveRDS(all_gmodel, "110224_contrib_length_subset.rda")
|
||||||
|
|
||||||
#all_residuals <- residuals(all_gmodel)
|
#all_residuals <- residuals(all_gmodel)
|
@ -1,10 +1,6 @@
|
|||||||
library(readr)
|
library(tidyverse)
|
||||||
library(plyr)
|
library(plyr)
|
||||||
library(lme4)
|
readme_df <- read_csv("110124_readme_strict_subset.csv")
|
||||||
library(stringr)
|
|
||||||
library(tidyr)
|
|
||||||
|
|
||||||
readme_df <- read_csv("110124_supp_analysis/110124_readme_strict_subset.csv")
|
|
||||||
|
|
||||||
col_order <- c("upstream_vcs_link", "age_in_days", "first_commit", "first_commit_dt", "event_gap", "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")
|
col_order <- c("upstream_vcs_link", "age_in_days", "first_commit", "first_commit_dt", "event_gap", "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 <- readme_df[,col_order]
|
||||||
@ -58,3 +54,13 @@ var(all_actions_data$count)
|
|||||||
mean (all_actions_data$count)
|
mean (all_actions_data$count)
|
||||||
sd (all_actions_data$count)
|
sd (all_actions_data$count)
|
||||||
median(all_actions_data$count)
|
median(all_actions_data$count)
|
||||||
|
|
||||||
|
library(lme4)
|
||||||
|
all_log1p_gmodel <- glmer.nb(log1p_count ~ D * week_offset + (D * week_offset | upstream_vcs_link), data=all_actions_data, nAGQ=1, control=glmerControl(optimizer="bobyqa", optCtrl=list(maxfun=1e5)))
|
||||||
|
|
||||||
|
summary(all_log1p_gmodel)
|
||||||
|
saveRDS(all_log1p_gmodel, "110224_log1p_readme_subset.rda")
|
||||||
|
|
||||||
|
all_gmodel <- glmer.nb(count ~ D * week_offset + (D * week_offset | upstream_vcs_link), data=all_actions_data, nAGQ=1, control=glmerControl(optimizer="bobyqa", optCtrl=list(maxfun=1e5)))
|
||||||
|
summary(all_gmodel)
|
||||||
|
saveRDS(all_gmodel, "110224_readme_subset.rda")
|
||||||
|
Loading…
Reference in New Issue
Block a user