diff --git a/R/0509_gmodel.rda b/R/0509_gmodel.rda new file mode 100644 index 0000000..1a1076c Binary files /dev/null and b/R/0509_gmodel.rda differ diff --git a/R/0509caterpillar.png b/R/0509caterpillar.png new file mode 100644 index 0000000..b6aad64 Binary files /dev/null and b/R/0509caterpillar.png differ diff --git a/R/readmeRDDAnalysis.R b/R/readmeRDDAnalysis.R index 605cdbe..dd32eb1 100644 --- a/R/readmeRDDAnalysis.R +++ b/R/readmeRDDAnalysis.R @@ -82,8 +82,12 @@ mean (all_actions_data$log1p_count) # 0.6426873 #all_gmodel <- glmer.nb(count ~ D * I(week_offset)+ scaled_project_age + (D * I(week_offset) | upstream_vcs_link), # control=glmerControl(optimizer="bobyqa", # optCtrl=list(maxfun=2e5)), data=all_actions_data) -all_gmodel <- glmer.nb(count ~ D * I(week_offset)+ scaled_project_age + (D | upstream_vcs_link), data=all_actions_data) +all_gmodel <- glmer.nb(count ~ D * I(week_offset)+ scaled_project_age + (D * I(week_offset) | upstream_vcs_link), data=all_actions_data, nAGQ=0, control=glmerControl(optimizer="bobyqa", + optCtrl=list(maxfun=1e5))) summary(all_gmodel) +saveRDS(all_gmodel, "0509_gmodel.rda") +#readRDS(path) +library(broom.mixed) test_condvals <- broom.mixed::tidy(all_gmodel, effects = "ran_vals", conf.int = TRUE) test_glmer_ranef_D <- test_condvals [which(test_condvals $term == "D"),] has_zero <- function(estimate, low, high){ @@ -92,10 +96,11 @@ has_zero <- function(estimate, low, high){ test_glmer_ranef_D <- test_glmer_ranef_D |> mutate(ranef_grouping = has_zero(estimate, conf.low, conf.high)) |> mutate(rank = rank(estimate)) -test_glmer_ranef_D |> +g <- test_glmer_ranef_D |> ggplot(aes(x=rank, y=estimate, col = as.factor(ranef_grouping))) + geom_linerange(aes(ymin= conf.low, ymax= conf.high)) + theme_bw() +ggsave("0509caterpillar.png", g) #below this groups the ranefs """ has_zero <- function(condval, condsd){