% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dimensionality.R
\name{residual_pca}
\alias{residual_pca}
\title{Principal components of the residual correlations}
\usage{
residual_pca(fit, n_components = 10)
}
\arguments{
\item{fit}{A fitted object from \code{\link{rasch}}.}

\item{n_components}{Number of leading components to return loadings and
eigenvalue rows for (capped at the number of items).}
}
\value{
A list with the residual \code{eigenvalues}, their
  \code{prop}ortions, the first-component \code{loadings} (sorted), the
  \code{loadings_matrix} for the leading components, the
  \code{eigen_table} (component, eigenvalue, proportion, cumulative), and
  the \code{first_eigen}value.
}
\description{
The first residual component (PC1) carries any second dimension; items with
opposing loadings define the split used by the unidimensionality t-test.
Loadings for the leading components and the eigenvalue table support
inspection beyond the first component.
}
\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)
residual_pca(rasch(X))$first_eigen
}
