% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/merPlots.R
\name{plotREimpact}
\alias{plotREimpact}
\title{Plot the impact of grouping-factor levels on predictions}
\usage{
plotREimpact(data, level = 0.95, facet = TRUE, point_size = 2.5)
}
\arguments{
\item{data}{either a single data.frame produced by \code{\link{REimpact}},
or a named list of such data.frames. When a named list is supplied the names
are used to colour and label the series.}

\item{level}{the width of the confidence interval (default 0.95).}

\item{facet}{logical, facet the plot by \code{case} (default \code{TRUE}).}

\item{point_size}{numeric size of the plotted central points.}
}
\value{
a ggplot2 object.
}
\description{
Plot the output of one or more \code{\link{REimpact}} calls on a
single chart. Each point is the weighted-average fitted value for a bin of
the expected-rank distribution of a grouping factor, with a confidence
interval derived from the weighted standard error. Supplying a named list of
\code{REimpact} results overlays them on the same axes -- for example to
compare the influence of two different grouping factors, or the same factor
across two models -- which previously required hand-assembling the data
frames (#84).
}
\examples{
\donttest{
 m1 <- lmer(Reaction ~ Days + (1 | Subject), sleepstudy)
 imp <- REimpact(m1, newdata = sleepstudy[1, ], groupFctr = "Subject",
                 breaks = 4)
 plotREimpact(imp)

 # Compare two grouping factors on the same chart
 g1 <- lmer(y ~ lectage + studage + (1 | d) + (1 | s), data = InstEval)
 d_eff <- REimpact(g1, newdata = InstEval[1, ], groupFctr = "d", breaks = 4)
 s_eff <- REimpact(g1, newdata = InstEval[1, ], groupFctr = "s", breaks = 4)
 plotREimpact(list("Instructor (d)" = d_eff, "Student (s)" = s_eff))
 }
}
\seealso{
\code{\link{REimpact}}
}
