Confirmatory Factor Analysis (CFA)
Wikipedia describes confirmatory factor analysis (CFA) as a particular form of factor analysis used to test whether a construct’s measures are consistent with the nature of that construct. CFA tests whether data fits a hypothesised measurement model.
This vignette performs a CFA on service quality and reviews model fit.
The CFA examines service quality based on the SERVQUAL framework. SERVQUAL consists of five latent factors defined as follows:
Based on these latent factors, designed and implemented a customised survey instrument to measure service quality. The survey instrument consisted of 10 items, with two items per latent factor. One item for each factor was reverse-scored. The data set comprised feedback from 424 respondents.
The raw data set was tidied and ready for processing. This involved recoding reverse-scored items, removing missing values and relabelling data. Conducted a brief exploratory analysis that included a statistical summary and correlation analysis to understand the manifest variables.
The CFA process commenced by building and fitting a base model consistent with the theoretical framework. Reviewed fit statistics and modification indices for the base model, then refined the model to improve fit.
The fit statistics for both models were compared and assessed against targets. Finally, measured the reliability of the scale.
Table 1 is a statistical summary for each of the 10 manifest variables.
| vars | n | mean | sd | median | trimmed | mad | min | max | range | skew | kurtosis | se | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| tan.a | 1 | 424 | 5.88 | 0.95 | 6 | 6.03 | 0.00 | 1 | 7 | 6 | -1.93 | 5.51 | 0.05 |
| tan.f | 2 | 424 | 5.95 | 1.00 | 6 | 6.11 | 0.00 | 2 | 7 | 5 | -1.43 | 2.40 | 0.05 |
| ass.b | 3 | 424 | 5.54 | 1.24 | 6 | 5.68 | 0.00 | 2 | 7 | 5 | -1.09 | 0.52 | 0.06 |
| ass.g | 4 | 424 | 5.50 | 1.14 | 6 | 5.59 | 0.00 | 1 | 7 | 6 | -1.02 | 0.72 | 0.06 |
| rel.c | 5 | 424 | 5.20 | 1.45 | 6 | 5.36 | 1.48 | 1 | 7 | 6 | -0.99 | 0.17 | 0.07 |
| rel.h | 6 | 424 | 5.67 | 1.39 | 6 | 5.90 | 1.48 | 1 | 7 | 6 | -1.39 | 1.33 | 0.07 |
| res.d | 7 | 424 | 5.51 | 1.28 | 6 | 5.68 | 1.48 | 1 | 7 | 6 | -1.25 | 1.32 | 0.06 |
| res.i | 8 | 424 | 5.07 | 1.71 | 6 | 5.26 | 1.48 | 1 | 7 | 6 | -0.77 | -0.53 | 0.08 |
| emp.e | 9 | 424 | 5.76 | 1.29 | 6 | 5.95 | 1.48 | 1 | 7 | 6 | -1.31 | 1.55 | 0.06 |
| emp.j | 10 | 424 | 5.01 | 1.35 | 5 | 5.06 | 1.48 | 1 | 7 | 6 | -0.43 | -0.17 | 0.07 |
Chart 1 is a box plot of 10 manifest variables explaining five latent factors. The box plot shows favourable levels of service quality for each of the items. All measures have a median value of “6” except for emp.j, with a median of “5”.
Chart 2 correlation heatmap shows all items positively correlated with coefficients ranging from 0.40 to 0.77.
The base model has five latent factors consistent with the SERVQUAL theoretical framework. Chart 3 path diagram shows correlations between the five latent factors and standardised loadings between latent factors and their respective manifest variables.
The standardised loadings between latent factors and their manifest variables in Chart 3 are consistently strong. However, there are out-of-bounds correlations between some latent factors in the path diagram to be addressed by respecifying the model.
Improving model fit is an iterative process of reassigning and removing redundant items where appropriate, guided by theoretical concepts. It was considered theoretically sound for this data set, and given factor definitions, to combine reliability with responsiveness into one latent factor. Explored other theoretically sound modifications to improve model fit before settling on a revised model shown in Chart 4.
Table 2 summarises the relationship between latent factors and manifest variables for Model 2.
| latent factor | item | estimate | std.err | z-value | p-value | std.all |
|---|---|---|---|---|---|---|
| tangibles | tan.a | 0.7942 | 0.0407 | 19.5014 | 0 | 0.8331 |
| tangibles | tan.f | 0.8633 | 0.0419 | 20.5891 | 0 | 0.8683 |
| assurance | ass.b | 0.9903 | 0.0522 | 18.9862 | 0 | 0.8014 |
| assurance | ass.g | 0.8798 | 0.0484 | 18.1796 | 0 | 0.7753 |
| rely.response | rel.c | 1.2261 | 0.0577 | 21.2665 | 0 | 0.8482 |
| rely.response | rel.h | 1.1568 | 0.0560 | 20.6653 | 0 | 0.8347 |
| rely.response | res.d | 1.0890 | 0.0512 | 21.2904 | 0 | 0.8488 |
| rely.response | res.i | 1.3921 | 0.0702 | 19.8281 | 0 | 0.8131 |
| empathy | emp.e | 1.0116 | 0.0561 | 18.0166 | 0 | 0.7826 |
| empathy | emp.j | 0.9750 | 0.0595 | 16.3995 | 0 | 0.7249 |
Chart 5 qq-plot shows the residuals for Model 2. The residuals generally fall within the 0.95 confidence level.
Compared fit statistics for the base model (Model 1) and revised model (Model 2). Output 1 shows that both models achieved fit-measure targets. However, Model 2 was preferred with improved fit statistics and lower BIC.
Note: Fit measure targets: CFI, TLI, GFI > 0.90 | RMSEA, SRMR < 0.05 | model with lowest AIC and BIC.
Output 1 Comparison of model fit
####################### Model Fit Indices ###########################
chisq df pvalue cfi tli gfi rmsea srmr aic bic
b2b_fit1 96.000 25 .000 .976 .958 .954 .082 .025 11099.319 11220.811
b2b_fit2 91.780† 28 .000 .979† .966† .958† .073† .023† 11089.099† 11198.442†
This confirmatory factor analysis showed that all manifest variables significantly contribute to their latent factors. Modifying the theoretical model to resolve correlation issues between latent factors resulted in an improved fit.
Finally, assessed the overall reliability and internal consistency of this scale. The standardised Cronbach’s alpha was 0.9354.
Reference:
Data was gathered using a custom-designed survey instrument based on the SERVQUAL theoretical framework. The SERVQUAL methodology is documented in Delivering Quality Service: Balancing Customer Perceptions and Expectations by Zeithaml, Parasuraman and Berry.
## ─ Session info ───────────────────────────────────────────────────────────────
## setting value
## version R version 4.4.0 (2024-04-24 ucrt)
## os Windows 11 x64 (build 22631)
## system x86_64, mingw32
## ui RTerm
## language (EN)
## collate English_Australia.utf8
## ctype English_Australia.utf8
## tz Australia/Brisbane
## date 2024-07-29
## pandoc 3.1.11 @ C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)
##
## ─ Packages ───────────────────────────────────────────────────────────────────
## ! package * version date (UTC) lib source
## abind 1.4-5 2016-07-21 [1] CRAN (R 4.4.0)
## arm 1.14-4 2024-04-01 [1] CRAN (R 4.4.0)
## backports 1.5.0 2024-05-23 [1] CRAN (R 4.4.0)
## base64enc 0.1-3 2015-07-28 [1] CRAN (R 4.4.0)
## boot 1.3-30 2024-02-26 [2] CRAN (R 4.4.0)
## bslib 0.7.0 2024-03-29 [1] CRAN (R 4.4.0)
## cachem 1.1.0 2024-05-16 [1] CRAN (R 4.4.0)
## car * 3.1-2 2023-03-30 [1] CRAN (R 4.4.0)
## carData * 3.0-5 2022-01-06 [1] CRAN (R 4.4.0)
## checkmate 2.3.1 2023-12-04 [1] CRAN (R 4.4.0)
## cli 3.6.3 2024-06-21 [1] CRAN (R 4.4.1)
## cluster 2.1.6 2023-12-01 [2] CRAN (R 4.4.0)
## coda 0.19-4.1 2024-01-31 [1] CRAN (R 4.4.0)
## codetools 0.2-20 2024-03-31 [2] CRAN (R 4.4.0)
## colorspace 2.1-0 2023-01-23 [1] CRAN (R 4.4.1)
## corpcor 1.6.10 2021-09-16 [1] CRAN (R 4.4.0)
## data.table * 1.15.4 2024-03-30 [1] CRAN (R 4.4.0)
## devtools 2.4.5 2022-10-11 [1] CRAN (R 4.4.0)
## digest 0.6.36 2024-06-23 [1] CRAN (R 4.4.1)
## dplyr * 1.1.4 2023-11-17 [1] CRAN (R 4.4.0)
## ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.4.0)
## emmeans 1.10.3 2024-07-01 [1] CRAN (R 4.4.1)
## estimability 1.5.1 2024-05-12 [1] CRAN (R 4.4.0)
## evaluate 0.24.0 2024-06-10 [1] CRAN (R 4.4.0)
## fansi 1.0.6 2023-12-08 [1] CRAN (R 4.4.0)
## farver 2.1.2 2024-05-13 [1] CRAN (R 4.4.0)
## fastmap 1.2.0 2024-05-15 [1] CRAN (R 4.4.0)
## fdrtool 1.2.17 2021-11-13 [1] CRAN (R 4.4.0)
## forcats * 1.0.0 2023-01-29 [1] CRAN (R 4.4.0)
## foreign 0.8-86 2023-11-28 [2] CRAN (R 4.4.0)
## Formula 1.2-5 2023-02-24 [1] CRAN (R 4.4.0)
## fs 1.6.4 2024-04-25 [1] CRAN (R 4.4.0)
## generics 0.1.3 2022-07-05 [1] CRAN (R 4.4.0)
## GGally * 2.2.1 2024-02-14 [1] CRAN (R 4.4.0)
## ggplot2 * 3.5.1 2024-04-23 [1] CRAN (R 4.4.0)
## ggstats 0.6.0 2024-04-05 [1] CRAN (R 4.4.0)
## glasso 1.11 2019-10-01 [1] CRAN (R 4.4.0)
## glue 1.7.0 2024-01-09 [1] CRAN (R 4.4.0)
## gridExtra 2.3 2017-09-09 [1] CRAN (R 4.4.0)
## gtable 0.3.5 2024-04-22 [1] CRAN (R 4.4.0)
## gtools 3.9.5 2023-11-20 [1] CRAN (R 4.4.0)
## here * 1.0.1 2020-12-13 [1] CRAN (R 4.4.0)
## highr 0.11 2024-05-26 [1] CRAN (R 4.4.0)
## Hmisc 5.1-3 2024-05-28 [1] CRAN (R 4.4.0)
## hms 1.1.3 2023-03-21 [1] CRAN (R 4.4.0)
## htmlTable 2.4.3 2024-07-21 [1] CRAN (R 4.4.1)
## htmltools 0.5.8.1 2024-04-04 [1] CRAN (R 4.4.0)
## htmlwidgets 1.6.4 2023-12-06 [1] CRAN (R 4.4.0)
## httpuv 1.6.15 2024-03-26 [1] CRAN (R 4.4.0)
## igraph 2.0.3 2024-03-13 [1] CRAN (R 4.4.0)
## jpeg 0.1-10 2022-11-29 [1] CRAN (R 4.4.0)
## jquerylib 0.1.4 2021-04-26 [1] CRAN (R 4.4.0)
## jsonlite 1.8.8 2023-12-04 [1] CRAN (R 4.4.0)
## kableExtra * 1.4.0 2024-01-24 [1] CRAN (R 4.4.0)
## knitr 1.48 2024-07-07 [1] CRAN (R 4.4.1)
## kutils 1.73 2023-09-17 [1] CRAN (R 4.4.0)
## later 1.3.2 2023-12-06 [1] CRAN (R 4.4.0)
## lattice 0.22-6 2024-03-20 [2] CRAN (R 4.4.0)
## lavaan * 0.6-18 2024-06-07 [1] CRAN (R 4.4.0)
## lifecycle 1.0.4 2023-11-07 [1] CRAN (R 4.4.0)
## lisrelToR 0.3 2024-02-07 [1] CRAN (R 4.4.0)
## lme4 1.1-35.5 2024-07-03 [1] CRAN (R 4.4.1)
## lubridate * 1.9.3 2023-09-27 [1] CRAN (R 4.4.0)
## magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.4.0)
## MASS 7.3-60.2 2024-04-24 [2] local
## Matrix 1.7-0 2024-03-22 [2] CRAN (R 4.4.0)
## memoise 2.0.1 2021-11-26 [1] CRAN (R 4.4.0)
## mi 1.1 2022-06-06 [1] CRAN (R 4.4.0)
## mime 0.12 2021-09-28 [1] CRAN (R 4.4.0)
## miniUI 0.1.1.1 2018-05-18 [1] CRAN (R 4.4.0)
## minqa 1.2.7 2024-05-20 [1] CRAN (R 4.4.0)
## mnormt 2.1.1 2022-09-26 [1] CRAN (R 4.4.0)
## multcomp 1.4-26 2024-07-18 [1] CRAN (R 4.4.1)
## munsell 0.5.1 2024-04-01 [1] CRAN (R 4.4.0)
## mvtnorm 1.2-5 2024-05-21 [1] CRAN (R 4.4.0)
## nlme 3.1-164 2023-11-27 [2] CRAN (R 4.4.0)
## nloptr 2.1.1 2024-06-25 [1] CRAN (R 4.4.1)
## nnet 7.3-19 2023-05-03 [2] CRAN (R 4.4.0)
## OpenMx 2.21.11 2023-11-28 [1] CRAN (R 4.4.0)
## openxlsx 4.2.6.1 2024-07-23 [1] CRAN (R 4.4.1)
## pbapply 1.7-2 2023-06-27 [1] CRAN (R 4.4.0)
## pbivnorm 0.6.0 2015-01-23 [1] CRAN (R 4.4.0)
## pillar 1.9.0 2023-03-22 [1] CRAN (R 4.4.0)
## pkgbuild 1.4.4 2024-03-17 [1] CRAN (R 4.4.0)
## pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.4.0)
## pkgload 1.4.0 2024-06-28 [1] CRAN (R 4.4.1)
## plyr 1.8.9 2023-10-02 [1] CRAN (R 4.4.0)
## png 0.1-8 2022-11-29 [1] CRAN (R 4.4.0)
## profvis 0.3.8 2023-05-02 [1] CRAN (R 4.4.0)
## promises 1.3.0 2024-04-05 [1] CRAN (R 4.4.0)
## psych * 2.4.6.26 2024-06-27 [1] CRAN (R 4.4.1)
## purrr * 1.0.2 2023-08-10 [1] CRAN (R 4.4.0)
## qgraph 1.9.8 2023-11-03 [1] CRAN (R 4.4.0)
## quadprog 1.5-8 2019-11-20 [1] CRAN (R 4.4.0)
## R6 2.5.1 2021-08-19 [1] CRAN (R 4.4.0)
## RColorBrewer 1.1-3 2022-04-03 [1] CRAN (R 4.4.0)
## Rcpp 1.0.13 2024-07-17 [1] CRAN (R 4.4.1)
## D RcppParallel 5.1.8 2024-07-06 [1] CRAN (R 4.4.1)
## readr * 2.1.5 2024-01-10 [1] CRAN (R 4.4.0)
## remotes 2.5.0 2024-03-17 [1] CRAN (R 4.4.0)
## reshape2 1.4.4 2020-04-09 [1] CRAN (R 4.4.0)
## rlang 1.1.4 2024-06-04 [1] CRAN (R 4.4.0)
## rmarkdown 2.27 2024-05-17 [1] CRAN (R 4.4.0)
## rockchalk 1.8.157 2022-08-06 [1] CRAN (R 4.4.0)
## rpart 4.1.23 2023-12-05 [2] CRAN (R 4.4.0)
## rprojroot 2.0.4 2023-11-05 [1] CRAN (R 4.4.0)
## rstudioapi 0.16.0 2024-03-24 [1] CRAN (R 4.4.0)
## sandwich 3.1-0 2023-12-11 [1] CRAN (R 4.4.0)
## sass 0.4.9 2024-03-15 [1] CRAN (R 4.4.0)
## scales 1.3.0 2023-11-28 [1] CRAN (R 4.4.0)
## sem 3.1-15 2022-04-10 [1] CRAN (R 4.4.0)
## semPlot * 1.1.6 2022-08-10 [1] CRAN (R 4.4.0)
## semTools * 0.5-6 2022-05-10 [1] CRAN (R 4.4.0)
## sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.4.0)
## shiny 1.8.1.1 2024-04-02 [1] CRAN (R 4.4.0)
## stringi 1.8.4 2024-05-06 [1] CRAN (R 4.4.0)
## stringr * 1.5.1 2023-11-14 [1] CRAN (R 4.4.0)
## survival 3.5-8 2024-02-14 [2] CRAN (R 4.4.0)
## svglite 2.1.3 2023-12-08 [1] CRAN (R 4.4.0)
## systemfonts 1.1.0 2024-05-15 [1] CRAN (R 4.4.0)
## TH.data 1.1-2 2023-04-17 [1] CRAN (R 4.4.0)
## tibble * 3.2.1 2023-03-20 [1] CRAN (R 4.4.0)
## tidyr * 1.3.1 2024-01-24 [1] CRAN (R 4.4.0)
## tidyselect 1.2.1 2024-03-11 [1] CRAN (R 4.4.0)
## tidyverse * 2.0.0 2023-02-22 [1] CRAN (R 4.4.0)
## timechange 0.3.0 2024-01-18 [1] CRAN (R 4.4.0)
## tzdb 0.4.0 2023-05-12 [1] CRAN (R 4.4.0)
## urlchecker 1.0.1 2021-11-30 [1] CRAN (R 4.4.0)
## usethis 2.2.3 2024-02-19 [1] CRAN (R 4.4.0)
## utf8 1.2.4 2023-10-22 [1] CRAN (R 4.4.0)
## vctrs 0.6.5 2023-12-01 [1] CRAN (R 4.4.0)
## viridisLite 0.4.2 2023-05-02 [1] CRAN (R 4.4.0)
## withr 3.0.0 2024-01-16 [1] CRAN (R 4.4.0)
## xfun 0.46 2024-07-18 [1] CRAN (R 4.4.1)
## XML 3.99-0.17 2024-06-25 [1] CRAN (R 4.4.1)
## xml2 1.3.6 2023-12-04 [1] CRAN (R 4.4.0)
## xtable 1.8-4 2019-04-21 [1] CRAN (R 4.4.0)
## yaml 2.3.9 2024-07-05 [1] CRAN (R 4.4.1)
## zip 2.3.1 2024-01-27 [1] CRAN (R 4.4.0)
## zoo 1.8-12 2023-04-13 [1] CRAN (R 4.4.0)
##
## [1] C:/Users/wayne/AppData/Local/R/win-library/4.4
## [2] C:/Program Files/R/R-4.4.0/library
##
## D ── DLL MD5 mismatch, broken installation.
##
## ──────────────────────────────────────────────────────────────────────────────