% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/efa_kmo.R
\name{efa_kmo}
\alias{efa_kmo}
\title{Kaiser-Meyer-Olkin criterion}
\source{
Kaiser, H. F. (1970). A second generation little jiffy. Psychometrika,
35, 401-415.

Kaiser, H. F. & Rice, J. (1974). Little jiffy, mark IV. Educational
and Psychological Measurement, 34, 111-117.

Cureton, E. E. & D'Agostino, R. B. (1983). Factor analysis: An
applied approach. Hillsdale, N.J.: Lawrence Erlbaum Associates, Inc.
}
\usage{
efa_kmo(
  x,
  use = c("pairwise.complete.obs", "all.obs", "complete.obs", "everything",
    "na.or.complete"),
  cor_method = c("pearson", "spearman", "kendall", "poly", "tetra")
)
}
\arguments{
\item{x}{data.frame or matrix. Dataframe or matrix of raw data or matrix with
correlations.}

\item{use}{character. The missing-data policy for raw data. Passed to
\code{\link[stats:cor]{stats::cor()}} for \code{"pearson"}, \code{"spearman"}, and \code{"kendall"}; for \code{"poly"} /
\code{"tetra"} the same policies are applied to the raw data before the polychoric
estimation, where \code{"all.obs"} and \code{"everything"} abort on a missing value instead
of returning \code{NA} correlations. 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".}
}
\value{
A list containing
\item{KMO}{Overall KMO.}
\item{KMO_i}{KMO for each variable.}
\item{settings}{A list of the settings used.}
}
\description{
This function computes the Kaiser-Meyer-Olkin (KMO) criterion overall and for
each variable in a correlation matrix. The KMO represents the degree to
which each observed variable is predicted by the other variables in the
dataset and with this indicates the suitability for factor analysis.
}
\details{
Kaiser (1970) proposed this index, originally called measure of
sampling adequacy (MSA), that indicates how near the inverted correlation
matrix \eqn{R^{-1}} is to a diagonal matrix to determine a given
correlation matrix's (\eqn{R}) suitability for factor analysis.
The index is
\deqn{KMO = \frac{\sum_{i \neq j} r_{ij}^2}{\sum_{i \neq j} r_{ij}^2 + \sum_{i \neq j} q_{ij}^2}}
with \eqn{Q = SR^{-1}S} and S = \eqn{(diag R^{-1})^{-1/2}} where
\eqn{\sum_{i \neq j} r_{ij}^2} is the sum of squares of the off-diagonal
elements of \eqn{R} and \eqn{\sum_{i \neq j} q_{ij}^2} is the sum of squares of
the off-diagonal elements of \eqn{Q} (see also Cureton & D'Agostino, 1983).

So KMO varies between 0 and 1, with larger values indicating higher suitability
for factor analysis. Kaiser and Rice (1974) suggest that KMO should at least
exceed .50 for a correlation matrix to be suitable for factor analysis.

This function was heavily influenced by the \code{\link[psych:KMO]{psych::KMO()}}
function.

See also \code{\link[=efa_bartlett]{efa_bartlett()}} for another test of suitability for factor
analysis.

The \code{efa_kmo} function can also be called together with the
\code{\link[=efa_bartlett]{efa_bartlett()}} function and with factor retention criteria in the
\code{\link[=efa_retain]{efa_retain()}} function.
}
\examples{
efa_kmo(test_models$baseline$cormat)
}
\seealso{
\code{\link[=efa_bartlett]{efa_bartlett()}} for another measure to determine
suitability for factor analysis.

\code{\link[=efa_retain]{efa_retain()}} as a wrapper function for this function,
\code{\link[=efa_bartlett]{efa_bartlett()}} and several factor retention criteria.

Other factor analysis suitability:
\code{\link[=efa_bartlett]{efa_bartlett()}},
\code{\link[=efa_screen]{efa_screen()}},
\code{\link[=print.efa_screen]{print.efa_screen()}}
}
\concept{factor analysis suitability}
