\name{CFA} \alias{CFA} \alias{CFA.bifactor} \alias{irt.CFA} \title{Confirmatory Factor Analysis Without Iteration} \description{Factor analysis is a procedure for identifying latent variables thought to account for the correlations or covariances between observed variables. There are two approaches to factor analysis: Exploratory Factor Analysis (e.g., EFA using the \code{\link{fa}} function) and Confirmatory Factor Analysis (CFA). Perhaps the best way to do Confirmatory Factor Analysis is with the laavan package's cfa function. \code{\link{CFA}} in psych is a simple and more limited version for those who want to stay within the psych package and take advantage of various psych package options. \code{\link{CFA}} uses the direct approach (the multiple group method) using the Spearman/Guttman approach as discussed by Dhaene and Rosseel, 2025. } \usage{ CFA(model=NULL,x=NULL, all=FALSE, cor = "cor", use ="pairwise", n.obs = NA, orthog=FALSE, weight=NULL,correct=0, method="regression", missing=FALSE,impute="none",Grice=FALSE,n.iter=100) CFA.bifactor(model=NULL,x=NULL,all=FALSE,g=FALSE, cor="cor", use="pairwise", n.obs=NA, orthog=FALSE, weight=NULL, correct=0, method="regression", missing=FALSE,impute="none", Grice=FALSE , n.iter=1) irt.CFA(model=NULL,x=NULL,all=TRUE,n.obs=NA, orthog=FALSE, weight=NULL, correct=0, method="regression", missing=FALSE,impute="none", Grice=FALSE, plot=TRUE, n.iter=1, scores=FALSE) } \arguments{ \item{model}{If specified, the model can either be in lavaan syntax or a keys list such as those used in \code{\link{scoreItems}} or \code{\link{scoreOverlap}}. See examples. If the model is missing, then the analysis will be a for one factor model of all of the data. } \item{x}{A data matrix or correlation /covariance matrix. (If missing, then assumed to be the values of the first object.) } \item{all}{if TRUE, then do the analysis for all the variables in the r matrix. If FALSE, then select just those variables in the r matrix defined by the model.} \item{g}{if TRUE, find a hierarchical (higher level) model.} \item{cor}{How to find the correlations: "cor" is Pearson", "cov" is covariance, "tet" uses \code{\link{tetrachoric}}, "poly" uses \code{\link{polychoric}}, "mixed" uses \code{\link{mixedCor}} for a mixture of tetrachorics, polychorics, Pearsons, biserials, and polyserials, Yuleb is Yulebonett, Yuleq and YuleY are the obvious Yule coefficients as appropriate} \item{n.obs}{Number of observations if given a correlation/covariance matrix, defaults to 100} \item{orthog}{Should the factors be allowed to correlate (orthog=FALSE) or forced to be orthogonal (orthog=TRUE)} \item{use}{How to treat missing data, use="pairwise" is the default". See cor for other options.} \item{weight}{If not NULL, a vector of length n.obs that contains weights for each observation. The NULL case is equivalent to all cases being weighted 1.} \item{correct}{correction value for 0 values in tetrachoric correlation. See the discussion in \code{\link{tetrachoric}} for alternative values.} \item{method}{Correlations are by default found using Pearson. Alternative methods for the correlation may be Spearman or Kendall.} \item{missing}{if r is a data matrix, and missing=TRUE, then impute missing values using either the median or the mean. Specifying impute="none" will not impute data points and thus will have some missing data in the factor scores.} \item{impute}{"median" or "mean" values are used to replace missing values} \item{Grice}{If TRUE, use the Grice method for factor indeterminacy. } \item{plot}{should irt.CFA display the plots (defaults to TRUE)} \item{n.iter}{Number of bootstrap resamples of the CFA solution. Defaults to 100. } \item{scores}{If true, and given raw data, find irt based scores for the CFA based factors.} } \details{Most EFA and CFA functions use maximum likelihood functions to estimate the coefficients. However, as Maccallum et al. (2007), and Dhaene and Rosseel (2024) point out, ML approaches are not necessarily optimal for finite (e.g., small) samples. Maccallum et al. (2007) discuss why ML fails on some problems that minres procedures do not. Confirmatory factor analysis may be done without iteration (and thus not using Maximum Likelihood procedures) by using some very old techniques. The algorithm follows that of Dhaene and Rosseel (2024) using the ``Spearman" Multiple Group Method to estimate the communalities. This method was introduced by Guttman (1952) and is discussed by Harman (1967). \code{\link{CFA}} follows the Spearman approach for communalities discussed by Dhaene and Rosseel (2024) and described as the ``Multiple Group Method". I use the upper case name (CFA) to avoid conflicts with lavaan's cfa function. Following Harman (1967) (Chapter 7, p 115-117) the communality of each variable is estimated by the ratio of the sum of all the correlations to the sum of squared correlations with that variable. The square root of the communality is the factor loading. Guttman (1952) points out that a weighting matrix of -1, 0, and 1 times is essentially a regression model where the use of differential weights doesn't make much difference. \code{\link{CFA.bifactor}} first does a CFA on all of the variables, and then does another CFA using the model matrix or keys list on the residual correlation matrix. The results are in relatively close agreement with those from lavaan, but are not identical. To do a "S-1" solution (Eid, 2017; Li and Savalei, 2025) just specify a model with not all variables defined as group factors. Options for \code{\link{CFA.bifactor}} include solving the correlations as simple bi-factor model, or as a hierarchical/higher level model using the g=TRUE option. Graphical output in the examples shows the difference of the two approaches. Guttman and Harman's original method seem to be restricted to positive manifolds and finds the communalities based upon the the correlations. \eqn{h_i^2 =\frac{(\Sigma r_i)^2 -\Sigma r_i^2}{2(\Sigma r_{i