if (interactive()) {
fm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
inf_fm1 <- influence(fm1, "Subject")
if (require("car")) {
infIndexPlot(inf_fm1)
}
dfbeta(inf_fm1)
dfbetas(inf_fm1)
gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
data = cbpp, family = binomial)
inf_gm1 <- influence(gm1, "herd", maxfun=100)
gm1.11 <- update(gm1, subset = herd != 11) # check deleting herd 11
if (require("car")) {
infIndexPlot(inf_gm1)
compareCoefs(gm1, gm1.11)
}
if(packageVersion("car") >= "3.0.10") {
dfbeta(inf_gm1)
dfbetas(inf_gm1)
}
}
Run the code above in your browser using DataLab