This guide introduces exploratory factor analysis (EFA) and confirmatory factor analysis (CFA), two of the most widely used techniques for studying the structure of latent variables in education, psychology and the social sciences. It combines theoretical background with hands-on application in R. Each section ends with a few self-check questions. You can move on even if some answers are not correct, and you will see feedback after each check. At the end, a worked example applies both techniques to the same dataset, step by step.
The guide is written for students, researchers and practitioners. No prior experience with factor analysis is assumed, but basic knowledge of correlation, variance and regression will help. Each section can be read on its own, so readers who are already familiar with EFA may move directly to the CFA or worked example sections.
Note on data collection. This page records anonymous usage data (for example, which sections are opened, answers to self-check questions and time spent) to improve the material. No personal information is collected unless you choose to fill in the optional form below. The data are used only in aggregate form, to see which parts of the guide are most useful and which questions are most difficult.
You may leave these fields empty and still use the whole guide. The information is used only to describe who uses the guide. No individual answers are reported with names or email addresses.
Factor analysis is a family of multivariate techniques that explain the correlations among a set of observed variables through a smaller number of unobserved variables called factors. Many constructs in the behavioural sciences, such as anxiety, motivation or mathematical ability, cannot be measured directly. We observe responses to items, test scores or ratings, and assume that these observed variables share variance because they are influenced by the same underlying construct (Hair et al., 2019; Pituch & Stevens, 2016; Tabachnick & Fidell, 2019). The idea goes back to Spearman (1904), and Thurstone (1947) extended it to several factors.
An observed (manifest) variable is something we measure directly, such as the response to a questionnaire item. A latent variable is a construct that is not measured directly but is inferred from several observed variables. The dimensions obtained in the analysis are called factors or components, depending on the extraction method. They are called factors when a common factor method such as principal axis factoring or maximum likelihood is used, and components when principal component analysis is used. Strictly speaking, components are weighted sums of the observed variables rather than latent variables, as explained in Section 2.2.
The common factor model assumes that the variance of each observed variable has two parts. The common variance is shared with other variables and explained by the factors. The unique variance is specific to that variable and includes measurement error. In matrix form, the observed correlation (or covariance) matrix is reproduced by the factor loadings, the factor correlations and the unique variances (Brown, 2015).
For a single item, the model can be written as
x = λ ξ + δ
where x is the observed score, λ is the factor loading, ξ is the latent factor and δ is the unique part. The loading λ shows how strongly the item reflects the factor, and the larger it is, the larger the common part of the item’s variance. With several factors and items the same idea is written in matrix form, with one row of loadings for each item.
Factor analysis is not a single technique but a family of related methods. These methods can be classified from several points of view, and one analysis usually belongs to several classes at once. For example, a CFA of ordinal Likert items with a second-order factor is confirmatory, uses a common factor model, is an item-level factor analysis and has a higher-order structure.
| Basis of classification | Types | Main idea |
|---|---|---|
| Purpose of the analysis | Exploratory (EFA), confirmatory (CFA), hybrid (ESEM) | Whether the structure is explored from the data, tested as specified in advance, or tested while allowing cross-loadings |
| Variance analysed | Component analysis (PCA), common factor analysis (PAF, ML, minres and others) | Whether total variance is summarised or only the variance shared among the variables is modelled |
| What is correlated | R-type, Q-type | R-type analyses correlations among variables across persons, which is the usual case, while Q-type analyses correlations among persons to group similar people (Hair et al., 2019) |
| Type of observed variables | Linear factor analysis, item factor analysis | Continuous variables are analysed with Pearson correlations, while ordinal or binary items are analysed with polychoric or tetrachoric correlations and suitable estimators (Flora & Curran, 2004) |
| Structure of the model | First-order, higher-order, bifactor | Whether the factors explain only the items, are themselves explained by a general factor, or appear alongside a general factor (Reise, 2012) |
| Groups and levels | Single-group, multigroup, multilevel | Whether one model is fitted to one sample, compared across groups, or estimated for nested data such as students within schools |
| Estimation framework | Frequentist, Bayesian | Whether parameters are treated as fixed values estimated from the data or as random variables with prior and posterior distributions (Muthén & Asparouhov, 2012) |
The most important distinctions for this guide are the purpose of the analysis and the variance analysed. Sections 2 and 3 discuss exploratory and confirmatory factor analysis in detail, including the classification of extraction methods and CFA model types. The hybrid and Bayesian approaches are introduced briefly in Section 4.
EFA and CFA are both based on the common factor model, yet they differ in several important ways. The table below summarises the main differences. Most of these points are discussed in more detail in Sections 2 and 3.
| Feature | EFA | CFA |
|---|---|---|
| Prior theory | Not required, the structure is explored | Required, a hypothesised structure is tested |
| Number of factors | Decided from the data | Fixed in advance by the researcher |
| Loadings | Every item loads on every factor | Only specified loadings are estimated, others are fixed (usually to zero) |
| Identification | Rotational indeterminacy, rotation is often used to aid interpretation | Identified by fixing a loading or the factor variance |
| Estimation | Extraction methods such as principal axis, maximum likelihood, minimum residual | Maximum likelihood, robust ML, WLSMV and others |
| Main outputs | Loadings, communalities, eigenvalues, explained variance | Parameter estimates, standard errors, model-data fit indices, residuals |
| Error covariances | Not modelled | Can be specified |
| Typical role | Theory building, early instrument development | Theory testing, construct validity, measurement invariance |
The flowchart shows how EFA and CFA fit together in one research process. When theory does not yet specify the structure, EFA explores it on one part of the sample, and the resulting structure is then tested with CFA on another part. When the structure is already known from theory, the researcher can go directly to CFA, and a poorly fitting model leads back to revision or further exploration.
You can try each question up to three times. After a correct answer, or after the third attempt, the correct answer and a short explanation are shown. Your answers do not affect your access to the next section.
EFA is used when the researcher does not have a firm hypothesis about how many factors underlie a set of variables or which variables belong to which factor. Every variable is allowed to load on every factor, and the structure is estimated from the data (Fabrigar et al., 1999; Tabachnick & Fidell, 2019). In this sense EFA is a data-driven technique, although the researcher still makes many decisions, such as the extraction method, the number of factors and the rotation. These decisions are described in the following subsections.
Exploring an unknown structure. When a construct is new or poorly understood, EFA shows how many dimensions the items form and how they group together. For example, a researcher who writes 40 items on teacher burnout can use EFA to see whether the items reflect one general burnout dimension or several related dimensions. The results then guide how the construct is defined and how the scale is scored.
Data reduction. Many correlated variables can be summarised by a few factors. Instead of analysing 30 separate attitude items, a researcher can work with three or four factor scores that keep most of the shared information. This simplifies later analyses, such as regression or group comparisons, and reduces problems caused by highly correlated predictors.
Instrument development and item selection. In the early stages of developing a test or questionnaire, EFA helps identify items that load weakly, load on more than one factor, or do not fit the intended structure. These items are revised or removed before the instrument is tested further. The aim is a shorter instrument whose items clearly represent the intended dimensions.
Checking dimensionality before other analyses. Many models, such as unidimensional item response theory models, assume a single dominant dimension. EFA is often used to check this assumption before fitting such models. If a single factor explains most of the common variance, the unidimensionality assumption is considered reasonable.
Generating hypotheses for CFA. The structure found with EFA can be stated as a model and tested with CFA, preferably on a different sample (see Section 5). In this way EFA generates a hypothesis and CFA tests it. Using the same sample for both steps makes the test less convincing, because the model was already shaped by those data.
The extraction method determines how the factors are estimated from the correlation matrix. Fabrigar et al. (1999) recommend maximum likelihood when the data are close to multivariate normal and principal axis factoring when this assumption is clearly violated. In practice, different common factor methods usually give similar results when the data are of good quality. The main families of methods are summarised in the table below.
| Method | Main idea | Notes |
|---|---|---|
| Principal axis factoring (PAF) | Analyses only the common variance by placing communality estimates on the diagonal | No distributional assumption, widely used |
| Maximum likelihood (ML) | Finds the parameters most likely to have produced the observed correlations | Assumes multivariate normality, gives a chi-square test and fit indices |
| Minimum residual (minres) or unweighted least squares (ULS) | Minimises the residual correlations | Robust, works well with polychoric correlations |
| Generalised least squares (GLS) | Weights residuals by the inverse of the correlation matrix | Less common in practice |
| Alpha factoring and image factoring | Maximise reliability of factors or analyse the image (shared) part of each variable | Mainly of historical interest |
| Principal component analysis (PCA) | Summarises the total variance with weighted composites | A component method, not a common factor model (see the note below) |
A note on PCA. PCA is often listed together with EFA, and many software packages run it by default. However, PCA analyses the total variance of the variables and makes no distinction between common and unique variance. Its components are exact linear combinations of the observed variables, whereas factors are latent variables that explain only the shared variance. PCA is therefore a data reduction technique, while EFA is a model for latent constructs. When the aim is to understand latent constructs, common factor methods are preferred (Costello & Osborne, 2005; Fabrigar et al., 1999).
The choice of correlation matrix also matters. Pearson correlations suit continuous variables. For ordinal items, such as five-point Likert items, polychoric correlations usually give more accurate results, and tetrachoric correlations are used for dichotomous items.
| Term | Meaning |
|---|---|
| Factor loading | The relationship between a variable and a factor. In an orthogonal solution it is the correlation between them |
| Communality (h²) | The proportion of a variable’s variance explained by all factors together |
| Uniqueness (u²) | The part of variance not explained by the factors, equal to 1 − h² |
| Eigenvalue | The amount of variance explained by a factor across all variables |
| Explained variance | The percentage of total variance accounted for by each factor and by all factors together |
| Pattern matrix | Unique contribution of each factor to a variable, used for interpretation in oblique solutions |
| Structure matrix | Simple correlations between variables and factors in oblique solutions |
| Factor correlation matrix (Φ) | Correlations among factors after an oblique rotation |
| Simple structure | A pattern in which each variable loads strongly on one factor and weakly on the others (Thurstone, 1947) |
| Cross-loading | A variable with a substantial loading on more than one factor |
| Heywood case | An improper solution in which a communality reaches or exceeds 1 |
When more than one factor is extracted, the initial solution can be rotated to make it easier to interpret. Rotation turns the factor axes so that each variable loads highly on as few factors as possible, which Thurstone (1947) called simple structure. It does not change the communalities or the fit of the model, and the same rotations are used to interpret principal components (Browne, 2001).
Rotation methods fall into two families. Orthogonal rotations keep the factors uncorrelated, so the loadings can be read as correlations between variables and factors. Oblique rotations allow the factors to correlate, and their results are read from the pattern matrix, the structure matrix and the factor correlation matrix.
| Method | Family | Main idea | When to use |
|---|---|---|---|
| Varimax | Orthogonal | Maximises the variance of the squared loadings within each factor, so each factor has a few high and many near-zero loadings (Kaiser, 1958) | Uncorrelated factors are expected, or uncorrelated component scores are needed, as in PCA for data reduction |
| Quartimax | Orthogonal | Simplifies the rows, so that each variable loads mainly on one factor | A strong general factor is expected, because quartimax tends to produce one |
| Equamax | Orthogonal | A compromise between varimax and quartimax | Rarely needed, tried when neither varimax nor quartimax gives a clear solution |
| Direct oblimin (quartimin when δ = 0) | Oblique | Minimises the cross-products of loadings, and the δ parameter controls how strongly the factors may correlate | The default oblique choice in most software, suitable when the factors are expected to correlate |
| Promax | Oblique | Starts from a varimax solution and raises the loadings to a power to obtain an oblique target (Hendrickson & White, 1964) | Large data sets, because it is fast and usually gives results close to oblimin |
| Geomin | Oblique or orthogonal | Minimises the geometric mean of the squared loadings in each row, which tolerates some cross-loadings | Complex structures with expected cross-loadings, and the default rotation in ESEM |
| Target (Procrustes) | Oblique or orthogonal | Rotates the solution towards a pattern specified by the researcher, with some loadings set to zero | Partial prior theory, as a bridge between EFA and CFA |
| Bifactor (bi-quartimin, bi-geomin) | Oblique or orthogonal | Rotates towards one general factor and several specific factors (Jennrich & Bentler, 2011) | A general factor and specific factors are both expected |
In practice an oblique rotation is a good first choice, because most
constructs in education and psychology are related (Costello &
Osborne, 2005; Fabrigar et al., 1999). Tabachnick and Fidell (2019)
suggest that if the factor correlations stay below about .32, an
orthogonal solution is also justified, and the two solutions will then
be very similar. In R, the rotation is chosen with the rotate argument
of fa() and principal() in the psych package,
and the GPArotation package provides the oblique and target
rotations.
The first EFA is rarely the final one. In instrument development and in data reduction, variables that do not fit the structure are identified and removed, and the analysis is run again with the remaining variables. This applies equally to items, manifest variables and indicators, and to PCA when components are used as summary scores.
Several criteria are commonly used to identify problematic variables. They should always be weighed together with the content of the variables, because removing an item only for statistical reasons can narrow the meaning of a construct. The most common criteria are listed below.
Variables are removed one at a time, starting with the most problematic one, because removing one variable changes all the other loadings. After each removal the number of factors, the loadings and the explained variance are checked again. The process stops when the structure is clear and stable, and every removed variable is reported together with the reason for its removal.
When the aim is data reduction, the final solution is estimated once more with the retained variables only. Factor or component scores are then computed from this final solution and used in later analyses, such as regression or group comparisons. The code below shows the general pattern, using the calibration sample of Section 5 and one item as an example of a removed variable.
# remove a problematic item and re-run the analysis
keep <- setdiff(names(calib), "O4")
efa_final <- fa(calib[, keep], nfactors = 5, fm = "minres", rotate = "oblimin", cor = "poly")
print(efa_final$loadings, cutoff = .30, sort = TRUE)
# scores for data reduction, from the final EFA or from a PCA
fs_final <- factor.scores(calib[, keep], efa_final, method = "regression")$scores
pca_final <- principal(calib[, keep], nfactors = 5, rotate = "varimax", scores = TRUE)
head(pca_final$scores)You can try each question up to three times. After a correct answer, or after the third attempt, the correct answer and a short explanation are shown. Your answers do not affect your access to the next section.
CFA tests whether a structure specified in advance fits the observed data. The researcher decides the number of factors, which indicators load on which factor, whether factors correlate and whether any residuals covary, all based on theory or previous research (Brown, 2015; Jöreskog, 1969). In this sense CFA is a theory-driven technique, and the result is a judgement about how well the specified model reproduces the observed covariances. The following subsections describe when CFA is used, the types of models and the steps of the analysis.
Testing a hypothesised structure. CFA checks whether data collected with an instrument support the structure proposed by theory or by earlier studies. For example, a researcher using a published five-dimension motivation scale in a new population can test whether the five-factor structure still holds. A good fit supports using the scale in that population, while a poor fit suggests that the structure needs to be examined further.
Gathering construct validity evidence. CFA provides evidence of convergent validity (indicators of the same factor load strongly on it) and discriminant validity (factors that should be distinct are not too highly correlated). Standardised loadings, average variance extracted and factor correlations are the main sources of this evidence. These indices are described in Section 3.6.
Comparing competing models. Alternative structures, such as one factor versus several correlated factors, can be compared formally with fit indices and difference tests. The aim is to find the model that explains the data well with as few parameters as possible. Comparing models in this way is often more informative than testing a single model.
Testing measurement invariance. Multigroup CFA examines whether an instrument measures the same construct in the same way across groups, such as gender, language or country. This is a prerequisite for meaningful group comparisons. Invariance is usually tested in steps, from configural to metric, scalar and strict invariance.
Building the measurement model of SEM. Before testing relationships among latent variables, the measurement part of the model is established with CFA (Section 3.2). If the measurement model fits poorly, the results of the structural model cannot be interpreted with confidence. For this reason the measurement model is always checked first.
Modelling method effects. CFA can include correlated residuals, for instance among negatively worded items, which EFA cannot do directly. Such method effects occur when items share wording or format rather than content. Ignoring them can distort the loadings and lead to poor model fit.
CFA is a special case of structural equation modeling (SEM). An SEM has two parts. The measurement model links the latent variables to their indicators, and this part is a CFA. The structural model specifies directional paths among the latent variables, such as motivation predicting achievement. A CFA model is therefore an SEM in which the latent variables are only allowed to correlate, with no directional paths among them. For this reason CFA and SEM share the same software, estimators, identification rules and fit indices (Kline, 2023). Anderson and Gerbing (1988) recommended a two-step approach, in which the measurement model is first tested with CFA and the structural model is tested only after an acceptable measurement model has been obtained. The LISREL program developed by Jöreskog and Sörbom (1993) played a key role in making both CFA and SEM widely available.
| Model | Description | Typical use |
|---|---|---|
| One-factor (unidimensional) model | All indicators load on a single factor | Testing unidimensionality |
| Correlated first-order factors | Several factors, each measured by its own indicators, with correlations among factors | The most common CFA model |
| Orthogonal first-order factors | As above, but factor correlations are fixed to zero | Rarely realistic, used for comparison |
| Second-order (higher-order) model | First-order factors are themselves explained by a more general factor | When correlated factors share a common general construct |
| Bifactor model | Every indicator loads on a general factor and on one specific factor, which are uncorrelated | Separating general and specific variance (Reise, 2012) |
| Multigroup CFA | The same model is fitted in several groups with increasing equality constraints | Measurement invariance |
| MIMIC model | Covariates predict the latent factors and, optionally, the indicators | Group differences and differential item functioning |
| Congeneric, tau-equivalent and parallel models | Loadings and error variances are free, loadings equal, or both equal | Testing assumptions behind reliability coefficients |
CFA and SEM models are usually presented as path diagrams. A path diagram shows the variables of a model and the relationships among them with a small set of symbols, so that the whole model can be read at a glance. The figure below shows a two-factor model with three indicators per factor, drawn in the classical LISREL notation (Jöreskog & Sörbom, 1993).
| Symbol | Name | Meaning |
|---|---|---|
| Oval or circle | Latent variable | An unobserved construct, such as a factor, inferred from its indicators |
| Rectangle or square | Manifest (observed) variable or indicator | A variable measured directly, such as an item score |
| Single-headed straight arrow | Path | A directional relationship, pointing from the cause to the effect |
| Value on a single-headed arrow (λ) | Path coefficient | The size of a directional effect, which is a factor loading in CFA |
| Two-headed curved arrow between two variables (φ) | Covariance or correlation | A non-directional relationship, shown as a correlation in the standardised solution |
| Two-headed curved arrow on one variable | Variance | The variance of a latent variable or of an error term |
| Small circle pointing to an indicator (δ or ε) | Error term | The unique part of an indicator that is not explained by its factor |
| Value attached to an error term (θ) | Error (residual) variance | The variance of the error term, which equals 1 minus the squared loading for a standardised indicator of one factor |
| Latent variable with no arrows pointing to it | Exogenous variable | A variable whose causes are not part of the model |
| Latent variable with arrows pointing to it (ζ) | Endogenous variable and disturbance | A variable explained by other variables in the model, with its unexplained part called the disturbance |
In a CFA all factors are usually exogenous, and they are connected only by two-headed arrows. Directional arrows between factors, and therefore endogenous factors with disturbances, appear only when the model is extended to a full structural equation model (Section 3.2). The path diagrams of the worked example in Section 5.6 use the same symbols.
| Term | Meaning |
|---|---|
| Indicator | An observed variable used to measure a latent factor |
| Factor loading | The regression coefficient of an indicator on its factor, reported in unstandardised and standardised form |
| Residual (error) variance | Indicator variance not explained by the factor |
| Free, fixed and constrained parameters | Parameters that are estimated, set to a value, or forced to equal other parameters |
| Scaling the factor | Giving each latent variable a metric by fixing one loading to 1 (marker variable) or the factor variance to 1 |
| Identification | Whether a unique solution exists. Models can be under-identified, just-identified or over-identified |
| Degrees of freedom | Number of observed variances and covariances, p(p + 1)/2, minus the number of free parameters |
| Model-implied covariance matrix | The covariance matrix reproduced by the model parameters |
| Model-data fit | How closely the model-implied matrix reproduces the observed matrix |
| Residual matrix | Differences between observed and model-implied covariances or correlations |
| Modification index | Expected decrease in chi-square if a fixed parameter were freed |
| Nested models | Models where one can be obtained from the other by constraining parameters |
| Index | Full name | Type | Good fit | Acceptable fit | Source |
|---|---|---|---|---|---|
| χ² | Chi-square test of exact fit | Absolute | p > .05 | Sensitive to sample size, interpreted together with other indices | Kline (2023) |
| χ²/df | Normed (relative) chi-square | Absolute | ≤ 2 | ≤ 3 (some authors accept ≤ 5) | Schermelleh-Engel et al. (2003) |
| GFI | Goodness-of-Fit Index | Absolute | ≥ .95 | ≥ .90 | Jöreskog and Sörbom (1993); Schermelleh-Engel et al. (2003) |
| AGFI | Adjusted Goodness-of-Fit Index | Absolute | ≥ .90 | ≥ .85 | Schermelleh-Engel et al. (2003) |
| RMR | Root Mean Square Residual | Absolute, residual-based | Close to 0 | Depends on the scale of the variables | Jöreskog and Sörbom (1993) |
| SRMR | Standardized Root Mean Square Residual | Absolute, residual-based | ≤ .05 (≤ .08 in Hu and Bentler) | ≤ .10 | Hu and Bentler (1999); Schermelleh-Engel et al. (2003) |
| WRMR | Weighted Root Mean Square Residual | Absolute, residual-based (WLS estimators) | ≤ 1.0 | Experimental, used with caution | Yu (2002) |
| RMSEA | Root Mean Square Error of Approximation | Absolute, parsimony-adjusted | ≤ .05 (≤ .06 in Hu and Bentler) | ≤ .08 (.08 to .10 mediocre) | Steiger (1990); Browne and Cudeck (1993); Hu and Bentler (1999) |
| PCLOSE | p value for test of close fit (RMSEA ≤ .05) | Absolute | > .05 | > .01 | Browne and Cudeck (1993) |
| NFI | Normed Fit Index | Incremental | ≥ .95 | ≥ .90 | Bentler and Bonett (1980) |
| NNFI (TLI) | Non-Normed Fit Index (Tucker-Lewis Index) | Incremental | ≥ .95 | ≥ .90 | Tucker and Lewis (1973); Bentler and Bonett (1980); Hu and Bentler (1999) |
| CFI | Comparative Fit Index | Incremental | ≥ .95 | ≥ .90 | Bentler (1990); Hu and Bentler (1999) |
| RFI | Relative Fit Index | Incremental | ≥ .95 | ≥ .90 | Bollen (1986) |
| IFI | Incremental Fit Index | Incremental | ≥ .95 | ≥ .90 | Bollen (1989) |
| PGFI | Parsimony Goodness-of-Fit Index | Parsimony | Higher is better | ≥ .50 | Mulaik et al. (1989) |
| PNFI | Parsimony Normed Fit Index | Parsimony | Higher is better | ≥ .50 | James et al. (1982); Mulaik et al. (1989) |
| CN | Hoelter’s Critical N (at α = .05 or .01) | Sample adequacy | ≥ 200 | Below 200 suggests the sample may be too small for the model | Hoelter (1983) |
| AIC | Akaike Information Criterion | Information criterion | Smaller is better | No cut-off, used to compare models | Akaike (1987) |
| BIC | Bayesian Information Criterion | Information criterion | Smaller is better | No cut-off, used to compare models | Schwarz (1978) |
| ECVI | Expected Cross-Validation Index | Information criterion | Smaller than the saturated and independence models | No cut-off, used to compare models | Browne and Cudeck (1993) |
Absolute indices assess how well the model reproduces the observed
data. Incremental indices compare the model with a baseline model in
which all variables are uncorrelated. Parsimony indices penalise complex
models, and information criteria are used to compare competing models
fitted to the same data. Cut-off values are guidelines rather than
strict rules, and they depend on sample size, model complexity, the
estimator and the type of data (Hu & Bentler, 1999; Marsh et al.,
2004). Several indices from different families should therefore be
reported together. In R, fitMeasures(fit) in the lavaan
package returns most of these indices.
Hoelter’s critical N depends on the significance level chosen for the χ² test. It is the largest sample size at which the χ² test would not reject the model, and it is usually reported for α = .05 and α = .01, which correspond to 95% and 99% confidence. Values of 200 or more are commonly taken to show that the sample is large enough for the model (Hoelter, 1983).
You can try each question up to three times. After a correct answer, or after the third attempt, the correct answer and a short explanation are shown. Your answers do not affect your access to the next section.
The classical distinction between EFA and CFA has been extended by several newer approaches. This section gives a short overview. Each approach deserves a detailed treatment of its own.
In the Bayesian approach, model parameters such as loadings, factor correlations and residual variances are treated as random variables with prior distributions. The data update these priors into posterior distributions, which are usually approximated with Markov chain Monte Carlo (MCMC) methods. Results are reported as posterior means or medians with credible intervals rather than point estimates with p values.
A key idea is the use of small-variance priors (Muthén & Asparouhov, 2012). In classical CFA, cross-loadings and residual covariances are fixed to exactly zero, which is often too strict. Bayesian SEM replaces these exact zeros with approximate zeros by giving the parameters priors centred at zero with a small variance. Model fit is evaluated with posterior predictive checks, such as the posterior predictive p value. In R, Bayesian CFA can be estimated with the blavaan package (Merkle & Rosseel, 2018).
A separate, detailed document on Bayesian factor analysis is in preparation.
ESEM combines features of EFA and CFA. Like EFA, it allows all cross-loadings and uses rotation, and like CFA and SEM, it provides standard errors, fit indices and the possibility of including the factors in larger structural models (Asparouhov & Muthén, 2009). ESEM is especially useful for multidimensional instruments, such as personality inventories, where strict CFA models with zero cross-loadings often show poor fit and inflated factor correlations (Marsh et al., 2014).
EGA comes from network psychometrics. It estimates a network of partial correlations among the items and uses a community detection algorithm to identify clusters of items, which correspond to dimensions. Simulation studies showed that EGA performs comparably to or better than parallel analysis in estimating the number of dimensions (Golino & Epskamp, 2017). EGA is available in the EGAnet package in R.
Regularization adds a penalty, such as the lasso, to the estimation so that small loadings are shrunk towards zero. This produces a simpler structure without fixing parameters to zero in advance and offers an alternative to rotation and to modification-index-driven model changes (Jacobucci et al., 2016). Regularized SEM is available in packages such as regsem and lslx.
Machine learning methods are increasingly used for decisions in factor analysis. The factor forest approach trains a machine learning model on many simulated datasets with known structures and then predicts the number of factors for new data from features such as eigenvalues and sample size (Goretzko & Bühner, 2020). Neural network models such as autoencoders are also discussed as nonlinear extensions of factor analytic ideas. These approaches belong to the growing field of psychometric data science, which connects classical measurement models with data-driven methods.
You can try each question up to three times. After a correct answer, or after the third attempt, the correct answer and a short explanation are shown. Your answers do not affect your access to the next section.
In this section EFA and CFA are applied in order to the same dataset, so that the connection between the two techniques can be followed step by step. The structure is first explored on one half of the sample and then tested on the other half. Each code block is followed by an interpretation of its output.
An earlier, shorter application with the SPSS Anxiety Questionnaire (SAQ) from Field (2018), including PCA, EFA, a second-order CFA and model modifications, is available in Demir (2022), at rpubs.com/Symrna/EFA_CFA. Readers who would like a second example can work through that document as well. Comparing the two examples shows how the same steps apply to a teaching dataset and to an established personality model.
The five-factor model of personality is one of the most widely supported models in psychology (McCrae & John, 1992). The bfi dataset in the psychTools package contains responses of 2,800 participants to 25 items from the International Personality Item Pool (Goldberg, 1999), collected as part of the SAPA project (Revelle et al., 2010). Each item is answered on a six-point scale from very inaccurate (1) to very accurate (6), and five items measure each of the five factors. The dataset also contains gender, education and age.
| Factor | Items | Reverse-keyed items |
|---|---|---|
| Agreeableness | A1 to A5 | A1 |
| Conscientiousness | C1 to C5 | C4, C5 |
| Extraversion | E1 to E5 | E1, E2 |
| Neuroticism | N1 to N5 | none |
| Openness | O1 to O5 | O2, O5 |
The items. The wording of all 25 items is stored in
the bfi.dictionary object of the psychTools package. Each
item is a short statement that participants rate for how accurately it
describes them. Items marked with −1 are reverse keyed, so a higher
response means a lower level of the trait named in the Big6 column.
| Item | Wording | Trait (Big6) | Aspect (Little12) | Keying |
|---|---|---|---|---|
| A1 | Am indifferent to the feelings of others. | Agreeableness | Compassion | −1 |
| A2 | Inquire about others’ well-being. | Agreeableness | Compassion | 1 |
| A3 | Know how to comfort others. | Agreeableness | Compassion | 1 |
| A4 | Love children. | Agreeableness | Compassion | 1 |
| A5 | Make people feel at ease. | Agreeableness | Compassion | 1 |
| C1 | Am exacting in my work. | Conscientiousness | Orderliness | 1 |
| C2 | Continue until everything is perfect. | Conscientiousness | Orderliness | 1 |
| C3 | Do things according to a plan. | Conscientiousness | Orderliness | 1 |
| C4 | Do things in a half-way manner. | Conscientiousness | Industriousness | −1 |
| C5 | Waste my time. | Conscientiousness | Industriousness | −1 |
| E1 | Don’t talk a lot. | Extraversion | Sociability | −1 |
| E2 | Find it difficult to approach others. | Extraversion | Sociability | −1 |
| E3 | Know how to captivate people. | Extraversion | Assertiveness | 1 |
| E4 | Make friends easily. | Extraversion | Sociability | 1 |
| E5 | Take charge. | Extraversion | Assertiveness | 1 |
| N1 | Get angry easily. | Emotional Stability | Balance | −1 |
| N2 | Get irritated easily. | Emotional Stability | Balance | −1 |
| N3 | Have frequent mood swings. | Emotional Stability | Balance | −1 |
| N4 | Often feel blue. | Emotional Stability | Balance | −1 |
| N5 | Panic easily. | Emotional Stability | Balance | −1 |
| O1 | Am full of ideas. | Openness | Intellect | 1 |
| O2 | Avoid difficult reading material. | Openness | Intellect | −1 |
| O3 | Carry the conversation to a higher level. | Openness | Intellect | 1 |
| O4 | Spend time reflecting on things. | Openness | Openness | 1 |
| O5 | Will not probe deeply into a subject. | Openness | Openness | −1 |
Columns of the item dictionary. Typing
bfi.dictionary[1:25, ] in R shows seven columns for each
item. ItemLabel is the code of the item in the SAPA item pool (for
example q_146 for A1), and Item is the wording shown to the
participants. Giant3 groups the traits into three broad factors, with
Agreeableness as Cohesion, Conscientiousness and Neuroticism as
Stability, and Extraversion and Openness as Plasticity.
Big6 gives the trait each item belongs to, and Little12 gives the narrower aspect within that trait, such as Orderliness and Industriousness within Conscientiousness. Keying shows the direction of the item, with 1 for positively keyed and −1 for reverse keyed items. IPIP100 refers to the scale of the 100-item IPIP Big Five markers from which the item was taken, for example B5:A for Agreeableness.
The dictionary names the fifth trait Emotional Stability, which is the opposite pole of Neuroticism. For this reason all five N items are marked −1, because they are keyed relative to Emotional Stability. In this guide the factor is interpreted as Neuroticism, so the N items are not reversed and only A1, C4, C5, E1, E2, O2 and O5 are reverse scored. Note also that the Giant3 grouping differs from the higher-order model in Section 5.5, which places Agreeableness under stability following DeYoung (2006) and Digman (1997).
The role of EFA with an established model. The Big Five is an established theory, and the items are not being developed here. EFA therefore does not serve to select items or redefine the scale. Its role is to check whether the expected five-factor structure emerges from the data without imposing it, and to see where the data depart from simple structure, for example through cross-loadings. CFA then tests the theoretical model formally. This is a common and legitimate sequence when an instrument is used in a new sample.
The analyses use the psych package (Revelle, 2026) for EFA, lavaan (Rosseel, 2012) for CFA, semTools (Jorgensen et al., 2026) for reliability and validity, and semPlot (Epskamp, 2015) for path diagrams. All packages are freely available on CRAN and can be installed with the first line of the code below.
# install.packages(c("psych", "psychTools", "GPArotation", "lavaan", "semTools", "semPlot"))
library(psych) # EFA, PCA, polychoric correlations, KMO, Bartlett's test, parallel analysis, reliability
library(psychTools) # example datasets (bfi) and item dictionaries
library(GPArotation) # rotation methods such as oblimin and geomin
library(lavaan) # CFA, SEM and ESEM estimation, fit indices, factor scores
library(semTools) # composite reliability (omega), AVE and other SEM tools
library(semPlot) # path diagrams of CFA and SEM models
col1 <- "#1F6F8B"; col2 <- "#E07A5F"; col_title <- "#123F52" # colours used in the figures
head(bfi) A1 A2 A3 A4 A5 C1 C2 C3 C4 C5 E1 E2 E3 E4 E5 N1 N2 N3 N4 N5 O1 O2 O3 O4 O5 gender
61617 2 4 3 4 4 2 3 3 4 4 3 3 3 4 4 3 4 2 2 3 3 6 3 4 3 1
61618 2 4 5 2 5 5 4 4 3 4 1 1 6 4 3 3 3 3 5 5 4 2 4 3 3 2
61620 5 4 5 4 4 4 5 4 2 5 2 4 4 4 5 4 5 4 2 3 4 2 5 5 2 2
61621 4 4 6 5 5 4 4 3 5 5 5 3 4 4 4 2 5 2 4 1 3 3 4 3 5 2
61622 2 3 3 4 5 4 4 5 3 2 2 2 5 4 5 2 3 4 4 3 3 3 4 3 3 1
61623 6 6 5 6 5 6 6 6 1 3 2 1 6 5 6 3 5 2 2 3 4 3 5 6 1 2
education age
61617 NA 16
61618 NA 18
61620 NA 17
61621 NA 17
61622 NA 17
61623 3 21
ItemLabel Item Giant3 Big6
A1 q_146 Am indifferent to the feelings of others. Cohesion Agreeableness
A2 q_1162 Inquire about others' well-being. Cohesion Agreeableness
A3 q_1206 Know how to comfort others. Cohesion Agreeableness
A4 q_1364 Love children. Cohesion Agreeableness
A5 q_1419 Make people feel at ease. Cohesion Agreeableness
C1 q_124 Am exacting in my work. Stability Conscientiousness
C2 q_530 Continue until everything is perfect. Stability Conscientiousness
C3 q_619 Do things according to a plan. Stability Conscientiousness
C4 q_626 Do things in a half-way manner. Stability Conscientiousness
C5 q_1949 Waste my time. Stability Conscientiousness
E1 q_712 Don't talk a lot. Plasticity Extraversion
E2 q_901 Find it difficult to approach others. Plasticity Extraversion
E3 q_1205 Know how to captivate people. Plasticity Extraversion
E4 q_1410 Make friends easily. Plasticity Extraversion
E5 q_1768 Take charge. Plasticity Extraversion
N1 q_952 Get angry easily. Stability Emotional Stability
N2 q_974 Get irritated easily. Stability Emotional Stability
N3 q_1099 Have frequent mood swings. Stability Emotional Stability
N4 q_1479 Often feel blue. Stability Emotional Stability
N5 q_1505 Panic easily. Stability Emotional Stability
O1 q_128 Am full of ideas. Plasticity Openness
O2 q_316 Avoid difficult reading material. Plasticity Openness
O3 q_492 Carry the conversation to a higher level. Plasticity Openness
O4 q_1738 Spend time reflecting on things. Plasticity Openness
O5 q_1964 Will not probe deeply into a subject. Plasticity Openness
Little12 Keying IPIP100
A1 Compassion -1 B5:A
A2 Compassion 1 B5:A
A3 Compassion 1 B5:A
A4 Compassion 1 B5:A
A5 Compassion 1 B5:A
C1 Orderliness 1 B5:C
C2 Orderliness 1 B5:C
C3 Orderliness 1 B5:C
C4 Industriousness -1 B5:C
C5 Industriousness -1 B5:C
E1 Sociability -1 B5:E
E2 Sociability -1 B5:E
E3 Assertiveness 1 B5:E
E4 Sociability 1 B5:E
E5 Assertiveness 1 B5:E
N1 Balance -1 B5:N
N2 Balance -1 B5:N
N3 Balance -1 B5:N
N4 Balance -1 B5:N
N5 Balance -1 B5:N
O1 Intellect 1 B5:O
O2 Intellect -1 B5:O
O3 Intellect 1 B5:O
O4 Openness 1 B5:O
O5 Openness -1 B5:O
A1 A2 A3 A4 A5 C1 C2 C3 C4 C5 E1 E2 E3 E4 E5 N1 N2 N3 N4 N5 O1 O2 O3 O4 O5
16 27 26 19 16 21 24 20 26 16 23 16 25 9 21 22 21 11 36 29 22 0 28 14 20
[1] 2436
# Reverse score the negatively keyed items (six-point scale)
rev_items <- c("A1", "C4", "C5", "E1", "E2", "O2", "O5")
items[rev_items] <- 7 - items[rev_items]
describe(items) vars n mean sd median trimmed mad min max range skew kurtosis se
A1 1 2436 4.59 1.41 5 4.78 1.48 1 6 5 -0.84 -0.28 0.03
A2 2 2436 4.80 1.18 5 4.97 1.48 1 6 5 -1.12 1.01 0.02
A3 3 2436 4.60 1.31 5 4.79 1.48 1 6 5 -1.01 0.46 0.03
A4 4 2436 4.69 1.49 5 4.92 1.48 1 6 5 -1.02 0.02 0.03
A5 5 2436 4.54 1.27 5 4.70 1.48 1 6 5 -0.84 0.13 0.03
C1 6 2436 4.53 1.24 5 4.66 1.48 1 6 5 -0.87 0.32 0.03
C2 7 2436 4.37 1.32 5 4.50 1.48 1 6 5 -0.74 -0.15 0.03
C3 8 2436 4.30 1.29 5 4.41 1.48 1 6 5 -0.68 -0.15 0.03
C4 9 2436 4.45 1.38 5 4.59 1.48 1 6 5 -0.61 -0.59 0.03
C5 10 2436 3.69 1.63 4 3.74 1.48 1 6 5 -0.06 -1.23 0.03
E1 11 2436 4.02 1.63 4 4.14 1.48 1 6 5 -0.37 -1.09 0.03
E2 12 2436 3.85 1.61 4 3.93 1.48 1 6 5 -0.23 -1.15 0.03
E3 13 2436 3.98 1.35 4 4.05 1.48 1 6 5 -0.47 -0.46 0.03
E4 14 2436 4.41 1.47 5 4.58 1.48 1 6 5 -0.82 -0.32 0.03
E5 15 2436 4.39 1.34 5 4.53 1.48 1 6 5 -0.78 -0.11 0.03
N1 16 2436 2.94 1.58 3 2.84 1.48 1 6 5 0.37 -1.02 0.03
N2 17 2436 3.52 1.53 4 3.52 1.48 1 6 5 -0.08 -1.06 0.03
N3 18 2436 3.22 1.59 3 3.17 1.48 1 6 5 0.14 -1.18 0.03
N4 19 2436 3.20 1.57 3 3.14 1.48 1 6 5 0.20 -1.09 0.03
N5 20 2436 2.97 1.62 3 2.85 1.48 1 6 5 0.38 -1.07 0.03
O1 21 2436 4.81 1.13 5 4.96 1.48 1 6 5 -0.90 0.46 0.02
O2 22 2436 4.32 1.55 5 4.47 1.48 1 6 5 -0.62 -0.76 0.03
O3 23 2436 4.45 1.21 5 4.57 1.48 1 6 5 -0.77 0.32 0.02
O4 24 2436 4.93 1.19 5 5.13 1.48 1 6 5 -1.24 1.18 0.02
O5 25 2436 4.53 1.32 5 4.68 1.48 1 6 5 -0.76 -0.18 0.03
A note on warning messages. When you run the code yourself, R may print warning messages that are not shown on this page. For example, the polychoric correlations can produce warnings about empty response categories, and lavaan warns when a solution contains negative variances. Such warnings do not stop the analysis, but they should be read, and the lavaan warning for the higher-order model is discussed in Section 5.5.
Listwise deletion is used here to keep the example simple. In applied work, full information maximum likelihood or multiple imputation is usually preferable when data are missing. In this dataset the proportion of missing values is small, so listwise deletion has little effect on the results.
Interpretation. Of the 2,800 participants, 364 have at least one missing item response, so 2,436 complete cases remain for the analyses. After reverse scoring, higher scores on every item indicate a higher level of the trait it measures. The results reported in this section were obtained with the seed 2026 and may differ slightly with other R or package versions.
When EFA and CFA are run on the same data, the CFA is not a real test of the model. The EFA has already shaped the model to fit that particular sample, including its random fluctuations, so a good CFA fit is partly circular. This problem is known as capitalising on chance (MacCallum et al., 1992).
The solution is cross-validation. The sample is randomly divided into two halves. The first half, the calibration sample, is used for EFA. The second half, the validation sample, is used for CFA. If the structure found in the first half also fits well in the second half, there is stronger evidence that it is not specific to one sample (Worthington & Whittaker, 2006). Three practical points should be considered.
Ideally, the final model should also be confirmed in a completely new sample. Cross-validation within one sample is a useful first step, but it cannot replace replication in an independent study. Results that hold across different samples and populations provide the strongest evidence.
set.seed(2026)
n <- nrow(items)
idx <- sample(seq_len(n), size = floor(n / 2))
calib <- items[idx, ] # EFA
valid <- items[-idx, ] # CFA
round(cbind(calib = colMeans(calib), valid = colMeans(valid)), 2) calib valid
A1 4.58 4.61
A2 4.79 4.80
A3 4.59 4.61
A4 4.70 4.68
A5 4.54 4.55
C1 4.56 4.49
C2 4.38 4.36
C3 4.34 4.26
C4 4.51 4.39
C5 3.80 3.59
E1 3.99 4.05
E2 3.85 3.84
E3 3.98 3.99
E4 4.39 4.43
E5 4.40 4.38
N1 2.91 2.97
N2 3.46 3.57
N3 3.19 3.26
N4 3.16 3.25
N5 2.95 2.99
O1 4.83 4.79
O2 4.34 4.29
O3 4.47 4.43
O4 4.92 4.93
O5 4.57 4.49
Interpretation. Each half contains 1,218 cases. The largest difference between the item means of the two halves is 0.22 points on the six-point scale, and most differences are much smaller, so the two halves are comparable. Any differences in the results of the two analyses are therefore not caused by systematic differences between the halves.
This code is optional and only needed if you start with the EFA part in a new R session, without running the earlier sections. It loads the packages and creates the objects that this part uses. The results are the same as when the whole guide is run in order.
library(psych); library(psychTools); library(GPArotation)
library(lavaan); library(semTools); library(semPlot)
col1 <- "#1F6F8B"; col2 <- "#E07A5F"; col_title <- "#123F52" # colours used in the figures
# data preparation (Section 5.2)
items <- na.omit(bfi[, 1:25])
rev_items <- c("A1", "C4", "C5", "E1", "E2", "O2", "O5")
items[rev_items] <- 7 - items[rev_items]
# splitting the data (Section 5.3)
set.seed(2026)
idx <- sample(seq_len(nrow(items)), size = floor(nrow(items) / 2))
calib <- items[idx, ] # EFA
valid <- items[-idx, ] # CFAFactorability and number of factors.
Kaiser-Meyer-Olkin factor adequacy
Call: KMO(r = R)
Overall MSA = 0.85
MSA for each item =
A1 A2 A3 A4 A5 C1 C2 C3 C4 C5 E1 E2 E3 E4 E5 N1 N2 N3 N4
0.80 0.83 0.87 0.89 0.91 0.86 0.80 0.87 0.83 0.87 0.84 0.89 0.91 0.88 0.89 0.77 0.77 0.87 0.88
N5 O1 O2 O3 O4 O5
0.87 0.88 0.79 0.83 0.77 0.78
$chisq
[1] 12162.82
$p.value
[1] 0
$df
[1] 300
Parallel analysis suggests that the number of factors = 6 and the number of components = NA
map_res <- vss(calib, n = 8, cor = "poly", plot = FALSE) # includes Velicer's MAP
round(map_res$map, 3)[1] 0.033 0.027 0.025 0.021 0.017 0.018 0.021 0.024
plot(1:8, map_res$map, type = "b", pch = 19, col = col1, lwd = 2.5, bty = "l", las = 1,
xlab = "Number of components removed", ylab = "Average squared partial correlation",
main = "Velicer's MAP test", col.main = col_title)
k <- which.min(map_res$map)
points(k, map_res$map[k], pch = 21, cex = 2.2, col = col2, lwd = 2)
text(k, map_res$map[k], paste("minimum at", k), pos = 1, offset = 1.2, col = col2)How to read the MAP test. The vss()
output reports the average squared partial correlation after 1, 2, 3 and
more components have been removed. In this sample the values are .033,
.027, .025, .021, .017, .018, .021 and .024 for one to eight components,
so the curve falls until five components and rises again from six. The
minimum at five components means that removing a sixth component no
longer takes away common variance among the items, and the MAP test
therefore suggests five factors. Unlike the Kaiser rule and parallel
analysis, the MAP test tends to underestimate rather than overestimate
the number of factors when it errs, so the two criteria complement each
other.
Parallel analysis may suggest more factors than the theory predicts. This is a good opportunity to discuss why the number of factors should not be decided by a single criterion. The results of all criteria are interpreted together below.
Interpretation. The overall KMO value is .85, which Kaiser (1974) describes as meritorious, and the lowest item-level value is .77 (N2), so every item is suitable for factor analysis. Bartlett’s test is significant, χ²(300) = 12,162.82, p < .001, so the correlation matrix is clearly different from an identity matrix. Both checks therefore support continuing with factor analysis.
Rpoly <- polychoric(calib)$rho
pal_r <- colorRampPalette(c(col2, "#F7F7F7", col1))(101)
par(mar = c(4, 4, 3, 6))
image(1:25, 1:25, Rpoly[, 25:1], col = pal_r, zlim = c(-1, 1), axes = FALSE,
xlab = "", ylab = "", main = "Polychoric correlations among the 25 items",
col.main = col_title)
axis(1, at = 1:25, labels = colnames(Rpoly), las = 2, tick = FALSE, cex.axis = 0.75)
axis(2, at = 1:25, labels = rev(colnames(Rpoly)), las = 1, tick = FALSE, cex.axis = 0.75)
abline(v = c(5.5, 10.5, 15.5, 20.5), h = c(5.5, 10.5, 15.5, 20.5), col = "white", lwd = 2.5)
par(xpd = TRUE)
for (i in 1:100) rect(26.2, 3 + (i - 1) * 0.19, 27.0, 3 + i * 0.19, col = pal_r[i], border = NA)
text(27.3, c(3, 12.5, 22), c("-1", "0", "1"), adj = 0, cex = 0.8)Figure 1. Polychoric correlations among the 25 items in the calibration sample, with blue for positive and red for negative correlations. The five darker blocks along the diagonal show that items of the same trait correlate more strongly with each other than with items of other traits. The correlations range from −.40 to .78, and the negative values come mostly from Neuroticism items, which relate inversely to the other traits.
The criteria for the number of factors do not fully agree. Two criteria suggest six factors and two suggest five, as summarised in the table below. Such disagreement is common in practice, especially with large samples.
| Criterion | Suggested number of factors |
|---|---|
| Kaiser rule (eigenvalues 5.94, 2.90, 2.23, 2.01, 1.69, 1.06, 0.81) | 6 |
| Parallel analysis | 6 |
| Velicer’s MAP test | 5 |
| Theory (five-factor model) | 5 |
The sixth eigenvalue (1.06) is only slightly above 1. Because both the five- and six-factor solutions are plausible, both are examined below and the decision is made by looking at the content of the factors. A solution with more factors should be preferred only if the extra factor is meaningful and interpretable.
Parallel analysis suggests that the number of factors = 6 and the number of components = NA
x <- 1:12
plot(x, pa$fa.values[x], type = "b", pch = 19, col = col1, lwd = 2.5,
ylim = c(-0.3, max(pa$fa.values) + 0.3), xaxt = "n", bty = "l", las = 1,
xlab = "Factor number", ylab = "Eigenvalue (common factor)",
main = "Scree plot and parallel analysis", col.main = col_title)
axis(1, at = x)
lines(x, pa$fa.sim[x], type = "b", lty = 2, pch = 1, col = col2, lwd = 2)
abline(v = 5.5, col = "grey55", lty = 3)
legend("topright", c("Observed data", "Random data (parallel analysis)"),
col = c(col1, col2), lty = c(1, 2), pch = c(19, 1), lwd = 2, bty = "n")Figure 2. Scree plot of the observed eigenvalues and the eigenvalues from random data. Factors whose observed eigenvalue lies above the random-data line are retained by parallel analysis. The observed line drops sharply after the fifth factor, and the sixth factor lies only just above the random-data line.
PCA and EFA compared. To show the difference discussed in Section 2.2, the same data are analysed with PCA and with common factor analysis. Five components and five factors are extracted, so that only the method differs. The communalities of the two solutions are then compared.
pca5 <- principal(calib, nfactors = 5, rotate = "varimax")
efa5 <- fa(calib, nfactors = 5, fm = "minres", rotate = "oblimin", cor = "poly")
round(cbind(PCA = pca5$communality, EFA = efa5$communality), 2) PCA EFA
A1 0.48 0.28
A2 0.63 0.61
A3 0.63 0.62
A4 0.45 0.38
A5 0.54 0.53
C1 0.52 0.44
C2 0.59 0.51
C3 0.48 0.38
C4 0.57 0.55
C5 0.56 0.53
E1 0.43 0.34
E2 0.61 0.62
E3 0.52 0.48
E4 0.63 0.62
E5 0.51 0.47
N1 0.68 0.70
N2 0.66 0.64
N3 0.63 0.60
N4 0.59 0.55
N5 0.50 0.44
O1 0.48 0.43
O2 0.44 0.31
O3 0.58 0.56
O4 0.43 0.35
O5 0.45 0.33
PCA communalities are usually higher, because PCA analyses total variance and does not separate unique variance from common variance. The difference is expected to be largest for items with low communalities.
Interpretation. The mean communality is .54 for PCA and .49 for EFA. The difference is largest for the weaker items, for example A1 (.48 in PCA versus .28 in EFA) and O5 (.45 versus .33). PCA attributes part of the unique variance of these items to the components, so it presents them as better measures than they really are.
The EFA solution.
Loadings:
MR2 MR3 MR1 MR4 MR5
N1 0.837
N2 0.795
N3 0.754
N4 0.525 -0.387
N5 0.555
E1 0.543
E2 0.712
E4 0.669
C1 0.628
C2 0.713
C3 0.605
C4 0.672
C5 0.617
A1 0.505
A2 0.763
A3 0.720
A4 0.515
A5 0.538
O1 0.593
O3 0.685
O5 0.553
E3 0.461 0.319
E5 0.486
O2 0.481
O4 -0.350 0.447
MR2 MR3 MR1 MR4 MR5
SS loadings 2.809 2.307 2.294 2.170 1.849
Proportion Var 0.112 0.092 0.092 0.087 0.074
Cumulative Var 0.112 0.205 0.296 0.383 0.457
MR2 MR3 MR1 MR4 MR5
MR2 1.00000000 -0.2211914 -0.2060865 -0.07909413 -0.01872189
MR3 -0.22119142 1.0000000 0.2437765 0.30758261 0.15422096
MR1 -0.20608654 0.2437765 1.0000000 0.23578124 0.18916657
MR4 -0.07909413 0.3075826 0.2357812 1.00000000 0.20611943
MR5 -0.01872189 0.1542210 0.1891666 0.20611943 1.00000000
# Alternative solution suggested by the criteria, if different
efa6 <- fa(calib, nfactors = 6, fm = "minres", rotate = "oblimin", cor = "poly")
print(efa6$loadings, cutoff = .30, sort = TRUE)
Loadings:
MR6 MR2 MR3 MR4 MR5 MR1
N1 0.893
N2 0.876
N3 0.692
E1 0.568
E2 0.744
E4 0.651
C1 0.624
C2 0.763
C3 0.591
C4 0.646 -0.366
C5 0.579
A1 0.596
A2 0.801
A3 0.694
O1 0.611
O3 0.694
O5 0.541 -0.341
A4 0.480
A5 0.481
E3 0.430 0.351
E5 0.487
N4 0.435 -0.439
N5 0.449
O2 0.460 -0.306
O4 -0.385 0.451
MR6 MR2 MR3 MR4 MR5 MR1
SS loadings 2.572 2.415 2.262 2.123 1.881 0.778
Proportion Var 0.103 0.097 0.090 0.085 0.075 0.031
Cumulative Var 0.103 0.199 0.290 0.375 0.450 0.481
Check whether each item loads mainly on its expected factor, which items show cross-loadings, and whether an extra factor is substantively meaningful or only a minor method or content factor. The pattern loadings and factor correlations are used for interpretation, because the solution is oblique. The six-factor solution is examined in the same way.
Interpretation of the five-factor solution. The five factors correspond clearly to the Big Five traits. Neuroticism (N1 to N5, loadings .53 to .84), Extraversion (E1, E2, E4, E5 and E3, loadings .46 to .71), Conscientiousness (C1 to C5, .61 to .71), Agreeableness (A1 to A5, .51 to .76) and Openness (O1, O2, O3, O5 and O4, .45 to .69) are recovered without any item loading mainly on the wrong factor. Together the five factors explain 45.7% of the total variance.
L <- unclass(efa5$loadings)
# order the factor columns by the trait whose items load highest on them
ord <- sapply(c("N", "E", "C", "A", "O"), function(p)
which.max(colMeans(abs(L[grep(paste0("^", p), rownames(L)), ]))))
L <- L[, ord]
colnames(L) <- c("Neuroticism", "Extraversion", "Conscientiousness",
"Agreeableness", "Openness")
rows <- c(paste0("N", 1:5), paste0("E", 1:5), paste0("C", 1:5),
paste0("A", 1:5), paste0("O", 1:5))
L <- L[rows, ]
pal <- colorRampPalette(c("#B23A48", "#F7F7F7", col1))(101)
par(mar = c(9.5, 4, 3, 1))
image(1:5, 1:25, t(L)[, 25:1], col = pal, zlim = c(-1, 1), axes = FALSE,
xlab = "", ylab = "", main = "EFA pattern loadings (five factors)",
col.main = col_title)
axis(2, at = 1:25, labels = rev(rows), las = 1, tick = FALSE)
axis(1, at = 1:5, labels = colnames(L), las = 2, tick = FALSE)
for (i in 1:5) for (j in 1:25) {
v <- t(L)[i, 26 - j]
text(i, j, sprintf("%.2f", v), cex = 0.75, font = ifelse(abs(v) >= .30, 2, 1),
col = ifelse(abs(v) >= .30, "black", "grey55"))
}
abline(h = c(5.5, 10.5, 15.5, 20.5), col = "white", lwd = 3)Figure 3. Pattern loadings of the five-factor EFA solution. Darker blue cells show stronger positive loadings, red cells show negative loadings, and loadings of at least .30 are printed in bold. Each block of five items loads mainly on its own trait, and the few bold values outside the blocks are the cross-loadings discussed below.
Three items have cross-loadings of at least .30. E3 (“Know how to captivate people”) loads on Extraversion (.46) and Openness (.32), N4 (“Often feel blue”) loads on Neuroticism (.53) and negatively on Extraversion (−.39), and O4 (“Spend time reflecting on things”) loads on Openness (.45) and negatively on Extraversion (−.35). These items share content with more than one trait, which is common in personality inventories.
The factor correlations are small to moderate. The highest is between Extraversion and Agreeableness (.31), and Neuroticism correlates negatively with the other traits (−.22 to −.02). Since the factors are correlated, the oblique rotation was the right choice.
Interpretation of the six-factor solution. The sixth factor explains only 3.1% of the variance and is defined by negative loadings of C4 (−.37), O5 (−.34) and O2 (−.31), which are all reverse-keyed items. It therefore reflects the wording of the items rather than a substantive trait, a so-called method factor. The five-factor solution is retained, in line with the MAP test and with theory. This example shows why the number of factors should be decided by combining statistical criteria with the content of the factors.
This code is optional and only needed if you start with the CFA part in a new R session, without running the earlier sections. It loads the packages and creates the objects that this part uses. The results are the same as when the whole guide is run in order.
library(psych); library(psychTools); library(GPArotation)
library(lavaan); library(semTools); library(semPlot)
col1 <- "#1F6F8B"; col2 <- "#E07A5F"; col_title <- "#123F52" # colours used in the figures
# data preparation (Section 5.2)
items <- na.omit(bfi[, 1:25])
rev_items <- c("A1", "C4", "C5", "E1", "E2", "O2", "O5")
items[rev_items] <- 7 - items[rev_items]
# splitting the data (Section 5.3)
set.seed(2026)
idx <- sample(seq_len(nrow(items)), size = floor(nrow(items) / 2))
calib <- items[idx, ] # EFA
valid <- items[-idx, ] # CFAThe theoretical models are now specified in advance and tested on the validation sample. Four models are compared, a one-factor model, five orthogonal factors, five correlated factors, and a higher-order model in which the five traits are explained by two metatraits, stability and plasticity (DeYoung, 2006; Digman, 1997). Because the items are ordinal, the WLSMV estimator is used.
m1 <- paste("general =~", paste(names(items), collapse = " + "))
m5 <- '
agree =~ A1 + A2 + A3 + A4 + A5
consc =~ C1 + C2 + C3 + C4 + C5
extra =~ E1 + E2 + E3 + E4 + E5
neuro =~ N1 + N2 + N3 + N4 + N5
open =~ O1 + O2 + O3 + O4 + O5
'
# Higher-order model with two metatraits (Digman, 1997; DeYoung, 2006)
m5h <- paste(m5, '
stability =~ agree + consc + neuro
plasticity =~ extra + open
')
fit1 <- cfa(m1, data = valid, ordered = TRUE, estimator = "WLSMV")
fit5o <- cfa(m5, data = valid, ordered = TRUE, estimator = "WLSMV", orthogonal = TRUE)
fit5 <- cfa(m5, data = valid, ordered = TRUE, estimator = "WLSMV")
fit5h <- cfa(m5h, data = valid, ordered = TRUE, estimator = "WLSMV")
idx_fit <- c("chisq.scaled", "df.scaled", "cfi.scaled", "tli.scaled",
"rmsea.scaled", "srmr")
round(rbind(one_factor = fitMeasures(fit1, idx_fit),
orthogonal_5 = fitMeasures(fit5o, idx_fit),
correlated_5 = fitMeasures(fit5, idx_fit),
higher_order = fitMeasures(fit5h, idx_fit)), 3) chisq.scaled df.scaled cfi.scaled tli.scaled rmsea.scaled srmr
one_factor 8100.837 275 0.498 0.453 0.153 0.143
orthogonal_5 6149.642 275 0.623 0.589 0.132 0.156
correlated_5 3139.112 265 0.816 0.791 0.094 0.085
higher_order 2992.663 269 0.825 0.805 0.091 0.088
Scaled and Shifted Chi-Squared Difference Test (method = "satorra.2000")
lavaan->lavTestLRT():
lavaan NOTE: The "Chisq" column contains standard test statistics, not the robust test
that should be reported per model. A robust difference test is a function of two standard
(not robust) statistics.
Df AIC BIC Chisq Chisq diff RMSEA Df diff Pr(>Chisq)
fit5 265 3263.3
fit5o 275 11965.8 1140.9 0.84479 10 < 2.2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# standardised loadings, one row per item
std5 <- standardizedSolution(fit5)
subset(std5, op == "=~", select = c(lhs, rhs, est.std, se, pvalue)) lhs rhs est.std se pvalue
1 agree A1 0.335 0.028 0
2 agree A2 0.665 0.022 0
3 agree A3 0.764 0.018 0
4 agree A4 0.543 0.027 0
5 agree A5 0.771 0.019 0
6 consc C1 0.596 0.025 0
7 consc C2 0.611 0.027 0
8 consc C3 0.512 0.025 0
9 consc C4 0.752 0.022 0
10 consc C5 0.664 0.025 0
11 extra E1 0.562 0.023 0
12 extra E2 0.720 0.019 0
13 extra E3 0.702 0.020 0
14 extra E4 0.717 0.019 0
15 extra E5 0.616 0.023 0
16 neuro N1 0.874 0.011 0
17 neuro N2 0.816 0.012 0
18 neuro N3 0.745 0.015 0
19 neuro N4 0.685 0.021 0
20 neuro N5 0.527 0.023 0
21 open O1 0.614 0.030 0
22 open O2 0.386 0.035 0
23 open O3 0.875 0.029 0
24 open O4 0.221 0.040 0
25 open O5 0.476 0.031 0
# thresholds side by side, one row per item and one column per threshold
th <- subset(parameterEstimates(fit5), op == "|")
round(xtabs(est ~ lhs + rhs, data = th), 2) rhs
lhs t1 t2 t3 t4 t5
A1 -1.86 -1.22 -0.77 -0.34 0.41
A2 -2.15 -1.52 -1.21 -0.50 0.51
A3 -1.84 -1.34 -0.97 -0.34 0.63
A4 -1.66 -1.15 -0.86 -0.39 0.26
A5 -2.04 -1.38 -0.91 -0.22 0.68
C1 -1.97 -1.36 -0.90 -0.21 0.82
C2 -1.90 -1.18 -0.77 -0.09 0.87
C3 -1.81 -1.14 -0.71 0.03 0.96
C4 -2.01 -1.22 -0.58 -0.12 0.65
C5 -1.17 -0.52 0.05 0.34 0.99
E1 -1.38 -0.79 -0.31 0.03 0.70
E2 -1.32 -0.74 -0.16 0.20 0.94
E3 -1.59 -1.00 -0.50 0.29 1.17
E4 -1.68 -1.08 -0.73 -0.25 0.66
E5 -1.85 -1.16 -0.79 -0.12 0.83
N1 -0.73 -0.09 0.28 0.83 1.43
N2 -1.17 -0.53 -0.14 0.49 1.16
N3 -1.00 -0.27 0.07 0.66 1.35
N4 -1.03 -0.28 0.11 0.71 1.31
N5 -0.74 -0.09 0.27 0.83 1.34
O1 -2.44 -1.66 -1.15 -0.40 0.48
O2 -1.58 -0.96 -0.47 -0.10 0.55
O3 -1.93 -1.41 -0.92 -0.07 0.90
O4 -2.11 -1.58 -1.18 -0.58 0.24
O5 -1.97 -1.27 -0.74 -0.20 0.62
agree consc extra neuro open
agree 1.00
consc 0.37 1.00
extra 0.74 0.38 1.00
neuro -0.26 -0.28 -0.24 1.00
open 0.29 0.33 0.49 -0.06 1.00
# the full output can still be printed with
# summary(fit5, standardized = TRUE, fit.measures = TRUE)
compRelSEM(fit5) # omega for each factor$agree
Composite `agree` is composed of observed variables:
A1, A2, A3, A4, A5
True-score variance is represented by common factor(s):
agree
Total variance of composite `agree` determined from the unrestricted model.
The proportion attributable to "true" scores is its model-based estimate of reliability ("omega"):
[1] 0.699
$consc
Composite `consc` is composed of observed variables:
C1, C2, C3, C4, C5
True-score variance is represented by common factor(s):
consc
Total variance of composite `consc` determined from the unrestricted model.
The proportion attributable to "true" scores is its model-based estimate of reliability ("omega"):
[1] 0.746
$extra
Composite `extra` is composed of observed variables:
E1, E2, E3, E4, E5
True-score variance is represented by common factor(s):
extra
Total variance of composite `extra` determined from the unrestricted model.
The proportion attributable to "true" scores is its model-based estimate of reliability ("omega"):
[1] 0.768
$neuro
Composite `neuro` is composed of observed variables:
N1, N2, N3, N4, N5
True-score variance is represented by common factor(s):
neuro
Total variance of composite `neuro` determined from the unrestricted model.
The proportion attributable to "true" scores is its model-based estimate of reliability ("omega"):
[1] 0.856
$open
Composite `open` is composed of observed variables:
O1, O2, O3, O4, O5
True-score variance is represented by common factor(s):
open
Total variance of composite `open` determined from the unrestricted model.
The proportion attributable to "true" scores is its model-based estimate of reliability ("omega"):
[1] 0.55
agree consc extra neuro open
0.405 0.399 0.444 0.546 0.314
Interpretation of model fit.
| Model | χ² (scaled) | df | CFI | TLI | RMSEA [90% CI] | SRMR |
|---|---|---|---|---|---|---|
| One factor | 8,100.84 | 275 | .498 | .453 | .153 [.150, .156] | .143 |
| Five orthogonal factors | 6,149.64 | 275 | .623 | .589 | .132 [.130, .135] | .156 |
| Five correlated factors | 3,139.11 | 265 | .816 | .791 | .094 [.091, .097] | .085 |
| Higher-order (stability, plasticity) | 2,992.66 | 269 | .825 | .805 | .091 [.088, .094] | .088 |
The one-factor model fits very poorly, so the 25 items cannot be explained by a single general personality factor. Allowing the five factors to correlate improves the fit substantially, and the scaled chi-square difference test confirms this, Δχ²(10) = 1,140.9, p < .001. The five personality traits are therefore related to each other, as expected from previous research.
# the ESEM model is fitted here as well, so that it can be shown in the figure
all_items <- paste(names(items), collapse = " + ")
m_esem <- paste0('efa("b1")*f1 + efa("b1")*f2 + efa("b1")*f3 + efa("b1")*f4 + efa("b1")*f5 =~ ', all_items)
fit_esem <- cfa(m_esem, data = valid, ordered = TRUE, estimator = "WLSMV", rotation = "geomin")
fits <- sapply(list(fit1, fit5o, fit5, fit5h, fit_esem), fitMeasures,
fit.measures = c("cfi.scaled", "rmsea.scaled"))
models <- c("One factor", "Five orthogonal", "Five correlated",
"Higher-order (improper)", "ESEM")
bar_col <- c(rep("#9CC3D1", 4), col1)
par(mfrow = c(1, 2), mar = c(4.5, 11, 3, 1))
bp <- barplot(rev(fits[1, ]), horiz = TRUE, names.arg = rev(models), las = 1,
col = rev(bar_col), border = NA, xlim = c(0, 1.12), xlab = "CFI",
main = "CFI (higher is better)", col.main = col_title)
abline(v = c(.90, .95), lty = c(3, 2), col = col2, lwd = 2)
text(rev(fits[1, ]), bp, sprintf("%.3f", rev(fits[1, ])), pos = 4, cex = 0.8)
bp <- barplot(rev(fits[2, ]), horiz = TRUE, names.arg = rev(models), las = 1,
col = rev(bar_col), border = NA, xlim = c(0, 0.20), xlab = "RMSEA",
main = "RMSEA (lower is better)", col.main = col_title)
abline(v = c(.06, .08), lty = c(2, 3), col = col2, lwd = 2)
text(rev(fits[2, ]), bp, sprintf("%.3f", rev(fits[2, ])), pos = 4, cex = 0.8)Figure 4. CFI and RMSEA of the CFA models and the ESEM model in the validation sample. The dashed and dotted lines mark the guidelines for good and acceptable fit (Hu & Bentler, 1999). Only the ESEM model reaches the acceptable range on both indices, and the higher-order model is labelled improper because of its Heywood case.
The higher-order model shows slightly better fit indices, but its solution is improper. lavaan warns that some latent variances are negative, and the standardised loading of Extraversion on plasticity is 1.01, which is impossible. This is a Heywood case, which is likely here because each second-order factor has only two or three first-order indicators. An improper solution should not be interpreted, so the five correlated factors model is preferred.
Even this model does not reach the conventional guidelines in Section
3.6 (CFI .816 and TLI .791 are below .90, RMSEA .094 is above .08),
although SRMR (.085) is acceptable. If the same model is estimated with
ML and the items are treated as continuous,
cfa(m5, data = valid, estimator = "ML"), the results are
similar, χ²/df = 8.54, GFI = .87, AGFI = .82, NFI = .75, NNFI = .74, CFI
= .77, RFI = .72 and IFI = .77. Poor fit of strict CFA models is a
well-known finding for personality data (Marsh et al., 2014), and the
next steps examine where the misfit comes from.
Interpretation of the parameters. All standardised loadings are significant and range from .22 to .88. The weakest indicators are O4 (.22), A1 (.34), O2 (.39) and O5 (.48), the same items that showed low communalities or cross-loadings in the EFA. The strongest factor correlation is between Agreeableness and Extraversion (.74), followed by Extraversion and Openness (.49), while Neuroticism and Openness are nearly unrelated (−.06).
Interpretation of reliability and validity.
| Factor | Omega | AVE |
|---|---|---|
| Agreeableness | .70 | .41 |
| Conscientiousness | .75 | .40 |
| Extraversion | .77 | .44 |
| Neuroticism | .86 | .55 |
| Openness | .55 | .31 |
Omega is acceptable (≥ .70) for four factors, but Openness (.55) is low because of its weak indicators. Only Neuroticism has an AVE above .50, so convergent validity is limited for the other factors. The squared correlation between Agreeableness and Extraversion (.74² = .54) is higher than the AVE of both factors, so by the Fornell-Larcker criterion these two factors are not clearly distinct in this sample. This is not surprising for a short form with five items per trait.
Local fit and modifications. Strict CFA models of personality data often show only moderate fit, because items have small cross-loadings and some items share specific content (Marsh et al., 2014). Modification indices show where the model is strained. They estimate how much the chi-square value would decrease if a fixed parameter were freed.
lhs op rhs mi epc sepc.lv sepc.all sepc.nox
299 extra =~ N4 228.849 -0.455 -0.256 -0.256 -0.256
324 neuro =~ O4 211.511 0.297 0.259 0.259 0.259
259 agree =~ N4 181.970 -0.733 -0.245 -0.245 -0.245
315 neuro =~ C5 180.947 -0.325 -0.284 -0.284 -0.284
304 extra =~ O4 166.276 -0.571 -0.321 -0.321 -0.321
312 neuro =~ C2 165.359 0.320 0.279 0.279 0.279
339 open =~ E4 157.504 -0.667 -0.409 -0.409 -0.409
601 N1 ~~ N2 154.634 0.356 0.356 1.268 1.268
279 consc =~ N4 142.070 -0.417 -0.249 -0.249 -0.249
303 extra =~ O3 138.805 0.851 0.479 0.479 0.479
# Free only theoretically defensible residual covariances,
# for example between items of the same factor with similar content
m5m <- paste(m5, 'N1 ~~ N2')
fit5m <- cfa(m5m, data = valid, ordered = TRUE, estimator = "WLSMV")
fitMeasures(fit5m, idx_fit)chisq.scaled df.scaled cfi.scaled tli.scaled rmsea.scaled srmr
3015.154 264.000 0.824 0.800 0.093 0.084
As a safer approach, only residual covariances between items of the same factor with clearly related content are freed, and every modification is reported with its justification. Modifications that are made only to improve fit, without a theoretical reason, are likely to capitalise on chance and may not replicate in another sample.
Interpretation. Most of the largest modification indices refer to cross-loadings, for example Extraversion on N4 (MI = 228.8), Neuroticism on O4 (MI = 211.5) and Agreeableness on N4 (MI = 182.0), the same items flagged in the EFA. The largest residual covariance is between N1 and N2 (MI = 154.6). Both items describe anger (“Get angry easily” and “Get irritated easily”), so freeing this covariance can be justified by their similar content. After the modification the fit hardly changes (CFI = .824, TLI = .800, RMSEA = .093, SRMR = .084). The misfit is therefore spread over many small cross-loadings rather than located in a few parameters, and freeing many parameters one by one would mostly capitalise on chance.
An ESEM model for comparison. Section 4.2 introduced ESEM. It can be fitted with lavaan (version 0.6-13 or later) to see how much fit improves when cross-loadings are allowed. The five factors are rotated with geomin, and all 25 items may load on every factor.
all_items <- paste(names(items), collapse = " + ")
m_esem <- paste0('efa("b1")*f1 + efa("b1")*f2 + efa("b1")*f3 + efa("b1")*f4 + efa("b1")*f5 =~ ', all_items)
fit_esem <- cfa(m_esem, data = valid, ordered = TRUE, estimator = "WLSMV", rotation = "geomin")
fitMeasures(fit_esem, idx_fit)chisq.scaled df.scaled cfi.scaled tli.scaled rmsea.scaled srmr
981.269 185.000 0.949 0.917 0.059 0.031
Interpretation. The ESEM model fits much better than the CFA model, CFI = .949, TLI = .917, RMSEA = .059 and SRMR = .031, and it reaches the acceptable levels in Section 3.6. Allowing small cross-loadings, instead of fixing them to zero, is enough to explain most of the misfit. This result illustrates why ESEM is often recommended for multidimensional personality instruments (Marsh et al., 2014).
This code is optional and only needed if you start with the path diagrams in a new R session, without running the earlier sections. It loads the packages and creates the objects that this part uses. The results are the same as when the whole guide is run in order.
library(psych); library(psychTools); library(GPArotation)
library(lavaan); library(semTools); library(semPlot)
col1 <- "#1F6F8B"; col2 <- "#E07A5F"; col_title <- "#123F52" # colours used in the figures
# data preparation (Section 5.2)
items <- na.omit(bfi[, 1:25])
rev_items <- c("A1", "C4", "C5", "E1", "E2", "O2", "O5")
items[rev_items] <- 7 - items[rev_items]
# splitting the data (Section 5.3)
set.seed(2026)
idx <- sample(seq_len(nrow(items)), size = floor(nrow(items) / 2))
calib <- items[idx, ] # EFA
valid <- items[-idx, ] # CFA
# CFA models (Section 5.5)
m5 <- '
agree =~ A1 + A2 + A3 + A4 + A5
consc =~ C1 + C2 + C3 + C4 + C5
extra =~ E1 + E2 + E3 + E4 + E5
neuro =~ N1 + N2 + N3 + N4 + N5
open =~ O1 + O2 + O3 + O4 + O5
'
m5h <- paste(m5, '
stability =~ agree + consc + neuro
plasticity =~ extra + open
')
fit5 <- cfa(m5, data = valid, ordered = TRUE, estimator = "WLSMV")
fit5h <- cfa(m5h, data = valid, ordered = TRUE, estimator = "WLSMV")Path diagrams show the specified model visually, with latent factors as ovals, indicators as rectangles and loadings as arrows. Standardised estimates are shown on the arrows, which makes the relative strength of each loading easy to see. Curved double-headed arrows represent factor correlations and residual variances.
semPaths(fit5, what = "std", whatLabels = "std", layout = "tree", rotation = 2, style = "lisrel",
fade = FALSE, edge.color = "grey25", edge.label.color = "black",
edge.label.cex = 0.85, edge.label.position = 0.7,
sizeMan = 6, sizeMan2 = 3, sizeLat = 10, sizeLat2 = 6, nCharNodes = 0, label.cex = 1.1,
color = list(lat = "#DCEBF0", man = "white"),
thresholds = FALSE, intercepts = FALSE, residuals = FALSE, mar = c(2, 6, 4, 6))
title("Five correlated factors, standardized estimates", line = 1)semPaths(fit5h, what = "std", whatLabels = "std", layout = "tree", rotation = 2, style = "lisrel",
fade = FALSE, edge.color = "grey25", edge.label.color = "black",
edge.label.cex = 0.85, edge.label.position = 0.7,
sizeMan = 6, sizeMan2 = 3, sizeLat = 10, sizeLat2 = 6, nCharNodes = 0, label.cex = 1.1,
color = list(lat = "#DCEBF0", man = "white"),
thresholds = FALSE, intercepts = FALSE, residuals = FALSE, mar = c(2, 6, 4, 6))
title("Higher-order model, standardized estimates", line = 1)# the same model drawn with base R graphics, as shown in the online document
draw_path <- function(fit, col1 = "#1F6F8B", col2 = "#E07A5F", col_title = "#123F52") {
s <- standardizedSolution(fit)
lv <- c("agree", "consc", "extra", "neuro", "open")
lab <- c(agree = "Agreeableness", consc = "Conscientiousness", extra = "Extraversion",
neuro = "Neuroticism", open = "Openness")
ld <- s[s$op == "=~", ]; ov <- ld$rhs
grp <- match(ld$lhs, lv)
xo <- setNames(seq_along(ov) * 1.15 + (grp - 1) * 1.6, ov) # gap between trait groups
xl <- sapply(lv, function(f) mean(xo[ld$rhs[ld$lhs == f]]))
yl <- 6.4; yo <- 2.2; W <- max(xo) + 1
par(mar = c(0.3, 0.3, 2.2, 0.3))
plot(NA, xlim = c(0.2, W), ylim = c(0.4, 11.6), axes = FALSE, xlab = "", ylab = "")
title("Five correlated factors, standardised estimates", col.main = col_title, cex.main = 1.15)
fc <- s[s$op == "~~" & s$lhs != s$rhs & s$lhs %in% lv, ]
fc <- fc[order(abs(xl[fc$rhs] - xl[fc$lhs])), ]
for (i in seq_len(nrow(fc))) {
a <- xl[fc$lhs[i]]; b <- xl[fc$rhs[i]]; h <- 0.5 + abs(b - a) / 7.5
t <- seq(0, pi, length.out = 80); xm <- (a + b) / 2; rr <- abs(b - a) / 2
xs <- xm - rr * cos(t); ys <- yl + 0.62 + h * sin(t)
neg <- fc$est.std[i] < 0
lines(xs, ys, col = adjustcolor(ifelse(neg, col2, "grey45"), 0.85), lwd = 0.6 + 3 * abs(fc$est.std[i]))
rect(xm - 0.62, yl + 0.62 + h - 0.2, xm + 0.62, yl + 0.62 + h + 0.2, col = "white", border = NA)
text(xm, yl + 0.62 + h, sprintf("%.2f", fc$est.std[i]), cex = 0.72, col = ifelse(neg, col2, "grey20"))
}
for (i in seq_len(nrow(ld))) {
x0 <- xl[ld$lhs[i]]; x1 <- xo[ld$rhs[i]]
arrows(x0, yl - 0.62, x1, yo + 0.45, length = 0.06, lwd = 0.6 + 3 * ld$est.std[i], col = adjustcolor(col1, 0.75))
px <- x0 + (x1 - x0) * 0.78; py <- yl - 0.62 + (yo + 0.45 - yl + 0.62) * 0.78
rect(px - 0.36, py - 0.17, px + 0.36, py + 0.17, col = "white", border = NA)
text(px, py, sprintf("%.2f", ld$est.std[i]), cex = 0.64, col = "grey15")
}
tt <- seq(0, 2 * pi, length.out = 80)
for (f in lv) {
polygon(xl[f] + 2.55 * cos(tt), yl + 0.62 * sin(tt), col = "#DCEBF0", border = col1, lwd = 1.6)
text(xl[f], yl, lab[f], cex = 0.82, font = 2, col = col_title)
}
res <- s[s$op == "~~" & s$lhs == s$rhs & s$lhs %in% ov, ]
for (v in ov) {
rect(xo[v] - 0.45, yo - 0.45, xo[v] + 0.45, yo + 0.45, col = "white", border = "grey35")
text(xo[v], yo, v, cex = 0.74)
arrows(xo[v], yo - 1.15, xo[v], yo - 0.47, length = 0.04, col = "grey55", lwd = 0.8)
text(xo[v], yo - 1.38, sprintf("%.2f", res$est.std[res$lhs == v]), cex = 0.6, col = "grey35")
}
}
draw_path(fit5)Figure 5. Path diagram of the five correlated factors model with standardised estimates from the validation sample. Straight arrows from the ovals to the boxes are factor loadings, the curved lines above the ovals are factor correlations (red for negative), and the small arrows under the boxes are residual variances. Thicker lines show larger values, so the weak indicators O4 (.22) and A1 (.33) and the strong correlation between Agreeableness and Extraversion (.74) stand out at a glance.
This code is optional and only needed if you start with the factor scores in a new R session, without running the earlier sections. It loads the packages and creates the objects that this part uses. The results are the same as when the whole guide is run in order.
library(psych); library(psychTools); library(GPArotation)
library(lavaan); library(semTools); library(semPlot)
col1 <- "#1F6F8B"; col2 <- "#E07A5F"; col_title <- "#123F52" # colours used in the figures
# data preparation (Section 5.2)
items <- na.omit(bfi[, 1:25])
rev_items <- c("A1", "C4", "C5", "E1", "E2", "O2", "O5")
items[rev_items] <- 7 - items[rev_items]
# splitting the data (Section 5.3)
set.seed(2026)
idx <- sample(seq_len(nrow(items)), size = floor(nrow(items) / 2))
calib <- items[idx, ] # EFA
valid <- items[-idx, ] # CFA
# five-factor EFA (Section 5.4)
efa5 <- fa(calib, nfactors = 5, fm = "minres", rotate = "oblimin", cor = "poly")
# CFA models (Section 5.5)
m5 <- '
agree =~ A1 + A2 + A3 + A4 + A5
consc =~ C1 + C2 + C3 + C4 + C5
extra =~ E1 + E2 + E3 + E4 + E5
neuro =~ N1 + N2 + N3 + N4 + N5
open =~ O1 + O2 + O3 + O4 + O5
'
m5h <- paste(m5, '
stability =~ agree + consc + neuro
plasticity =~ extra + open
')
fit5 <- cfa(m5, data = valid, ordered = TRUE, estimator = "WLSMV")
fit5h <- cfa(m5h, data = valid, ordered = TRUE, estimator = "WLSMV")Once a structure is accepted, scores for each person on each factor can be obtained in three ways. To compare them fairly, all scores are calculated on the validation sample. The scores are then correlated to see how much the choice of method matters.
# 1. EFA factor scores (weights from the calibration sample)
fs_efa_reg <- factor.scores(valid, efa5, method = "regression")$scores
fs_efa_bart <- factor.scores(valid, efa5, method = "Bartlett")$scores
# 2. CFA factor scores
fs_cfa <- lavPredict(fit5)
# 3. Standardised total scores (items already reverse scored)
keys <- list(agree = paste0("A", 1:5), consc = paste0("C", 1:5),
extra = paste0("E", 1:5), neuro = paste0("N", 1:5),
open = paste0("O", 1:5))
z_total <- sapply(keys, function(k) scale(rowSums(valid[, k])))
# Compare, for example, neuroticism
cor(cbind(z_total = z_total[, "neuro"], cfa = fs_cfa[, "neuro"])) z_total cfa
z_total 1.0000000 0.9690501
cfa 0.9690501 1.0000000
plot(z_total[, "neuro"], fs_cfa[, "neuro"],
xlab = "Standardised total score", ylab = "CFA factor score")The EFA factor columns are not labelled automatically, so match them to the trait names by looking at the loading pattern before comparing. When loadings within a factor are similar, standardised total scores and factor scores correlate very highly. Large differences in loadings make the weighting of factor scores more important.
Interpretation.
| Factor | Standardised total score with CFA factor score | Standardised total score with EFA factor score |
|---|---|---|
| Agreeableness | .91 | .96 |
| Conscientiousness | .97 | .97 |
| Extraversion | .95 | .90 |
| Neuroticism | .97 | .95 |
| Openness | .84 | .94 |
The correlations are high for all factors, so in most practical situations standardised total scores rank people very similarly to factor scores. The lowest correlation between the total score and the CFA factor score is for Openness (.84). Its loadings differ the most (from .22 for O4 to above .60 for O3), so weighting items by their loadings changes the scores more than for the other factors.
traits <- c(agree = "Agreeableness", consc = "Conscientiousness", extra = "Extraversion",
neuro = "Neuroticism", open = "Openness")
par(mfrow = c(2, 3), mar = c(4.5, 4.5, 3, 1))
for (k in names(traits)) {
r <- cor(z_total[, k], fs_cfa[, k])
plot(z_total[, k], fs_cfa[, k], pch = 16, col = adjustcolor(col1, 0.3),
xlab = "Standardised total score", ylab = "CFA factor score", bty = "l", las = 1,
main = sprintf("%s (r = %.2f)", traits[k], r), col.main = col_title)
abline(lm(fs_cfa[, k] ~ z_total[, k]), col = col2, lwd = 2)
}
# last panel, the five correlations side by side
rs <- sapply(names(traits), function(k) cor(z_total[, k], fs_cfa[, k]))
bp <- barplot(rs, names.arg = c("A", "C", "E", "N", "O"), ylim = c(0, 1.1), col = col1, border = NA,
las = 1, ylab = "Correlation", main = "All five traits", col.main = col_title)
text(bp, rs, sprintf("%.2f", rs), pos = 3, cex = 0.9)Figure 6. Standardised total scores plotted against CFA factor scores for each of the five traits, with the correlations summarised in the last panel. For Conscientiousness, Neuroticism and Extraversion the points lie close to the line, so the two scoring methods are almost interchangeable. For Agreeableness and especially Openness the spread is wider, because their items differ more in how strongly they reflect the factor.
These questions refer to the output of your own run. Numerical answers are accepted within a small tolerance, because results can differ slightly between R and package versions. As in the other sections, each question can be tried up to three times, and the correct answer is shown with a short explanation at the end.
You have reached the end of the guide. Press the button below to see your total score, your results for each section and a summary of how you worked through the guide, such as the time spent in each section. Your answers were recorded while you worked, so there is nothing to submit.
Clears your saved answers on this device so that you can work through the questions once more.
The guide draws on widely used textbooks and methodological articles on factor analysis and structural equation modeling. All sources cited in the text are listed in APA style. Click the button below to open the full list.
Akaike, H. (1987). Factor analysis and AIC. Psychometrika, 52(3), 317–332.
Anderson, J. C., & Gerbing, D. W. (1988). Structural equation modeling in practice: A review and recommended two-step approach. Psychological Bulletin, 103(3), 411–423.
Asparouhov, T., & Muthén, B. (2009). Exploratory structural equation modeling. Structural Equation Modeling, 16(3), 397–438.
Bartlett, M. S. (1950). Tests of significance in factor analysis. British Journal of Psychology, Statistical Section, 3(2), 77–85.
Bentler, P. M., & Bonett, D. G. (1980). Significance tests and goodness of fit in the analysis of covariance structures. Psychological Bulletin, 88(3), 588–606.
Bentler, P. M. (1990). Comparative fit indexes in structural models. Psychological Bulletin, 107(2), 238–246.
Bollen, K. A. (1986). Sample size and Bentler and Bonett’s nonnormed fit index. Psychometrika, 51(3), 375–377.
Bollen, K. A. (1989). A new incremental fit index for general structural equation models. Sociological Methods & Research, 17(3), 303–316.
Brown, T. A. (2015). Confirmatory factor analysis for applied research (2nd ed.). Guilford Press.
Browne, M. W., & Cudeck, R. (1993). Alternative ways of assessing model fit. In K. A. Bollen & J. S. Long (Eds.), Testing structural equation models (pp. 136–162). Sage.
Browne, M. W. (2001). An overview of analytic rotation in exploratory factor analysis. Multivariate Behavioral Research, 36(1), 111–150.
Cattell, R. B. (1966). The scree test for the number of factors. Multivariate Behavioral Research, 1(2), 245–276.
Costello, A. B., & Osborne, J. W. (2005). Best practices in exploratory factor analysis: Four recommendations for getting the most from your analysis. Practical Assessment, Research, and Evaluation, 10(7), 1–9.
Demir, E. (2022). Example: Exploratory and confirmatory factor analysis in R [Online document]. RPubs. https://rpubs.com/Symrna/EFA_CFA
DeYoung, C. G. (2006). Higher-order factors of the Big Five in a multi-informant sample. Journal of Personality and Social Psychology, 91(6), 1138–1151.
Digman, J. M. (1997). Higher-order factors of the Big Five. Journal of Personality and Social Psychology, 73(6), 1246–1256.
Epskamp, S. (2015). semPlot: Unified visualizations of structural equation models. Structural Equation Modeling, 22(3), 474–483.
Fabrigar, L. R., Wegener, D. T., MacCallum, R. C., & Strahan, E. J. (1999). Evaluating the use of exploratory factor analysis in psychological research. Psychological Methods, 4(3), 272–299.
Field, A. (2018). Discovering statistics using IBM SPSS Statistics (5th ed.). Sage.
Flora, D. B., & Curran, P. J. (2004). An empirical evaluation of alternative methods of estimation for confirmatory factor analysis with ordinal data. Psychological Methods, 9(4), 466–491.
Fornell, C., & Larcker, D. F. (1981). Evaluating structural equation models with unobservable variables and measurement error. Journal of Marketing Research, 18(1), 39–50.
Goldberg, L. R. (1999). A broad-bandwidth, public domain, personality inventory measuring the lower-level facets of several five-factor models. In I. Mervielde, I. Deary, F. De Fruyt, & F. Ostendorf (Eds.), Personality psychology in Europe (Vol. 7, pp. 7–28). Tilburg University Press.
Golino, H. F., & Epskamp, S. (2017). Exploratory graph analysis: A new approach for estimating the number of dimensions in psychological research. PLoS ONE, 12(6), e0174035.
Goretzko, D., & Bühner, M. (2020). One model to rule them all? Using machine learning algorithms to determine the number of factors in exploratory factor analysis. Psychological Methods, 25(6), 776–786.
Hair, J. F., Black, W. C., Babin, B. J., & Anderson, R. E. (2019). Multivariate data analysis (8th ed.). Cengage.
Hendrickson, A. E., & White, P. O. (1964). Promax: A quick method for rotation to oblique simple structure. British Journal of Statistical Psychology, 17(1), 65–70.
Henseler, J., Ringle, C. M., & Sarstedt, M. (2015). A new criterion for assessing discriminant validity in variance-based structural equation modeling. Journal of the Academy of Marketing Science, 43(1), 115–135.
Hoelter, J. W. (1983). The analysis of covariance structures: Goodness-of-fit indices. Sociological Methods & Research, 11(3), 325–344.
Horn, J. L. (1965). A rationale and test for the number of factors in factor analysis. Psychometrika, 30(2), 179–185.
Hu, L., & Bentler, P. M. (1999). Cutoff criteria for fit indexes in covariance structure analysis: Conventional criteria versus new alternatives. Structural Equation Modeling, 6(1), 1–55.
Jacobucci, R., Grimm, K. J., & McArdle, J. J. (2016). Regularized structural equation modeling. Structural Equation Modeling, 23(4), 555–566.
James, L. R., Mulaik, S. A., & Brett, J. M. (1982). Causal analysis: Assumptions, models, and data. Sage.
Jennrich, R. I., & Bentler, P. M. (2011). Exploratory bi-factor analysis. Psychometrika, 76(4), 537–549.
Jöreskog, K. G., & Sörbom, D. (1993). LISREL 8: Structural equation modeling with the SIMPLIS command language. Scientific Software International.
Jöreskog, K. G. (1969). A general approach to confirmatory maximum likelihood factor analysis. Psychometrika, 34(2), 183–202.
Jorgensen, T. D., Pornprasertmanit, S., Schoemann, A. M., & Rosseel, Y. (2026). semTools: Useful tools for structural equation modeling (R package version 0.5-10). https://CRAN.R-project.org/package=semTools
Kaiser, H. F. (1958). The varimax criterion for analytic rotation in factor analysis. Psychometrika, 23(3), 187–200.
Kaiser, H. F. (1974). An index of factorial simplicity. Psychometrika, 39(1), 31–36.
Kline, R. B. (2023). Principles and practice of structural equation modeling (5th ed.). Guilford Press.
MacCallum, R. C., Roznowski, M., & Necowitz, L. B. (1992). Model modifications in covariance structure analysis: The problem of capitalization on chance. Psychological Bulletin, 111(3), 490–504.
MacCallum, R. C., Widaman, K. F., Zhang, S., & Hong, S. (1999). Sample size in factor analysis. Psychological Methods, 4(1), 84–99.
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 and dangers in overgeneralizing Hu and Bentler’s (1999) findings. Structural Equation Modeling, 11(3), 320–341.
Marsh, H. W., Morin, A. J. S., Parker, P. D., & Kaur, G. (2014). Exploratory structural equation modeling: An integration of the best features of exploratory and confirmatory factor analysis. Annual Review of Clinical Psychology, 10, 85–110.
McCrae, R. R., & John, O. P. (1992). An introduction to the five-factor model and its applications. Journal of Personality, 60(2), 175–215.
McDonald, R. P. (1999). Test theory: A unified treatment. Lawrence Erlbaum.
Merkle, E. C., & Rosseel, Y. (2018). blavaan: Bayesian structural equation models via parameter expansion. Journal of Statistical Software, 85(4), 1–30.
Mulaik, S. A., James, L. R., Van Alstine, J., Bennett, N., Lind, S., & Stilwell, C. D. (1989). Evaluation of goodness-of-fit indices for structural equation models. Psychological Bulletin, 105(3), 430–445.
Muthén, B., & Asparouhov, T. (2012). Bayesian structural equation modeling: A more flexible representation of substantive theory. Psychological Methods, 17(3), 313–335.
Pituch, K. A., & Stevens, J. P. (2016). Applied multivariate statistics for the social sciences (6th ed.). Routledge.
Reise, S. P. (2012). The rediscovery of bifactor measurement models. Multivariate Behavioral Research, 47(5), 667–696.
Revelle, W. (2026). psych: Procedures for psychological, psychometric, and personality research (R package version 2.6.5). Northwestern University. https://CRAN.R-project.org/package=psych
Revelle, W., Wilt, J., & Rosenthal, A. (2010). Individual differences in cognition: New methods for examining the personality-cognition link. In A. Gruszka, G. Matthews, & B. Szymura (Eds.), Handbook of individual differences in cognition (pp. 27–49). Springer.
Rosseel, Y. (2012). lavaan: An R package for structural equation modeling. Journal of Statistical Software, 48(2), 1–36.
Schermelleh-Engel, K., Moosbrugger, H., & Müller, H. (2003). Evaluating the fit of structural equation models: Tests of significance and descriptive goodness-of-fit measures. Methods of Psychological Research Online, 8(2), 23–74.
Schwarz, G. (1978). Estimating the dimension of a model. The Annals of Statistics, 6(2), 461–464.
Spearman, C. (1904). “General intelligence,” objectively determined and measured. The American Journal of Psychology, 15(2), 201–292.
Steiger, J. H. (1990). Structural model evaluation and modification: An interval estimation approach. Multivariate Behavioral Research, 25(2), 173–180.
Tabachnick, B. G., & Fidell, L. S. (2019). Using multivariate statistics (7th ed.). Pearson.
Thurstone, L. L. (1947). Multiple-factor analysis. University of Chicago Press.
Tucker, L. R., & Lewis, C. (1973). A reliability coefficient for maximum likelihood factor analysis. Psychometrika, 38(1), 1–10.
Velicer, W. F. (1976). Determining the number of components from the matrix of partial correlations. Psychometrika, 41(3), 321–327.
Worthington, R. L., & Whittaker, T. A. (2006). Scale development research: A content analysis and recommendations for best practices. The Counseling Psychologist, 34(6), 806–838.
Yu, C.-Y. (2002). Evaluating cutoff criteria of model fit indices for latent variable models with binary and continuous outcomes [Doctoral dissertation, University of California, Los Angeles].