Confirmatory Factor Analysis (CFA)

The terms used in this chapter, such as latent variable, identification, and model fit, are defined in Key Terms in the SEM chapter.

Parameters of a CFA Model

A confirmatory factor analysis (CFA) is the measurement model on its own: each latent variable (factor) is measured by several items, and the factors may correlate. The table lists its parameters, with F for a factor and x for an item.

Symbol Parameter lavaan Meaning
λ (lambda) Factor loading F =~ x The relation between the factor and the item: how much the item changes when the factor increases by one unit.
ψ (psi) Factor variance and covariance F ~~ F, F1 ~~ F2 How much people differ on the factor. A small ψ means the differences between people are small. The covariance between two factors is also a ψ.
α (alpha) Factor mean F ~ 1 Usually fixed at 0 (see below).
τ (tau) Item intercept x ~ 1 The expected value of the item when the factor is 0. With the factor mean at 0, it is the item’s mean.
θ (theta) Residual variance x ~~ x The part of the item that the factor does not explain: measurement error plus anything specific to that item. Residuals are uncorrelated unless you add a residual covariance (x1 ~~ x2).
R² Explained variance (computed) The share of the item’s variance that the factor explains. In the standardized solution, R² = λ² = 1 − θ for an item that loads on one factor.

A factor has no scale of its own, so its mean and its unit have to be fixed before the model can be estimated (identification). In a single-group model, the factor mean α is fixed at 0. For the unit, either the first loading is fixed at 1 (fixed loading, the default in lavaan and Mplus) or the factor variance ψ is fixed at 1 (fixed variance); see step 5 of the Basic Procedure. In a multigroup model, the factor mean is fixed at 0 in one group only, so that the latent means of the other groups can be compared with it (see Multigroup Analysis).

How CFA Estimates the Model

Because the factor is not observed, the model cannot estimate λ by regressing each item on it. It starts instead from what the factor implies: items that measure the same factor correlate because they share that factor. From λ, ψ, and θ, the model computes the variances and covariances that the items should have, the model-implied covariance matrix. For items \(i\) and \(j\) on the same factor:

\[ \begin{aligned} \operatorname{cov}(x_i, x_j) &= \lambda_i \lambda_j \psi \\ \operatorname{var}(x_i) &= \lambda_i^2 \psi + \theta_i \end{aligned} \]

For items on two different factors, the covariance is \(\lambda_i \lambda_j \psi_{12}\), where \(\psi_{12}\) is the covariance of the two factors. The estimator looks for the parameter values that bring the implied matrix as close as possible to the covariance matrix in the data, and the χ² test asks whether the difference that is left is larger than chance. A non-significant χ² (p > .05) therefore means that there is no evidence that the model misfits. It does not prove the model right, and in large samples even trivial differences are significant (Note 1).

The degrees of freedom (df) are the pieces of information in the data minus the number of free parameters. With \(p\) items, the data give \(p(p + 1)/2\) variances and covariances plus \(p\) means. A factor with five items gives \(15 + 5 = 20\) pieces of information. The model estimates 4 loadings (the first is fixed at 1), 1 factor variance, 5 intercepts, and 5 residual variances, 15 in all, so df = \(20 - 15 = 5\). A factor with three items has df = \(9 - 9 = 0\): the model reproduces the data exactly, and its fit cannot be tested on its own. Under the Hood checks these numbers in R, and SEM by Hand derives the implied covariance matrix in matrix form and estimates the model step by step in R and Python.

Report Results

Fit Criteria

For a CFA, or the measurement part of any SEM, report the χ² test with its df and p-value, CFI, TLI, RMSEA with its 90% CI, and SRMR. Commonly used cutoffs for a good fit:

Index Good fit Source
χ² p > .05 Sensitive to sample size (Note 1)
χ²/df ≤ 2 or 3 Schreiber (2008)
CFI, TLI ≥ .95 Hu & Bentler (1999)
RMSEA ≤ .06 Hu & Bentler (1999)
SRMR ≤ .08 Hu & Bentler (1999)
Standardized loadings ≥ .50, ideally ≥ .70 Hair et al. (2009), as cited in Cheung et al. (2024)

Hu and Bentler (1999) proposed values close to these, not hard rules. With the MLR estimator, report the scaled χ² and the robust CFI, TLI, and RMSEA: the Scaled column and the Robust lines in lavaan’s output.

A standardized loading of .70 means that the factor explains 49% (.70²) of the item’s variance, about half. Cheung et al. (2024) also take sampling error into account: they look at the upper limit of the 90% CI of each standardized loading. If it is below .50, the item is a major concern; from .50 to below .70, a minor concern; at .70 or above, no concern.

A CFA

The two-factor model in CFA syntax could be reported like this:

The measurement model was estimated with robust maximum likelihood (MLR), and missing data were handled with full information maximum likelihood (FIML). The first loading of each factor was fixed at 1 and the factor means at 0. The model fit the data well (Hu & Bentler, 1999), χ²(43) = 54.15, p = .119, CFI = .993, TLI = .991, RMSEA = .024, 90% CI [.000, .041], SRMR = .032. All standardized loadings were significant (ps < .001) and ranged from .65 to .71, and the upper limit of each 90% CI was at least .70 (Cheung et al., 2024). The factors explained 42% to 50% of the variance of each item. FA1 and FB1 were correlated, r = .33, 95% CI [.23, .43].

Numbers for the Tables collects these values in R. A path diagram with the standardized estimates can go in the paper or its appendix:

Standardized solution of the two-factor model. Straight arrows: loadings. Curved arrow between the factors: their correlation. Curved arrows under the items: residual variances. All estimates p < .001.

If two factors are not significantly correlated, report the covariance and the correlation with its 95% CI in the same way, and say that the CI includes 0. The factor correlation is corrected for measurement error (Latent vs. Observed Correlation), so a non-significant correlation is not the result of attenuation by unreliable items, as it could be with sum scores.

A factor with three items is just-identified (df = 0; see How CFA Estimates the Model), and its fit indices show a perfect fit by construction (χ² = 0, CFI = 1, RMSEA = 0). Write, for example, “The model was just-identified because the factor has only three items, so its fit could not be evaluated”, report the loadings and R², and evaluate its fit as part of the full measurement or structural model.

Notes

  1. Reporting indices: different papers report different indices. You don’t need to report all of them, and they don’t all need to meet the cutoffs. Some indices are affected by factors such as sample size (e.g., the p-value of the chi-square test); if one doesn’t meet the cutoff, explain it in your paper.
  2. CFA is a must, although you don’t have to report it, depending on the length of your paper. If the CFA does not fit, the model built on it cannot be used.
  3. EFA and CFA must use different samples; they are different things. You can roughly think of the EFA as a pilot study.
  4. If you designed the questionnaire yourself, factor loadings > 0.5 (more leniently, 0.4) are acceptable; for previously validated questionnaires, > 0.6. Look up literature support for these cutoffs. Cheung et al. (2024) review the published rules: 0.4 for interpretation, and at least 0.5, ideally 0.7 (see Report Results).
  5. If the CFA fit is poor, you may need to delete items or further process the sample:
    1. If you use an established questionnaire, it’s better not to delete items casually (assuming you already have a large sample; otherwise your method may end up different from others’), unless your pilot study already revealed big problems (then you can redevelop the questionnaire).
    2. Problematic (very large) path coefficients may mean a problem with the model structure, or that the coefficients are not standardized.
    3. Your data quality is poor.
  6. A second-order factor model and a bifactor model are two different things.
    1. A second-order factor model needs to go back to theory: you can only fit a higher-order model when the total of the subscales (dimensions) is meaningful. For example, the dimensions of a personality scale are theoretically uncorrelated, so a second-order model doesn’t work and their total is meaningless; in that case, take each dimension (depending on your hypotheses) into the SEM separately.
    2. A second-order factor needs three or more first-order factors; with only two, extra constraints are needed (such as fixing loadings). The same goes for items: for a CFA, each factor should have three or more items.

Summary and Practice

Confirmatory factor analysis (CFA)

  • Variable types: Any (continuous and categorical variables)
  • When to use: How do you define and measure your operational variables?
  • Functions: lavaan package, cfa(); see CFA syntax, which also gives the Mplus version
  • Comment: lavaan is by far the most widely used SEM package in R. The official documentation and forum cover a lot of tutorials and answer the questions you may have. I recommend making good use of the official forum.
  • Resources: lavaan tutorial, UCLA OARC: Confirmatory Factor Analysis (CFA) in R with lavaan

Second-order CFA

Syntax

The code in this section runs in your browser and prints its output when the page loads. The first visit downloads lavaan, so the first results take a while to appear. You can edit any cell and run it again.

The examples use the scored version of the simulated dataset described in Example Data, in which A4 and A11 are already reverse-scored. Some items are missing, so every model uses missing = "fiml" with the MLR estimator (step 3 of the Basic Procedure).

One Factor

How to read the output:

  • Estimate is the unstandardized estimate. The first loading is 1 and has no SE because it is fixed.
  • Std.Err is its standard error, z-value is Estimate divided by Std.Err, and P(>|z|) is the p-value of z: |z| > 1.96 means p < .05.
  • Std.lv standardizes only the latent variables (factor variance 1), so the loadings stay in the units of the items; they are the estimates you get with std.lv = TRUE.
  • Std.all is the standardized solution, with the items standardized too: the standardized loadings under Latent Variables, and the standardized residual variances θ under Variances (the dot before an item name marks a residual).
  • The Std columns have no SEs or p-values; standardizedSolution(fit_b) gives them, with CIs.
  • R-Square is 1 − θ for each item.
  • With MLR, read the Scaled column of the χ² test and the Robust lines for CFI, TLI, and RMSEA. Here χ²(5) = 4.37, p = .497.

What cfa() Adds for You

The one-line model hides most of the parameters. cfa() adds them by default: it fixes the first loading at 1 and the factor mean at 0, and frees the factor variance, the item intercepts, and the residual variances. lavaan() adds nothing by itself, so the model below writes every parameter out. It gives the same χ², df, and number of parameters as the one-line model, and so does the fixed-variance version (std.lv = TRUE):

All three columns are identical. parTable(fit_b) lists every parameter with a free column (0 means fixed), the same check as TECH1 in Mplus.

Under the Hood: the Implied Covariance Matrix

With missing data, sampstat is the FIML estimate of the item covariances: the “observed” matrix that the model is compared with. The covariance of B2 and B3 computed by hand is 0.589, the value in the implied matrix; the data give 0.599. The χ² sums up such differences over the whole matrix. The last line is the df from How CFA Estimates the Model: 20 pieces of information minus 15 free parameters.

Two Factors

cfa() lets the factors correlate by default; writing FA1 ~~ FB1 gives the same model, and FA1 ~~ 0*FB1 makes them uncorrelated. With 11 items, the data give 66 + 11 = 77 pieces of information, and the model has 34 free parameters (9 loadings, 2 factor variances, 1 covariance, 11 intercepts, and 11 residual variances), so df = 43. These are the numbers in the write-up in Report Results, and the figure there shows the standardized solution.

Numbers for the Tables

The SE of A1 and B1 is 0 because their loadings are fixed: write a dash in the table. beta_ci_upper is the upper limit of the 90% CI that Cheung et al. (2024) use. Here every upper limit is at least .70 (the lowest, B5, is .701), so no item is a concern.

Latent vs. Observed Correlation

The correlation between two factors is free of measurement error. The correlation between sum scores is not: a sum score treats every item as error-free, so measurement error lowers (attenuates) its correlations. In the simulated data, the true correlation between the two constructs is 0.4 (see Example Data).

The sum scores correlate .27, the factors .33, 95% CI [.23, .43], which includes the true value. This is why the SEM chapter’s Notes recommend item-level data over averages (Note 4).

Syntax in Mplus

Many SEM papers use Mplus. This part runs in Mplus on your computer, not in the browser. Mplus reads a data file without column names, with missing values coded as a symbol. prepareMplusData() from the MplusAutomation package writes the items in that format (missing values as .) and returns the matching DATA and VARIABLE lines, including MISSING=.;.

library(MplusAutomation)
items <- mydata[, c(paste0("A", 1:6), paste0("B", 1:5))]
mplus_syntax <- prepareMplusData(items, "mydata.dat")
mplus_syntax

The two-factor model with Mplus defaults:

TITLE: Two-factor CFA;
DATA: FILE = mydata.dat;
VARIABLE: NAMES = A1-A6 B1-B5;
  MISSING = .;
ANALYSIS: ESTIMATOR = MLR;
MODEL:
  FA1 BY A1-A6;
  FB1 BY B1-B5;
  FA1 WITH FB1;
OUTPUT: SAMPSTAT STANDARDIZED TECH1 CINTERVAL;

The same model with every parameter written out, as in the lavaan version above:

MODEL:
  FA1 BY A1@1 A2-A6;  ! loadings; the first is fixed at 1
  FB1 BY B1@1 B2-B5;
  [FA1@0 FB1@0];      ! factor means fixed at 0
  FA1 FB1;            ! factor variances
  FA1 WITH FB1;       ! factor covariance
  [A1-A6 B1-B5];      ! item intercepts
  A1-A6 B1-B5;        ! residual variances

With missing data, Mplus uses FIML by default. STANDARDIZED prints the STDYX solution, which matches lavaan’s Std.all, and R-SQUARE; TECH1 numbers every free parameter, so you can check what Mplus estimated. If you need lavaan’s results to match Mplus output as closely as possible, add mimic = "Mplus" to cfa().

For the lavaan and Mplus operators side by side, see the quick reference in the SEM chapter.

Resources & References

Cheung, G. W., Cooper-Thomas, H. D., Lau, R. S., & Wang, L. C. (2024). Reporting reliability, convergent and discriminant validity with structural equation modeling: A review and best-practice recommendations. Asia Pacific Journal of Management, 41(2), 745-783. https://doi.org/10.1007/s10490-023-09871-y

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

Schreiber, J. B. (2008). Core reporting practices in structural equation modeling. Research in Social and Administrative Pharmacy, 4(2), 83-97. https://doi.org/10.1016/j.sapharm.2007.04.003