influenceIndexPlot(lm(prestige ~ income + education + type, Duncan))
if (FALSE) # a little slow
if (require(lme4)){
print(fm1 <- lmer(Reaction ~ Days + (Days | Subject),
sleepstudy)) # from ?lmer
infIndexPlot(influence(fm1, "Subject"))
infIndexPlot(influence(fm1))
}
if (require(lme4)){
gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
data = cbpp, family = binomial) # from ?glmer
infIndexPlot(influence(gm1, "herd", maxfun=100))
infIndexPlot(influence(gm1, maxfun=100))
gm1.11 <- update(gm1, subset = herd != 11) # check deleting herd 11
compareCoefs(gm1, gm1.11)
}
Run the code above in your browser using DataLab