% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/efa_scree.R
\name{efa_scree}
\alias{efa_scree}
\title{Scree plot}
\source{
Cattell, R. B. (1966). The scree test for the number of factors.
Multivariate Behavioral Research, 1(2), 245–276.
https://doi.org/10.1207/s15327906mbr0102_10

Zwick, W. R., & Velicer, W. F. (1986). Comparison of five rules for
determining the number of components to retain. Psychological Bulletin, 99,
432–442. https://doi.org/10.1037/0033-2909.99.3.432
}
\usage{
efa_scree(
  x,
  eigen_type = c("PCA", "SMC", "EFA"),
  use = c("pairwise.complete.obs", "all.obs", "complete.obs", "everything",
    "na.or.complete"),
  cor_method = c("pearson", "spearman", "kendall", "poly", "tetra"),
  n_factors = 1,
  estimate_control = NULL,
  ...
)
}
\arguments{
\item{x}{data.frame or matrix. Dataframe or matrix of raw data or matrix with
correlations.}

\item{eigen_type}{character. On what the eigenvalues should be found. Can be
either "PCA", "SMC", or "EFA", or some combination of them. If using "PCA",
the diagonal values of the correlation matrices are left to be 1. If using
"SMC", the diagonal of the
correlation matrices is replaced by the squared multiple correlations (SMCs)
of the indicators. If using "EFA", eigenvalues are found on the correlation
matrices with the final communalities of an exploratory factor analysis
solution (default is principal axis factoring extracting 1 factor) as
diagonal. Default is \code{c("PCA", "SMC", "EFA")}, i.e. all three; \code{"EFA"} is the
only one that fits a model.}

\item{use}{character. Passed to \code{\link[stats:cor]{stats::cor()}} if raw
data is given as input. Default is "pairwise.complete.obs".}

\item{cor_method}{character. Correlation computed from raw data: \code{"pearson"},
\code{"spearman"}, or \code{"kendall"} (passed to \code{\link[stats:cor]{stats::cor()}}), or \code{"poly"} /
\code{"tetra"} for polychoric / tetrachoric correlations of ordinal / binary data
(a two-step estimator).
Default is "pearson".}

\item{n_factors}{numeric. Number of factors to extract if "EFA" is included in
\code{eigen_type}. Default is 1.}

\item{estimate_control}{an \code{\link[=estimate_control]{estimate_control()}} object with the estimation settings for the
\code{\link[=efa_fit]{efa_fit()}} fit that provides the communalities when \code{"EFA"} is included in \code{eigen_type}.
\code{NULL} (default) uses the \code{\link[=efa_fit]{efa_fit()}} defaults. The fit is unrotated, so no rotation settings
apply.}

\item{...}{Additional arguments passed to \code{\link[=efa_fit]{efa_fit()}}. For example,
\code{estimator}, to change the estimator (PAF is default). The estimation tuning knobs are not
passed here; they live in \code{estimate_control}, and the standard-error arguments (\code{se},
\code{b_boot}, \code{ci}, \code{seed}) are not accepted because the fit is an internal step that keeps
only its communalities.}
}
\value{
An object of class \code{efa_retention} (see \code{\link[=print.efa_retention]{print.efa_retention()}} and
\code{\link[=plot.efa_retention]{plot.efa_retention()}} for the print and plot methods). The scree plot is a
visual criterion, so it returns no numeric suggestion. Its main fields are:
\item{results}{A list with one record per requested eigenvalue type, each
holding the eigenvalues used for the scree plot.}
\item{settings}{A list of the settings used.}
}
\description{
The scree plot was originally introduced by Cattell (1966) to perform the
scree test. In a scree plot, the eigenvalues of the factors / components are
plotted against the index of the factors / components, ordered from 1 to N
factors components, hence from largest to smallest eigenvalue. According to
the scree test, the number of factors / components to retain is the number of
factors / components to the left of the "elbow" (where the curve starts to
level off) in the scree plot.
}
\details{
As the scree test requires visual examination, the test has been
especially criticized for its subjectivity and with this low inter-rater
reliability. Moreover, a scree plot can be ambiguous if there are either no
clear "elbow" or multiple "elbows", making it difficult to judge just where
the eigenvalues do level off. Finally, the scree test has also been found to
be less accurate than other factor retention criteria. For all these reasons,
the scree test has been recommended against, at least for exclusive use as a
factor retention criterion (Zwick & Velicer, 1986)

The \code{efa_scree} function can also be called together with other factor
retention criteria in the \code{\link[=efa_retain]{efa_retain()}} function.
}
\examples{
efa_scree(test_models$baseline$cormat, eigen_type = c("PCA", "SMC"))
}
\seealso{
\code{\link[=efa_retain]{efa_retain()}} as a wrapper function for this and the other factor
retention criteria.

Other factor retention criteria:
\code{\link[=efa_cd]{efa_cd()}},
\code{\link[=efa_ekc]{efa_ekc()}},
\code{\link[=efa_hull]{efa_hull()}},
\code{\link[=efa_kgc]{efa_kgc()}},
\code{\link[=efa_map]{efa_map()}},
\code{\link[=efa_nest]{efa_nest()}},
\code{\link[=efa_parallel]{efa_parallel()}},
\code{\link[=efa_retain]{efa_retain()}},
\code{\link[=efa_smt]{efa_smt()}}
}
\concept{factor retention criteria}
