Description Usage Arguments Details Value Examples
Calculates and plots confidence intervals for random effects of lme4 models using REsim
1 2 3 |
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 |
col.variable |
An optional variable name used to colour the plotted values |
plot |
Logical. Should a plot be produced? |
stat |
Character. median or mean |
level |
Numeric. Confidence interval to return |
oddsRatio |
Logical. should paramters be converted to odds ratios? |
nsim |
Numeric.Number of simulations to use |
sig.only |
Logical. Should only significant random effect levels be plotted? |
group.variable |
Character. Grouping variable for plots |
... |
other arguments passed to REsim. |
Use the Gelman sim technique to build empirical Bayes estimates. Uses the sim function in the arm package
A data frame and plot of confidence intervals.
1 2 3 4 5 6 7 8 | require(lme4)
m1 <- lmer(Reaction ~ 1 + (Days | Subject), sleepstudy)
ci1 <- ciFun(model=m1, model.variable= "Days")
d1<-cbpp
d1$period<-as.numeric(as.character(cbpp$period))
d1$response<-d1$incidence/d1$size
gm1 <- glmer(response ~ 1 + (period | herd), data = d1, weights=d1$size, family = binomial)
ci2 <- ciFun(model=gm1, model.variable= "period")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.