Confirmatory Factor Analysis — CFA

Dr. R. Düsing · Osnabrück University
📋 From Exploratory to Confirmatory Factor Analysis
Factor analysis (EFA) searched for the structure of the 8-item cognitive test (V1–V4 verbal, S1–S4 spatial). In confirmatory factor analysis (CFA), it's the other way around: theory specifies in advance which item loads on which factor — you test whether this structure fits the data. Here you set the true population on the left and, on the right, what the specified model assumes — and see how strongly the typical fit indices react when the two diverge.
← Factor Analysis (EFA): where does the structure come from? ← Measurement Models: 1-factor model classes Compare the same model across groups? → Measurement Invariance
Approach
Specify the model. The item→factor assignment is fixed (V group→F1, S group→F2). You only decide: may F1/F2 correlate, and is S1's cross-loading known to the model? → view path diagram
Fit to the population. The tool estimates the specified model's free parameters so that the implied covariance matrix comes as close as possible to the true one (maximum likelihood) — genuine estimation, not an analogy trick.
Check the fit. χ², CFI, TLI, RMSEA, SRMR show how well the fit succeeded. → view fit indices
Spot misspecification. Turn on "Orthogonal" or "Ignore" even though the population dictates otherwise — watch the fit collapse.
Path Diagram — Specified Model
Fit Indices
χ² (df)
N = 300
≥ .95 good
≥ .95 good
≤ .06 good
≤ .08 good
lavaan Syntax (R) — Matching the Specified Model
Cutoffs follow Hu & Bentler (1999). This tool fits itself via maximum likelihood on the (known) population-implied covariance matrix — lavaan would estimate the same structure on real data and additionally deliver standard errors/p-values for every parameter (not simulated here, see Help).
Flashcards
① EFA vs. CFA
In EFA, the data determine which item loads on which factor (all loadings free, then the pattern is interpreted). In CFA, theory fixes the structure in advance — most loadings are fixed at 0 (simple structure), only a few are free. The fit tests whether this restriction is compatible with the data.
② Why Misspecification Worsens Fit
Every fixation (e.g. "cross-loading = 0" or "Φ = 0") is an assumption. If it's correct, it costs nothing — the model still hits the true covariance matrix exactly. If it's wrong, the model can no longer reproduce the affected covariances; the residual difference drives χ² up and CFI/TLI down.
③ Degrees of Freedom Here
df = possible unique covariances/variances (8·9/2 = 36) minus estimated free parameters (8 loadings + 8 error variances + possibly 1 cross-loading + possibly 1 factor correlation). Every additional fixation (orthogonal, ignoring the cross-loading) increases df by 1 — the model becomes more parsimonious, but risks misfit.
④ TLI Above 1.00?
Unlike CFI, TLI is not capped at 1 — for a very parsimonious, well-fitting model (many df, little misfit), TLI can slightly exceed 1. That's not an error but a known property of the formula; lavaan shows the same effect.
⑤ What This Tool Doesn't Show
No real sampling, no standard errors/p-values for the loadings, no modification indices (which single fixation to relax?). N = 300 only serves to convert the population-implied discrepancy value into a realistic χ² — it's not actually simulated.
⑥ What's Next?
The next tool in this series extends CFA with structural paths between the factors (regression between latent variables instead of only between factor and items) — a structural equation model (SEM), with the same bridges to regression and mediation, just with latent instead of observed variables.
→ Structural Equation Model (SEM)
Confirmatory Factor Analysis — Background
What This Tool Shows — and What It Doesn't

Shows: a 2-factor CFA model with a fixed item-factor assignment, two misspecification switches (factor correlation, one cross-loading), and the resulting fit indices — via genuine maximum-likelihood fitting to the (known) population-implied covariance matrix, no analogy formula. Not here: real sampling/standard errors, free item-factor assignment, modification indices, multi-group CFA (→ Measurement Invariance).

Maximum Likelihood Discrepancy
F_ML(Σ, Σ(θ)) = log|Σ(θ)| + tr(Σ(θ)⁻¹Σ) − log|Σ| − p χ² = (N−1) · F_ML,min (N = 300, p = 8 items)

Σ is the true (population-implied) covariance matrix, Σ(θ) that of the specified model with the currently best parameters θ. The tool minimizes F_ML numerically over all free parameters (coordinate descent) — for a correctly specified model, this minimum lands at practically exactly 0.

Fit Indices — In Detail

Index "M" = specified model, "B" = baseline/independence model (all covariances fixed at 0 — the worst sensible comparison point conceivable). CFI and TLI set the fit relative to this zero point; RMSEA and SRMR are absolute misfit measures that need no comparison model.

CFI Comparative Fit Index · 0–1, higher = better
CFI = 1 − max(0, χ²_M−df_M) / max(χ²_B−df_B, χ²_M−df_M)
How much better is the model than the assumption of "no associations at all between the items"? Relative to the baseline model, hence bounded to [0,1] and comparatively robust with small samples.
TLI Tucker-Lewis Index · usually 0–1, can be >1
TLI = [(χ²_B/df_B) − (χ²_M/df_M)] / [(χ²_B/df_B) − 1]
Like CFI relative to the baseline model, but additionally parsimony-corrected — a model with many df (few estimated parameters) is favored given good fit. That's why it's not capped at 1 (see flashcard "TLI Above 1.00?").
RMSEA Root Mean Square Error of Approximation · 0–1, lower = better
RMSEA = √( max(0, (χ²_M−df_M) / (df_M·(N−1))) )
Misfit per degree of freedom, independent of a comparison model. Penalizes unnecessarily complex models (few df); common practice additionally reports a 90% confidence interval (not computed here, since no real sampling occurs).
SRMR Standardized Root Mean Square Residual · 0–1, lower = better
SRMR = square root of the mean squared standardized residual
The most direct measure: how far apart are the model and true correlation matrices on average? Weights every residual equally — a single strongly misspecified item (like S1 here) can therefore get lost if the remaining 27 cells fit perfectly.
Cutoffs are a heuristic, not a law of nature. The widely used thresholds CFI/TLI ≥ .95, RMSEA ≤ .06, SRMR ≤ .08 come from Hu & Bentler (1999) and are cited most often — but they were derived from a limited number of simulated model types and are not universally valid. How appropriate a cutoff is depends on the number of factors, number of items, sample size, and type of misspecification. Hu & Bentler themselves already pointed out that model-specific simulations are more accurate than fixed thresholds; more recent work (e.g. McNeish & Wolf, 2023, "Dynamic Fit Index") carries this forward consistently: for your own model structure, simulation determines which fit values are to be expected at which degree of misspecification — instead of relying on the generic .95/.06/.08 values that were calibrated for a completely different model.
The Two Misspecification Switches

Orthogonal forced: the model fixes Φ = 0, even though the factors truly correlate (φ slider). The resulting forced zero covariances between the V and S groups cannot be reproduced — the fit worsens systematically as the true φ grows.

Cross-loading ignored: the model fixes S1's loading on F1 at 0, even though it is truly nonzero (λx slider). The misfit concentrates on the 7 covariances between S1 and the remaining items — a classic example of a misspecification detectable via modification indices.

Why a Custom Optimizer?

For a misspecified model there is no closed-form formula for the best fit — it must be found numerically, exactly as lavaan does with real data. This tool implements a compact coordinate descent with line search over all free parameters (loadings, error variances, optionally factor correlation/cross-loading). For a correctly specified model, it demonstrably converges exactly back to the true values.

Literature

Hu, L. & Bentler, P. M. (1999). Cutoff criteria for fit indices. Structural Equation Modeling, 6, 1–55.
McNeish, D. & Wolf, M. G. (2023). Dynamic fit index cutoffs for confirmatory factor analysis models. Psychological Methods, 28(1), 61–88.
Marsh, H. W., Hau, K.-T. & Wen, Z. (2004). In search of golden rules: Comment on hypothesis-testing approaches to setting cutoff values for fit indexes. Structural Equation Modeling, 11(3), 320–341.
Brown, T. A. (2015). Confirmatory Factor Analysis for Applied Research (2nd ed.). Guilford.
Rosseel, Y. (2012). lavaan: An R Package for Structural Equation Modeling. Journal of Statistical Software, 48(2).
Kline, R. B. (2023). Principles and Practice of Structural Equation Modeling (5th ed.). Guilford Press.
Hoyle, R. H. (Ed.) (2023). Handbook of Structural Equation Modeling (2nd ed.). Guilford Press.
Bühner, M. (2021). Einführung in die Test- und Fragebogenkonstruktion (4th ed.). Pearson Studium.