% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/efa_scores.R
\name{efa_scores}
\alias{efa_scores}
\title{Estimate factor scores and score-quality diagnostics for an EFA model}
\source{
Thurstone, L. L. (1935). \emph{The vectors of mind}. University of Chicago
Press.

Bartlett, M. S. (1937). The statistical conception of mental factors.
\emph{British Journal of Psychology, 28}, 97-104.

Anderson, T. W., & Rubin, H. (1956). Statistical inference in factor
analysis. In \emph{Proceedings of the Third Berkeley Symposium on Mathematical
Statistics and Probability} (Vol. 5, pp. 111-150). University of California
Press.

Guttman, L. (1955). The determinacy of factor score matrices with
implications for five other basic problems of common-factor theory.
\emph{British Journal of Statistical Psychology, 8}, 65-81.

ten Berge, J. M. F., Krijnen, W. P., Wansbeek, T., & Shapiro, A. (1999).
Some new results on correlation-preserving factor scores prediction methods.
\emph{Linear Algebra and its Applications, 289}, 311-318.

Grice, J. W. (2001). Computing and evaluating factor scores. \emph{Psychological
Methods, 6}, 430-450.
}
\usage{
efa_scores(
  x,
  f,
  Phi = NULL,
  rho = NULL,
  method = c("regression", "Bartlett", "Anderson", "tenBerge", "Harman", "components")
)
}
\arguments{
\item{x}{data.frame or matrix. Raw data (needed to obtain factor scores) or a
correlation matrix (yields weights and diagnostics only). When \code{f} is a
directly supplied loading matrix, a correlation-matrix \code{x} also supplies the
correlations the weights are derived from; when \code{f} is an \code{\link[=efa_fit]{efa_fit()}} object,
its own fitted correlations are used instead (supply \code{rho} to derive the
weights from another matrix). \code{x} describes the model variables either way.
When raw data carry column names, they are matched to the model variables by
name (any extra columns are ignored, and a model variable missing from \code{x} is
an error). A named correlation matrix is likewise matched to the loading rows
by name; its row and column names must use the same order, and it must carry
one row and column for each model variable. Unnamed input is matched by
position.

Raw data are scored as supplied: no imputation is performed, so a case with a
missing value on any model variable receives \code{NA} scores (and is reported as
not scored). A model variable that carries no usable spread in \code{x} -- constant,
infinite, or observed fewer than twice -- is an error.}

\item{f}{object of class \code{\link[=efa_fit]{efa_fit()}}, an \code{efa_loadings} object, or a matrix of factor
loadings.}

\item{Phi}{matrix. Factor intercorrelations. Only used when a loading matrix is
supplied directly in \code{f}; taken from the \code{efa} object otherwise, in which
case a supplied \code{Phi} is ignored with a warning. Named rows and columns are
matched to the loading columns and must use the same order.
Default is \code{NULL}, in which case the factors are assumed uncorrelated.}

\item{rho}{matrix. Correlation matrix used to derive the scoring weights.
Defaults to \code{NULL}, in which case \code{f$orig_R} is used for an \code{efa} object; for
a directly supplied loading matrix, \code{x} itself when it is a correlation
matrix, and \code{cor(x, use = "pairwise")} otherwise. Pass a matrix here to score
against a correlation other than the one implied by \code{f}/\code{x}. Named rows and
columns are matched to the loading rows; row and column names must use the
same order.}

\item{method}{character. The factor-score method: one of \code{"regression"}
(default), \code{"Bartlett"}, \code{"Anderson"}, \code{"tenBerge"}, \code{"Harman"}, or
\code{"components"}.}
}
\value{
An object of class \code{efa_scores}, a list containing:

\item{weights}{The \code{p} by \code{m} factor-score weight matrix.}
\item{scores}{The factor scores (\code{n} by \code{m}), or \code{NULL} when a correlation
matrix was supplied. A case with a missing value on any model variable is not
scored and keeps \code{NA} in every column.}
\item{r.scores}{The \code{m} by \code{m} correlations of the factor-score estimates (see
Details for the \code{"components"}-method scale caveat).}
\item{score_cor}{The \code{m} by \code{m} score-factor correlation matrix; its diagonal
is the determinacy (validity) of each score and its off-diagonals the
univocality.}
\item{determinacy}{A data frame with, per factor, the determinacy \code{rho}, the
squared determinacy \code{rho2}, and Guttman's indeterminacy index \code{guttman}.}
\item{settings}{A list of the settings used, including the number of supplied
observations \code{n_obs} and the number of them that could be scored \code{n_scored}.}
}
\description{
Computes factor-score weights, and (from raw data) the factor scores
themselves, for an \code{\link[=efa_fit]{efa_fit()}} solution or a directly supplied loading matrix.
It also returns score-quality diagnostics: the score intercorrelations, the
determinacy (validity) and univocality of each score, and Guttman's
indeterminacy index. Factor scores are returned only when raw data are
supplied; a correlation matrix yields the weights and diagnostics alone.
}
\details{
Each method combines the loadings with some or all of the factor correlations and the
scoring correlation matrix into weights in a different way:
\describe{
\item{\code{"regression"}}{Thurstone's (1935) regression scores.}
\item{\code{"Bartlett"}}{Bartlett's (1937) scores.}
\item{\code{"Anderson"}}{Anderson & Rubin's (1956) scores.}
\item{\code{"tenBerge"}}{ten Berge, Krijnen, Wansbeek & Shapiro's (1999) scores.}
\item{\code{"Harman"}}{Harman's (1976) scores, based on an idealized variable (a
hypothetical variable that would correlate perfectly with the factor).}
\item{\code{"components"}}{Component scores. These are formed from the raw,
uncentered data (\code{X \%*\% W}) rather than the standardized data, so unlike
the other methods they are on the scale of the input variables. The
diagnostics below describe the standardized combination \code{scale(X) \%*\% W},
and therefore differ from the realized correlations of the returned scores
whenever the variables have unequal variances.}
}
The determinacy (validity) of a score is its correlation with the factor it
estimates, computed from the returned weights; for regression scores it is the
multiple correlation between the factor and the observed variables (Guttman,
1955; Grice, 2001). The off-diagonal score-factor correlations give the
univocality (the correlation of a score with the \emph{other} factors). Guttman's
(1955) indeterminacy index, \verb{2 rho^2 - 1}, is the minimum correlation between
two equally valid sets of scores. For a \code{method} other than \code{"regression"}
both quantities are specific to those scores: the determinacy is the method's
own score-factor correlation (never larger than the regression value), and
the reported \code{guttman} follows from it.

Determinacies close to 1 mean the scores stand in for the factor with little
loss; Grice (2001) regards values of about .90 and above as the level required
before scores are interpreted for individual cases, and treats lower values as
usable only for group-level research. The Guttman index makes the same point
more sharply, because a factor score is never the factor: at \code{rho = .90} two
equally valid sets of scores can still correlate as low as .62, and at
\code{rho = .80} as low as .28, so the rank order of cases is not unique.

Which \code{method} to prefer follows from what the scores are for. Regression
scores correlate most highly with the factor, but they are biased towards it
and correlate across factors even when the model is orthogonal. Bartlett
scores are conditionally unbiased, which makes them the choice when the scores
stand in for the factor in a later model. \code{"tenBerge"} reproduces the factor
intercorrelations \code{Phi}, so it is the choice when the scores will be correlated
with each other or with external variables. \code{"Anderson"} forces the scores to
be uncorrelated with unit variance and is appropriate only when the factors
themselves are orthogonal. \code{"components"} is a weighted sum of the observed
variables rather than an estimate of a common factor.
}
\examples{
# Weights and score diagnostics from an EFA on a correlation matrix
efa <- efa_fit(test_models$baseline$cormat, n_factors = 3, N = 500,
               estimator = "PAF", rotation = "oblimin")
fs <- efa_scores(test_models$baseline$cormat, f = efa)
fs
summary(fs)

# Factor scores from raw data (Bartlett method)
\donttest{
efa_raw <- efa_fit(GRiPS_raw, n_factors = 1, estimator = "PAF")
efa_scores(GRiPS_raw, f = efa_raw, method = "Bartlett")
}

# Loadings supplied directly, with the factor intercorrelations
efa_scores(test_models$baseline$cormat, f = efa$rot_loadings, Phi = efa$Phi)

}
\seealso{
\code{\link[=efa_fit]{efa_fit()}} for the solution these are computed from.

Other factor scoring:
\code{\link[=print.efa_scores]{print.efa_scores()}}
}
\concept{factor scoring}
