Confirmatory Factor Analysis (CFA)

Do the questionnaire items measure the constructs they are supposed to measure? Confirmatory factor analysis tests a structure set in advance – which items belong to which factor – against the data: maximum likelihood (ML) estimation like lavaan, fit indices (χ², CFI, TLI, RMSEA with a confidence interval, SRMR, AIC, BIC), unstandardized and standardized loadings with R² for each item, correlations between the factors, composite reliability (ω) with a confidence interval alongside alpha, modification indices, a model diagram and a findings paragraph in English.

Calculator

Loading the data

Drag an Excel file or an SPSS file (.sav) here, or click to choose
In the site's standard template: row = participant, column = item, first row of headers. CSV is accepted too.
The items are numeric columns (item scores, without a summed scale score); negatively worded items – reverse them first (page Coding – from items to a scale score), so that all the loadings of a factor point in the same direction.
Just want to try it out? Download a sample data file (320 residents, 12 Likert items 1-7 in three scales – belonging, trust, participation – with a legend; the model is preset): English example
or

Paste columns directly from the sheet (including the header row) – select them in Excel, copy, and paste here:

A
B
C
D
E
F
You can also just paste – the data will be loaded and displayed automatically.

Model specification

Guide

When to use?

When the question is about structure: a 12-item questionnaire is supposed to measure three constructs – belonging to the community, trust in institutions and participation – four items per construct. Confirmatory factor analysis tests whether the data are consistent with this division. Pallant (2020, chapter 15) distinguishes between the two approaches: exploratory factor analysis (EFA) "is often used in the early stages of research to gather information about (explore) the interrelationships among a set of variables", whereas confirmatory factor analysis is "a more complex and sophisticated set of techniques used later in the research process to test (confirm) specific hypotheses or theories concerning the structure underlying a set of variables". Field (2024, section 18.4.1) phrases the same distinction – "whether you are exploring your data or testing a specific hypothesis" – and adds that testing hypotheses about the structure of latent variables and their relationships "requires a different software package (IBM SPSS AMOS, R or Mplus)". In EFA every item loads on every factor and the software finds the structure; in CFA the researcher determines in advance which item loads on which factor, and every other loading is fixed to zero – which is why the model can be tested.

Common uses: construct validity of a questionnaire (do the items cluster according to the theory), checking the unidimensionality of a scale before computing a score and alpha for it, comparing a one-factor structure with a multi-factor one (Table 7.21 of APA, 2020, is exactly such a comparison), and composite reliability (ω) – which does not assume equal loadings as alpha does. CFA is the "measurement model" of SEM: path analysis connects arrows between observed variables, CFA connects latent factors to items, and the structural equation model (full SEM) connects both – arrows between latent factors. Related pages: Cronbach's alpha and scale score, Reliability and validity – the concepts, Building a questionnaire.

The logic: from the model to the covariance matrix

The model. Each item is a loading (λ) times its factor, plus a residual unique to it (θ): x = λF + e. From this follows the covariance matrix that the model "expects" to see: Σ = ΛΦΛ′ + Θ – loadings, factor variances and correlations, and residual variances. Within a factor, the relationship between two items passes entirely through the factor (λ1λ2φ); between factors – through the correlation between them. Raykov (2024) describes the model of "congeneric" items – items that measure the same true score in different units and with different precision – as in practice identical to a one-factor model (Jöreskog, 1971, as cited in Raykov), and testable with four items or more.

Identification. A latent factor has no units of measurement – they have to be set. Rosseel (2012, section 4) describes the two ways: "(1) for each latent variable, fix the factor loading of one indicator (typically the first) to a constant (by convention, 1.0), or (2) standardize the variances of the latent variables". The first is the default of lavaan (and of AMOS), the second – std.lv = TRUE; both give the same fit, the same standardized coefficients and the same ω – only the unstandardized ones change. Degrees of freedom: the number of variances and covariances of p items, p(p + 1)/2, minus the number of estimated parameters. In Rosseel's example (nine tests, three factors) – 45 moments and 21 parameters: df = 24. Brown (2015, pp. 61-62) summarizes the identification rules: every factor must have units (marker or variance 1); the number of moments must be at least the number of parameters; a single factor needs at least three items – and with exactly three it is "just-identified" (df = 0), and "the evaluation of fit is not relevant", although the loadings can still be examined; a two-item factor is identified only when it is correlated with another factor, and "because such solutions are prone to empirical underidentification, a minimum of three indicators per latent variable is recommended".

Estimation. Maximum likelihood (ML) as in lavaan: search for the parameters that minimize the discrepancy between Σ and the observed matrix S, F = log|Σ| + tr(SΣ⁻¹) − log|S| − p, with S with divisor N and χ² = N·F; the standard errors – the expected information matrix (Information: Expected in the lavaan output). The page computes by Fisher scoring until the gradient is smaller than 10−10; on the Holzinger and Swineford data (1939, as cited in Rosseel) it reproduces the paper's output (χ²(24) = 85.306, CFI .931, RMSEA .092 [.071, .114], SRMR .065, modification indices 18.631, 36.411, 34.145, 14.946) and lavaan 0.6-17 in six models, and in seven models on the sample file.

How to read the output?

Table 1 – fit. As on the path analysis page: χ² with p (the model is the null hypothesis – a p greater than .05 is wanted), then CFI and TLI (above .95 good, above .90 acceptable), RMSEA with a 90% confidence interval (up to .06 good, up to .08 acceptable) and SRMR (up to .08) . Source of the cutoffs: Hu and Bentler (1999, p. 27), in simulations of CFA models, concluded that "a cutoff value close to .95" for TLI and CFI, "close to .08" for SRMR and "close to .06" for RMSEA are needed to conclude a relatively good fit, and recommended reading two indices together – SRMR plus one more. Brown (2015, pp. 74-75) stresses that the "close to" is not accidental: the cutoffs varied with the model conditions; alongside them he cites Browne and Cudeck (1993: RMSEA below .08 – "reasonable error of approximation"; .10 and above – reject), MacCallum et al. (1996: .08-.10 – "mediocre") and Bentler (1990: CFI and TLI between .90 and .95 – may indicate acceptable fit; below .90 – suspect the model), and also a criticism according to which the Hu and Bentler cutoffs are too conservative for CFA models with many items and factors (Marsh et al., 2004). Also from Hu and Bentler (p. 1): TLI and RMSEA tend to reject true models in a small sample. χ² is sensitive to sample size, so all the indices are read together – and Brown (p. 74) adds that overall fit is only part of the evaluation: also localized areas of strain (modification indices), also the interpretation of the estimates and the absence of Heywood cases. The baseline model for CFI/TLI – all items uncorrelated (Rosseel, 2012, Section 4.2).

Table 2 – loadings. For each item: the unstandardized loading (for the first item – 1, fixed, without a standard error), the standard error, z, p and a 95% confidence interval; the standardized loading (Std.all in lavaan – "both latent and observed variables are standardized", Rosseel, section 4.2) is the correlation between the item and the factor, and R² – its square: the proportion of the item's variance explained by the factor (in EFA terms – the "communality"; Field, 2024, section 18.4.2). Field (section 18.4.7) suggests ignoring the significance of the loading in a large sample, "especially given that the loading itself is an effect size", and interpreting loadings with an absolute value above .4 (Stevens, 2002, as cited in Field; some settle for .3) – "there is nothing magic about these numbers". The page flags a standardized loading below .40.

Table 3 – factors. The variance of each factor (in the marker method – in the units of the first item) and the correlations between the factors with a confidence interval. Brown (2015, p. 28): correlations between factors "in excess of .80 or .85" may indicate poor discriminant validity, and a more parsimonious solution may be preferable; on p. 147 he gives an example of his own – two factors with r = .87 that were merged into one factor. The page flags from .85; in such a case the page compares with a model with fewer factors (AIC/BIC and Δχ² – run both models). A correlation above 1 is an inadmissible solution.

Table 4 – reliability (ω section), Table 5 – modification indices (section below), the model diagram – ellipses for factors, rectangles for items, standardized loadings on the arrows and correlations on the arcs; APA (2020, Figure 7.8) gives an example of such a figure. The findings paragraph and the "Interpreting the result" box – as in the other calculators.

Composite reliability (ω)

Raykov (2024, equation 13, following Bollen, 1980, as cited in Raykov) gives the reliability of the sum score of congeneric items with uncorrelated errors: ρ = (Σλ)² / ((Σλ)² + Σθ) (in the identification where the factor variance is 1; in the marker method (Σλ)² is multiplied by the factor variance – the same value), and with correlated errors twice their covariances are added to the denominator (equation 15). This is the ω that the page prints for each factor, from the ML estimates ("the invariance property of ML estimators", equation 14), with a 95% confidence interval by the delta method (Raykov & Marcoulides, 2004, as cited in Raykov; Raykov also mentions the bootstrap). Brown (2015, pp. 309-316, equations 8.2-8.3) gives the same formula and a full example – a questionnaire of reactions to traumatic stress, 500 participants, two factors and a correlated residual: ρ = .919 and .823. The page's engine reproduces the example from the correlation matrix in the book – the loadings, the residuals, χ²(18) = 20.52 and both ρ values. Alongside it – Cronbach's alpha from the same participants.

Why both? Field (2024, section 18.9.3): alpha assumes "that all items load equally on a single factor" (tau-equivalence), an assumption that is "restrictive and patently unrealistic", and without it alpha underestimates reliability. Raykov (2024) adds the other side: with unequal but uniformly high loadings the difference is negligible, and with correlated errors alpha can actually exceed reliability – so he warns against "general calls to abandon alpha". What is compared in Table 4: ω clearly higher than α – the loadings differ from one another; both close – alpha is enough for this scale. ω is defined only in a model in which every item loads on one factor (with a cross-loading – not printed).

Modification indices

Rosseel (2012, section 4.2): "If the model fit is not superb, it may be informative to inspect the modification indices (MIs) and their corresponding expected parameter changes (EPCs)… modification indices give a rough estimate of how much the χ² would decrease if a particular parameter were freed. The expected parameter change is the value the parameter would have if it were included as a free parameter". Table 5 prints up to ten fixed parameters – cross-loadings and residual correlations – whose index exceeds 3.84 (χ²(1) at the .05 level), with the unstandardized and standardized EPC (sepc.all: for a loading – on the scale of a standardized loading, for residuals – a residual correlation). The 3.84 cutoff – Brown (2015, p. 102): the modification index is a χ² statistic with one degree of freedom, and from 3.84 upward "the overall fit of the model could be significantly improved" if the parameter were freed (in practice it is often rounded to 4). Caution: a modification index is a hint, not a license – Brown (p. 142) shows that modification indices can point to problems "that are not the true source of misfit", hence "the importance of an explicit substantive, conceptual and empirical basis" for any change. Any change to the model after looking at the data makes the analysis exploratory, and a fit improved this way will not replicate in another sample; free a parameter only when it has a substantive explanation (two items with almost identical wording – "I care about what happens in the community" and "What happens in my community is important to me" in the sample file), and report the original model and the change.

Assumptions and warnings

The model comes before the data. CFA tests a hypothesis about structure; if the structure is unknown – start with exploratory factor analysis (EFA), and test in another sample. Multivariate normality: ML estimation assumes it; a violation biases the χ² and the standard errors. Likert items: Rhemtulla et al. (2012, p. 354) compared in a simulation ML estimation with estimation for ordinal data in items with 2-7 categories, and recommended ordinal estimation "for items with fewer than 5 categories", and ML "when there are 5 or more categories, the sample is small and the category thresholds are approximately symmetric"; with 6-7 categories the results were similar in both methods. Two caveats: the ML tested there was with robust standard errors (on the page – ordinary ones), and ML was biased when the thresholds were highly asymmetric, mainly with high loadings (p. 370). Raykov (2024) reaches the same conclusion. Hence the example uses a 1-7 scale, and the page warns about an item with fewer than five values; for ordinal estimation (WLSMV) – see the R section.

Sample size. Brown (2015, p. 380) lists the common rules of thumb – "N ≥ 100-200", "at least 5-10 cases per freely estimated parameter" – and warns that "their generalizability to any given researcher's data is weak"; the exact way is a power analysis according to the model (his chapter 10 – not on the page). Field (2024, section 18.5.3, on EFA): "a sample of 300 or more will probably provide a stable factor solution", and the loadings and communalities also matter. The page warns according to the upper end of the rules Brown cites: fewer than 200 participants or fewer than five per parameter. Inadmissible solution (Heywood): "parameter estimates that have out-of-range values" (Brown, 2015, p. 61) – the most common is a negative residual variance, and in a model in which every item loads on one factor also a standardized loading above 1; "a measurement model should not be deemed acceptable" with such an estimate (p. 162). The causes according to Brown (p. 163): mainly a misspecified model, underidentification, and a small sample; the page shows the solution and flags it. Missing values – listwise deletion over all model items (the lavaan default; FIML – not on the page, see Missing values).

What the page does not compute. Second-order models (a factor of factors), robust estimation (MLR) and estimation for ordinal data (WLSMV), FIML, group comparisons and measurement invariance, equality constraints, factor scores, means (intercepts).

And how is it done in SPSS and AMOS?

SPSS Statistics has no CFA: the FACTOR command (Analyze › Dimension Reduction › Factor) is exploratory analysis only, and Pallant (2020, chapter 10) notes that it has no module for structural equation modeling, "but it does support an add-on called AMOS". In AMOS you draw: an ellipse for each factor, a rectangle for each item, an arrow from the factor to each of its items, a residual circle for each item (AMOS adds it and fixes its arrow to 1), and a two-headed arc between the factors; AMOS fixes the loading of the first item to 1 – like the default here. In Analysis Properties › Output check Standardized estimates, Squared multiple correlations and Modification indices. The expected differences: AMOS computes χ² as (N − 1)Fmin (Byrne, 2016, p. 93), whereas lavaan, Mplus and LISREL from version 9.1 – as N·F (Brown, 2015, p. 67), like the page; therefore χ² differs by a factor of (N − 1)/N and the standard errors by its square root; the loadings are identical. The page does not export SPSS syntax (there is nothing to run), but an R script (lavaan) of the defined model.

And how do you do it in R?

lavaan: each factor on a line with the operator =~ ("is measured by"; Rosseel, 2012, Table 1), a residual correlation with ~~, and cfa() adds by itself the residual variances, the factor variances and the correlations between them (ibid., Table 3). summary(fit, fit.measures = TRUE, standardized = TRUE) gives Tables 1-3, modindices() – Table 5. The "Download R script" button in the output writes the script of the model you defined; the script below was run as is on the sample file. The site's rule for Hebrew in R: a UTF-8 file, comments that start with an English word, short English names for the formula, and a UTF-8 locale for the sheet name and the Hebrew names (on Windows: R 4.2 or later, or Sys.setlocale('LC_ALL', 'Hebrew')).

# Confirmatory factor analysis – Professor Stat. This file is saved in UTF-8; every comment line starts with an English word
library(readxl)   # reading Excel
library(lavaan)   # cfa, fitMeasures, standardizedSolution, modindices

# Loading: the standard template – row = participant, column = item; the sheet "data"
d <- read_excel("C:/Rdata/DATA_cfa_example_eng.xlsx", sheet = "data")
items <- c(paste0("belong_", 1:4), paste0("trust_", 1:4), paste0("partic_", 1:4))
d <- as.data.frame(d[, items])
names(d) <- c(paste0("b", 1:4), paste0("t", 1:4), paste0("p", 1:4))   # short English names for the model

# The model: three correlated factors, four items each
model <- "
  belong =~ b1 + b2 + b3 + b4
  trust  =~ t1 + t2 + t3 + t4
  partic =~ p1 + p2 + p3 + p4
"
fit <- cfa(model, data = d)                     # ML, listwise deletion: 314 of 320
summary(fit, fit.measures = TRUE, standardized = TRUE, rsquare = TRUE)
# Table 1: χ²(51) = 51.083, p = .470; CFI 1.000, TLI 1.000 (.9999), RMSEA .002 [.000, .036], SRMR .031
# Table 2: b2 0.966 (SE 0.082), Std.all b1 .747 … t4 .333 (the reversed item – the weak loading)
# Table 3: factor correlations .509, .515, .253

# Table 5 – modification indices above 3.84, from largest to smallest
mi <- modindices(fit, sort. = TRUE)
mi[mi$mi > 3.84, c("lhs", "op", "rhs", "mi", "epc", "sepc.all")]   # b2 ~~ b3: 8.024, EPC 0.250, sepc.all .299

# Omega (ω) for each factor (Raykov, 2024, equation 13) from the estimates
est <- lavInspect(fit, "est")
sapply(colnames(est$lambda), function(f){ l <- est$lambda[, f]; i <- l != 0
  num <- sum(l[i])^2 * est$psi[f, f]; num / (num + sum(est$theta[i, i])) })   # .799, .726, .756

# Items with 2-4 response options: estimation for ordinal data (not on the page)
# fit_ord <- cfa(model, data = d, ordered = names(d), estimator = "WLSMV")

Reporting the results

Report the model (which items on which factors, whether the factors are correlated, the scale setting), the software and the estimation method, N and the handling of missing values; the fit (χ² with df and p, CFI, TLI, RMSEA with its confidence interval, SRMR); the standardized loadings (range, and in a table – all of them), the correlations between the factors and the reliability; and any change to the model after the first run – with the rationale. APA (2020, section 6.44) asks that the abbreviations CFA, CFI, RMSEA be defined at their first appearance; section 6.36 – no zero before the decimal point for what cannot exceed 1 (standardized loadings, correlations, R², ω, CFI, RMSEA, p), and with a zero for the unstandardized loadings. For comparing models (one factor vs. three) – a table like APA's Table 7.21: a row for each model with χ², df, fit indices and RMSEA, and a note describing each model. And instead of a long list of loadings – a figure with the coefficients (APA, 2020, Figure 7.8).

Common mistakes

"Confirming" a structure found in the same data. EFA followed by CFA on the same sample is not confirmation – it is the same structure twice.

Freeing parameters according to the modification indices until the fit is good. A model built from the data is exploratory; report the original model and every change with a rationale (Rosseel, 2012: the modification index is a "rough estimate").

Reading p < .05 of χ² as "good". The opposite – it is a rejection of the model; and in a large sample it is read together with the other indices.

Forgetting to reverse negative items. An item that was not reversed loads negatively and lowers ω and α; if the item has already been reversed and the loading is still weak (trust_4 in the example, .33) – it is a wording problem, not a coding problem.

Reporting only alpha. When the loadings differ from one another, ω is more accurate (Field, 2024, Section 18.9.3); report both, with a confidence interval.

Ignoring an inadmissible solution. A negative residual variance or a factor correlation above 1 means the model does not fit the data, even when the indices look good.

A factor with two items. Identified only through the correlation with another factor, and its estimates are unstable; at least three items per factor.

References

American Psychological Association. (2020). Publication manual of the American Psychological Association (7th ed.). https://doi.org/10.1037/0000165-000

Brown, T. A. (2015). Confirmatory factor analysis for applied research (2nd ed.). Guilford Press.

Byrne, B. M. (2016). Structural equation modeling with AMOS: Basic concepts, applications, and programming (3rd ed.). Routledge.

Field, A. (2024). Discovering statistics using IBM SPSS statistics (6th ed.). SAGE.

Hu, L., & Bentler, P. M. (1999). Cutoff criteria for fit indexes in covariance structure analysis: Conventional criteria versus new alternatives. Structural Equation Modeling: A Multidisciplinary Journal, 6(1), 1-55. https://doi.org/10.1080/10705519909540118

Pallant, J. (2020). SPSS survival manual: A step by step guide to data analysis using IBM SPSS (7th ed.). Routledge.

Raykov, T. (2024). Reliability. In A. L. Nichols & J. E. Edlund (Eds.), The Cambridge handbook of research methods and statistics for the social and behavioral sciences: Vol. 2. Performing research (pp. 189-210). Cambridge University Press.

Rhemtulla, M., Brosseau-Liard, P. É., & Savalei, V. (2012). When can categorical variables be treated as continuous? A comparison of robust continuous and categorical SEM estimation methods under suboptimal conditions. Psychological Methods, 17(3), 354-373. https://doi.org/10.1037/a0029315

Rosseel, Y. (2012). lavaan: An R package for structural equation modeling. Journal of Statistical Software, 48(2), 1-36. https://doi.org/10.18637/jss.v048.i02

Holzinger and Swineford (1939) – as cited in Rosseel (2012); Jöreskog (1971), Bollen (1980) and Raykov and Marcoulides (2004) – as cited in Raykov (2024); Stevens (2002) and Guadagnoli and Velicer (1988) – as cited in Field (2024); Bentler (1990), Browne and Cudeck (1993), MacCallum et al. (1996) and Marsh et al. (2004) – as cited in Brown (2015). According to the site's rule, the list of sources includes only sources that were read in the original. Site convention: the choice to flag from .85 (Brown: ".80 or .85") and to warn below 200 participants and five per parameter (the upper end of the rules Brown cites and criticizes). The computation on the page is verified against the lavaan 0.6-17 package in R.