Description Usage Arguments Examples
Use influence.mer
from the influence.ME package. Influential observations
and/or groups are identified as being above the critical threshold of 4/N, where N is the number of
unique observations or groups.
1 2 | influenceFun(model, model.variable, data, group.variable,
inf.type = c("observations", "groups"), plot = T, ...)
|
model |
A merMod object from lme4. |
model.variable |
Character. The name of the random effect variable to be computed. |
data |
An optional data frame used in model |
group.variable |
Character. Grouping variable for plots |
inf.type |
Character vector. Specifying which type of influential variables are returned |
plot |
Logical. Should a plot be produced? |
... |
Other arguments passed to |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | require(lme4)
m1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
inf1<-influenceFun(model=m1, model.variable= "Days", data=sleepstudy, group.variable="Subject")
inf1
d1<-cbpp
d1$period<-as.numeric(as.character(cbpp$period))
d1$response<-d1$incidence/d1$size
gm1 <- glmer(cbind(incidence, size - incidence) ~ 1 + (period | herd), data = d1, family = binomial)
inf1<-influenceFun(model=gm1, model.variable= "period", data=d1, group.variable="herd")
inf1
gm2 <- glmer(response ~ 1 + (period | herd), data = d1, weights=d1$size, family = binomial)
inf2<-influenceFun(model=gm2, model.variable= "period", data=d1, group.variable="herd")
inf2
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.