% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dimensionality.R
\name{plot_scree}
\alias{plot_scree}
\title{Scree plot of the residual components with parallel analysis}
\usage{
plot_scree(fit, n_components = 10, parallel = TRUE, reps = 20)
}
\arguments{
\item{fit}{A fitted object from \code{\link{rasch}}.}

\item{n_components}{Number of leading components to display.}

\item{parallel}{Draw the parallel-analysis reference line.}

\item{reps}{Model-simulated replicates for the reference.}
}
\value{
Called for its plotting side effect; invisibly the eigen table.
}
\description{
Eigenvalues of the residual correlation matrix for the leading components,
with a model-simulated parallel-analysis reference: responses are simulated
from the calibrated model (observed missingness kept), every person is
re-estimated, and the residual eigenvalues recomputed. Because estimating
the person locations couples the residuals within a person, this reference
sits above the classical random-normal one and is calibrated under the
fitted model (Raiche 2005; Chou & Wang 2010). Observed eigenvalues above
the reference suggest structure beyond what the model itself produces.
}
\examples{
set.seed(1)
d <- seq(-2, 2, length.out = 8)
X <- matrix(rbinom(500 * 8, 1, plogis(outer(rnorm(500), d, "-"))), 500, 8)
colnames(X) <- paste0("I", 1:8)
plot_scree(rasch(X))
}
\references{
Raiche, G. (2005). Critical eigenvalue sizes in standardized
  residual principal components analysis. \emph{Rasch Measurement
  Transactions}, 19(1), 1012.

  Chou, Y.-T., & Wang, W.-C. (2010). Checking dimensionality in item
  response models with principal component analysis on standardized
  residuals. \emph{Educational and Psychological Measurement}, 70(5),
  717-731.
}
