% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot.efa_power.R
\name{plot.efa_power}
\alias{plot.efa_power}
\title{Plot the RMSEA power curve}
\usage{
\method{plot}{efa_power}(x, n = NULL, df = NULL, eps1 = NULL, ...)
}
\arguments{
\item{x}{An object of class \code{efa_power} (output from \code{\link[=efa_power]{efa_power()}}).}

\item{n}{numeric. The total sample sizes to evaluate. If \code{NULL} (the default) a
sequence bracketing the object's sample size is chosen automatically.}

\item{df}{numeric. The model degrees of freedom (must be positive). Defaults to the
object's \code{df}; a vector of length greater than one draws one curve per value.}

\item{eps1}{numeric. The alternative-hypothesis RMSEA (must differ from the null
\code{eps0}). Defaults to the object's \code{eps1}; a vector of length greater than one draws
one curve per value. At most one of \code{df} and \code{eps1} may be a vector.}

\item{...}{Not used; for consistency with the generic.}
}
\value{
A \link[ggplot2:ggplot]{ggplot2::ggplot} object.
}
\description{
Draws the analytic RMSEA power (MacCallum, Browne, & Sugawara, 1996) of an
\code{\link[=efa_power]{efa_power()}} result as a function of the total sample size, mirroring
\code{semTools::plotRMSEApower()} but returning a \link[ggplot2:ggplot]{ggplot2::ggplot} object rather than
drawing to the active device. The test, its null and alternative RMSEA, the
significance level, and the number of groups are taken from the object; only the
sample-size axis is swept, with an optional sweep of the degrees of freedom or the
alternative RMSEA to overlay several curves.
}
\details{
When the plotted curve is the object's own -- a single curve with neither \code{df} nor
\code{eps1} overridden -- it is annotated with the object's result: a dashed vertical line
at its sample size \code{x$N}, a dashed horizontal line at the reference power (the target
power when a sample size was solved for, otherwise the power achieved at \code{x$N}), and a
point at \code{x$N} and the achieved power. Overriding \code{df} or \code{eps1}, sweeping either as a
vector, or supplying an \code{n} that does not span \code{x$N} moves that point off the drawn
curve, so the marks are then omitted.
}
\examples{
pw <- efa_power(df = 100, N = 200)

# Power curve for the test of close fit, marking the object's own N
plot(pw)

# Overlay several models by sweeping the degrees of freedom
plot(pw, df = c(50, 100, 200))

# Sweep the alternative RMSEA instead
plot(pw, eps1 = c(0.06, 0.08, 0.10))
}
\references{
MacCallum, R. C., Browne, M. W., & Sugawara, H. M. (1996). Power analysis and
determination of sample size for covariance structure modeling. \emph{Psychological
Methods, 1}(2), 130-149. \doi{10.1037/1082-989X.1.2.130}
}
\seealso{
Other power analysis:
\code{\link[=efa_power]{efa_power()}},
\code{\link[=print.efa_power]{print.efa_power()}}
}
\concept{power analysis}
