nbinom fit
This commit is contained in:
parent
6076d161ad
commit
c3816d64e1
BIN
R/0510_log1p_gmodel.rda
Normal file
BIN
R/0510_log1p_gmodel.rda
Normal file
Binary file not shown.
BIN
R/0510_log1p_nagq_gmodel.rda
Normal file
BIN
R/0510_log1p_nagq_gmodel.rda
Normal file
Binary file not shown.
BIN
R/0510_log1p_nagq_gmodel_backup.rda
Normal file
BIN
R/0510_log1p_nagq_gmodel_backup.rda
Normal file
Binary file not shown.
@ -77,18 +77,27 @@ all_standard_errors <- sqrt(diag(vcov(all_model)))[1]
|
|||||||
|
|
||||||
var(all_actions_data$log1p_count) # 1.125429
|
var(all_actions_data$log1p_count) # 1.125429
|
||||||
mean (all_actions_data$log1p_count) # 0.6426873
|
mean (all_actions_data$log1p_count) # 0.6426873
|
||||||
|
var(all_actions_data$count) # 268.4449
|
||||||
|
mean (all_actions_data$count) # 3.757298
|
||||||
|
|
||||||
|
summary(all_actions_data$week_offset)
|
||||||
|
|
||||||
#all_gmodel <- glmer(count ~ D * I(week_offset)+ scaled_project_age + (D * I(week_offset)| upstream_vcs_link), data=all_actions_data, nAGQ=0, family = poisson)
|
#all_gmodel <- glmer(count ~ D * I(week_offset)+ scaled_project_age + (D * I(week_offset)| upstream_vcs_link), data=all_actions_data, nAGQ=0, family = poisson)
|
||||||
#all_gmodel <- glmer.nb(count ~ D * I(week_offset)+ scaled_project_age + (D * I(week_offset) | upstream_vcs_link),
|
all_gmodel <- glmer.nb(count ~ D * week_offset + scaled_project_age + (D * week_offset | upstream_vcs_link),
|
||||||
# control=glmerControl(optimizer="bobyqa",
|
control=glmerControl(optimizer="bobyqa",
|
||||||
# optCtrl=list(maxfun=2e5)), data=all_actions_data)
|
optCtrl=list(maxfun=2e5)), data=all_actions_data)
|
||||||
all_log1p_gmodel <- glmer.nb(log1p_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",
|
#all_log1p_gmodel <- glmer.nb(log1p_count ~ D * week_offset+ scaled_project_age + (D * week_offset | upstream_vcs_link), data=all_actions_data, nAGQ=0, control=glmerControl(optimizer="bobyqa",
|
||||||
|
# optCtrl=list(maxfun=1e5)))
|
||||||
|
all_log1p_gmodel <- glmer.nb(log1p_count ~ D * week_offset+ scaled_project_age + (D * week_offset | upstream_vcs_link), data=all_actions_data, nAGQ=1, control=glmerControl(optimizer="bobyqa",
|
||||||
optCtrl=list(maxfun=1e5)))
|
optCtrl=list(maxfun=1e5)))
|
||||||
summary(all_log1p_gmodel)
|
summary(all_log1p_gmodel)
|
||||||
saveRDS(all_log1p_gmodel, "0509_log1p_gmodel.rda")
|
warnings(all_log1p_gmodel)
|
||||||
#readRDS(path)
|
saveRDS(all_log1p_gmodel, "0510_log1p_nagq_gmodel_backup.rda")
|
||||||
|
#yesterdays_model <- readRDS("0509_log1p_gmodel.rda")
|
||||||
|
all_residuals <- residuals(all_log1p_gmodel)
|
||||||
|
qqnorm(all_residuals)
|
||||||
library(broom.mixed)
|
library(broom.mixed)
|
||||||
test_condvals <- broom.mixed::tidy(all_gmodel, effects = "ran_vals", conf.int = TRUE)
|
test_condvals <- broom.mixed::tidy(all_log1p_gmodel, effects = "ran_vals", conf.int = TRUE)
|
||||||
test_glmer_ranef_D <- test_condvals [which(test_condvals $term == "D"),]
|
test_glmer_ranef_D <- test_condvals [which(test_condvals $term == "D"),]
|
||||||
has_zero <- function(estimate, low, high){
|
has_zero <- function(estimate, low, high){
|
||||||
return(ifelse((low < 0),ifelse((high > 0), 1, 0), 2))
|
return(ifelse((low < 0),ifelse((high > 0), 1, 0), 2))
|
||||||
|
Loading…
Reference in New Issue
Block a user