• Data Preparation
  • Part I: Clean the table
  • Part II: Exploratory Factorial Analysis (EFA)
  • Part III: Confirmatory Factorial Analysis
  • Part IV: Cronbach’s Alpha
    • Cronbach’s Alpha
    • Discriminant validity

Data Preparation

Load libraries

library(tidyverse, readxl)
## -- Attaching packages --------------------------------------------------- tidyverse 1.3.0 --
## v ggplot2 3.3.2     v purrr   0.3.4
## v tibble  3.0.3     v dplyr   1.0.2
## v tidyr   1.1.2     v stringr 1.4.0
## v readr   1.3.1     v forcats 0.5.0
## -- Conflicts ------------------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
library(faraway)
library(mctest, REdaS)
library(psych, corrgram)
## 
## Attaching package: 'psych'
## The following object is masked from 'package:faraway':
## 
##     logit
## The following objects are masked from 'package:ggplot2':
## 
##     %+%, alpha

Load table

Select one file to import.

tbl <- readxl::read_excel('ORIGINAL.xlsx', col_names = TRUE)
#tbl <- readxl::read_excel('tab_original.xlsx', sheet = 'Smart PLS', col_names = TRUE)
tbl %>% head()
## # A tibble: 6 x 39
##      V1    V2    V3    V4    V5    V6    V7    V8    V9   V10   V11   V12   V13
##   <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1     3     3     2     3     3     4     3     3     2     3     3     4     2
## 2     1     5     2     1     5     4     2     4     2     4     4     4     3
## 3     3     3     1     2     5     5     2     4     2     5     3     5     1
## 4     3     3     2     3     1     1     5     1     1     5     5     5     1
## 5     2     3     4     2     2     3     3     1     2     4     3     4     2
## 6     1     5     3     1     5     5     3     5     3     5     5     5     3
## # ... with 26 more variables: V14 <dbl>, V15 <dbl>, V16 <dbl>, V17 <dbl>,
## #   V18 <dbl>, V19 <dbl>, V20 <dbl>, V21 <dbl>, V22 <dbl>, V23 <dbl>,
## #   V24 <dbl>, V25 <dbl>, V26 <dbl>, V27 <dbl>, V28 <dbl>, V29 <dbl>,
## #   V30 <dbl>, V31 <dbl>, V32 <dbl>, V33 <dbl>, V34 <dbl>, V35 <dbl>,
## #   V36 <dbl>, V37 <dbl>, V38 <dbl>, V39 <dbl>

Exclude dichotomous variables

dic <- apply(tbl, 2 , function(x) length(unique(x)))
tbl <- tbl[dic > 2]
tbl %>% head()
## # A tibble: 6 x 39
##      V1    V2    V3    V4    V5    V6    V7    V8    V9   V10   V11   V12   V13
##   <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1     3     3     2     3     3     4     3     3     2     3     3     4     2
## 2     1     5     2     1     5     4     2     4     2     4     4     4     3
## 3     3     3     1     2     5     5     2     4     2     5     3     5     1
## 4     3     3     2     3     1     1     5     1     1     5     5     5     1
## 5     2     3     4     2     2     3     3     1     2     4     3     4     2
## 6     1     5     3     1     5     5     3     5     3     5     5     5     3
## # ... with 26 more variables: V14 <dbl>, V15 <dbl>, V16 <dbl>, V17 <dbl>,
## #   V18 <dbl>, V19 <dbl>, V20 <dbl>, V21 <dbl>, V22 <dbl>, V23 <dbl>,
## #   V24 <dbl>, V25 <dbl>, V26 <dbl>, V27 <dbl>, V28 <dbl>, V29 <dbl>,
## #   V30 <dbl>, V31 <dbl>, V32 <dbl>, V33 <dbl>, V34 <dbl>, V35 <dbl>,
## #   V36 <dbl>, V37 <dbl>, V38 <dbl>, V39 <dbl>

Correlation matrix

corrgram::corrgram(tbl)
## Registered S3 method overwritten by 'seriation':
##   method         from 
##   reorder.hclust gclus

Part I: Clean the table

MSA and KMO tests

KMO Reference
0.9 - 1.0 Marvelous
0.8 - 0.9 Meritorious
0.7 - 0.8 Middling
0.6 - 0.7 Mediocre
0.5 - 0.6 Miserable
less than 0,5 Unacceptable
kmos <- REdaS::KMOS(tbl)
kmos
## 
## Kaiser-Meyer-Olkin Statistics
## 
## Call: REdaS::KMOS(x = tbl)
## 
## Measures of Sampling Adequacy (MSA):
##        V1        V2        V3        V4        V5        V6        V7        V8 
## 0.3863221 0.2888696 0.5430261 0.5332195 0.4045718 0.5742530 0.7057292 0.3183750 
##        V9       V10       V11       V12       V13       V14       V15       V16 
## 0.2368494 0.3179444 0.4257270 0.3194953 0.3125138 0.2812793 0.5844332 0.2517149 
##       V17       V18       V19       V20       V21       V22       V23       V24 
## 0.4511708 0.1917775 0.4782174 0.6763129 0.4410895 0.6493593 0.3091503 0.6710117 
##       V25       V26       V27       V28       V29       V30       V31       V32 
## 0.4413103 0.5826637 0.4164522 0.2473532 0.5208505 0.4154455 0.3537410 0.5772935 
##       V33       V34       V35       V36       V37       V38       V39 
## 0.5153674 0.3066627 0.2645096 0.3848108 0.1587135 0.0941182 0.1287547 
## 
## KMO-Criterion: 0.3942645

MSA distribution on each range.

df <- data.frame(Marvelous = round(100*mean(0.9 < kmos$MSA), 2),
                         Meritorious   = round(100*mean(0.8 < kmos$MSA & kmos$MSA <= 0.9), 2),
                         Middling    = round(100*mean(0.7 < kmos$MSA & kmos$MSA <= 0.8), 2),
                         Mediocre    = round(100*mean(0.6 < kmos$MSA & kmos$MSA <= 0.7), 2),
                         Miserable   = round(100*mean(0.5 < kmos$MSA & kmos$MSA <= 0.6), 2),
                         Unacceptable = round(100*mean(kmos$MSA <= 0.5), 2))
df
##   Marvelous Meritorious Middling Mediocre Miserable Unacceptable
## 1         0           0     2.56     7.69     20.51        69.23

Exclude variables with MSA < 0.50, one variable at time stating with lower KMO.

exclude <- mean(kmos$MSA < 0.5) > 0
while(exclude){
    tbl <- tbl[kmos$MSA != min(kmos$MSA)]
    kmos <- REdaS::KMOS(tbl)
    exclude <- mean(kmos$MSA < 0.5) > 0
}

Result after excluding variables.

df <- data.frame(Marvelous = round(100*mean(0.9 < kmos$MSA), 2),
                         Meritorious   = round(100*mean(0.8 < kmos$MSA & kmos$MSA <= 0.9), 2),
                         Middling    = round(100*mean(0.7 < kmos$MSA & kmos$MSA <= 0.8), 2),
                         Mediocre    = round(100*mean(0.6 < kmos$MSA & kmos$MSA <= 0.7), 2),
                         Miserable   = round(100*mean(0.5 < kmos$MSA & kmos$MSA <= 0.6), 2),
                         Unacceptable = round(100*mean(kmos$MSA <= 0.5), 2))
df
##   Marvelous Meritorious Middling Mediocre Miserable Unacceptable
## 1      3.33       13.33    33.33    33.33     16.67            0

Variance Inflation Factor (VIF)

Exclude variables with values larger than 10.

# Build formula
fml <- paste0(colnames(tbl)[1],' ~ ', paste(colnames(tbl)[-1], collapse = " + "))
fml <- as.formula(fml)
model <- lm(fml, data = tbl)
imc <-  imcdiag(model, method = "VIF", vif = 10)[[1]][,1]
exclude <- mean(imc > 10) > 0
while(exclude){
    # Exclude column with largest VIF
    i <- imc %>% sort(decreasing = TRUE)
    ii <- colnames(tbl) %in% names(i)[1]
    tbl <- tbl[!ii]
    cat('Variable removed:', names(i)[1])
    # Build formula
    fml <- paste0(colnames(tbl)[1],' ~ ', paste(colnames(tbl)[-1], collapse = " + "))
    fml <- as.formula(fml)
    # Create model
    model <- lm(fml, data = tbl)
    # Measure colinearity
    imc <-  imcdiag(model, method = "VIF", vif = 10)[[1]][,1]
    exclude <- mean(imc > 10) > 0
}
## Variable removed: V32Variable removed: V26

After removing the variables, there’s no co-linearity.

imcdiag(model, method = "VIF", vif = 10)
## 
## Call:
## imcdiag(mod = model, method = "VIF", vif = 10)
## 
## 
##  VIF Multicollinearity Diagnostics
## 
##        VIF detection
## V2  3.8602         0
## V3  2.8566         0
## V4  6.1227         0
## V5  4.5287         0
## V6  3.1706         0
## V7  3.4121         0
## V10 3.7700         0
## V11 3.7743         0
## V13 2.8579         0
## V14 3.6790         0
## V15 4.5054         0
## V16 3.7317         0
## V17 3.6933         0
## V19 3.2066         0
## V20 3.6005         0
## V21 7.0210         0
## V22 3.9780         0
## V23 3.9217         0
## V24 3.2466         0
## V25 3.6634         0
## V27 8.5060         0
## V29 4.7419         0
## V30 3.9918         0
## V31 4.2783         0
## V33 5.1438         0
## V35 4.4911         0
## V36 5.6376         0
## 
## NOTE:  VIF Method Failed to detect multicollinearity
## 
## 
## 0 --> COLLINEARITY is not detected by the test
## 
## ===================================

Bartlett’s Test of Sphericity

REdaS::bart_spher(tbl)
##  Bartlett's Test of Sphericity
## 
## Call: REdaS::bart_spher(x = tbl)
## 
##      X2 = 802.684
##      df = 378
## p-value < 2.22e-16

Part II: Exploratory Factorial Analysis (EFA)

Correlation matrix compared to random “parallel” matrices

nfactors <- fa.parallel(tbl, plot = FALSE)
## Parallel analysis suggests that the number of factors =  3  and the number of components =  3
nfactors
## Call: fa.parallel(x = tbl, plot = FALSE)
## Parallel analysis suggests that the number of factors =  3  and the number of components =  3 
## 
##  Eigen Values of 
##   Original factors Resampled data Simulated data Original components
## 1             9.12           2.01           2.08                9.73
## 2             2.29           1.60           1.64                3.02
## 3             2.06           1.34           1.36                2.78
##   Resampled components Simulated components
## 1                 2.84                 2.90
## 2                 2.55                 2.59
## 3                 2.28                 2.30

Correlation matrix

corMat <- cor(tbl)

Factor analysis

nfact <- nfactors$nfact
fa <- factanal(tbl, factors=nfact, scores="regression")
fa
## 
## Call:
## factanal(x = tbl, factors = nfact, scores = "regression")
## 
## Uniquenesses:
##    V1    V2    V3    V4    V5    V6    V7   V10   V11   V13   V14   V15   V16 
## 0.213 0.560 0.471 0.252 0.478 0.673 0.601 0.498 0.527 0.813 0.727 0.361 0.758 
##   V17   V19   V20   V21   V22   V23   V24   V25   V27   V29   V30   V31   V33 
## 0.343 0.820 0.437 0.361 0.367 0.643 0.444 0.709 0.220 0.342 0.680 0.441 0.357 
##   V35   V36 
## 0.658 0.401 
## 
## Loadings:
##     Factor1 Factor2 Factor3
## V1  -0.814  -0.298  -0.188 
## V2   0.576   0.328         
## V3   0.658   0.134   0.278 
## V4  -0.814  -0.220  -0.191 
## V5   0.648   0.220   0.232 
## V6   0.467   0.288   0.163 
## V7   0.249   0.384   0.435 
## V10          0.648   0.285 
## V11  0.202   0.612   0.239 
## V13  0.422                 
## V14  0.495   0.158         
## V15          0.788   0.109 
## V16  0.492                 
## V17  0.213   0.780         
## V19  0.379  -0.138   0.130 
## V20  0.527   0.368   0.388 
## V21  0.448   0.651   0.123 
## V22  0.235   0.752   0.109 
## V23  0.544   0.237         
## V24          0.732   0.125 
## V25  0.522           0.116 
## V27  0.319  -0.143   0.811 
## V29  0.302   0.241   0.713 
## V30          0.237   0.512 
## V31  0.332   0.316   0.591 
## V33  0.172   0.179   0.763 
## V35          0.111   0.573 
## V36  0.302           0.711 
## 
##                Factor1 Factor2 Factor3
## SS loadings      5.225   4.613   4.005
## Proportion Var   0.187   0.165   0.143
## Cumulative Var   0.187   0.351   0.494
## 
## Test of the hypothesis that 3 factors are sufficient.
## The chi square statistic is 326.54 on 297 degrees of freedom.
## The p-value is 0.115

Exploratory factor analysis using minimum residual.

N <- nrow(tbl)
faPC <- fa(r = corMat, nfactors = nfact, n.obs = N, rotate = "varimax")
print(faPC)
## Factor Analysis using method =  minres
## Call: fa(r = corMat, nfactors = nfact, n.obs = N, rotate = "varimax")
## Standardized loadings (pattern matrix) based upon correlation matrix
##       MR1   MR2   MR3   h2   u2 com
## V1  -0.64 -0.38 -0.29 0.63 0.37 2.1
## V2   0.49  0.36  0.07 0.37 0.63 1.9
## V3   0.51  0.19  0.36 0.43 0.57 2.1
## V4  -0.64 -0.29 -0.29 0.58 0.42 1.8
## V5   0.61  0.26  0.27 0.52 0.48 1.8
## V6   0.51  0.30  0.15 0.37 0.63 1.8
## V7   0.22  0.39  0.41 0.37 0.63 2.5
## V10  0.05  0.63  0.25 0.46 0.54 1.3
## V11  0.27  0.61  0.17 0.47 0.53 1.6
## V13  0.52  0.03  0.09 0.27 0.73 1.1
## V14  0.62  0.16  0.01 0.41 0.59 1.1
## V15  0.04  0.78  0.11 0.62 0.38 1.0
## V16  0.65 -0.03 -0.03 0.43 0.57 1.0
## V17  0.21  0.78  0.07 0.66 0.34 1.2
## V19  0.56 -0.18  0.10 0.35 0.65 1.3
## V20  0.52  0.37  0.42 0.59 0.41 2.8
## V21  0.37  0.68  0.17 0.63 0.37 1.7
## V22  0.21  0.76  0.11 0.63 0.37 1.2
## V23  0.57  0.24  0.12 0.39 0.61 1.5
## V24 -0.04  0.75  0.16 0.60 0.40 1.1
## V25  0.64  0.09  0.04 0.42 0.58 1.0
## V27  0.33 -0.12  0.78 0.74 0.26 1.4
## V29  0.26  0.25  0.72 0.64 0.36 1.5
## V30 -0.07  0.22  0.55 0.35 0.65 1.3
## V31  0.28  0.33  0.60 0.55 0.45 2.0
## V33  0.12  0.18  0.77 0.64 0.36 1.2
## V35 -0.04  0.08  0.61 0.38 0.62 1.0
## V36  0.22  0.08  0.74 0.61 0.39 1.2
## 
##                        MR1  MR2  MR3
## SS loadings           5.02 4.85 4.26
## Proportion Var        0.18 0.17 0.15
## Cumulative Var        0.18 0.35 0.50
## Proportion Explained  0.36 0.34 0.30
## Cumulative Proportion 0.36 0.70 1.00
## 
## Mean item complexity =  1.5
## Test of the hypothesis that 3 factors are sufficient.
## 
## The degrees of freedom for the null model are  378  and the objective function was  24.45 with Chi Square of  802.68
## The degrees of freedom for the model are 297  and the objective function was  10.69 
## 
## The root mean square of the residuals (RMSR) is  0.08 
## The df corrected root mean square of the residuals is  0.09 
## 
## The harmonic number of observations is  44 with the empirical chi square  209.31  with prob <  1 
## The total number of observations was  44  with Likelihood Chi Square =  329.62  with prob <  0.094 
## 
## Tucker Lewis Index of factoring reliability =  0.89
## RMSEA index =  0.044  and the 90 % confidence intervals are  0 0.08
## BIC =  -794.28
## Fit based upon off diagonal values = 0.95
## Measures of factor score adequacy             
##                                                    MR1  MR2  MR3
## Correlation of (regression) scores with factors   0.93 0.95 0.94
## Multiple R square of scores with factors          0.87 0.90 0.89
## Minimum correlation of possible factor scores     0.74 0.79 0.78

Remove variables with low commonalities (h2 < 0.40).

h2 <- faPC$communality            # Column h2 
exclui <- mean(h2 < 0.40) > 0     # TRUE se houver h2 < 0.40
while(exclui){
    tbl <- tbl[!(h2 == min(h2))]    # Exclui variavel com menor h2
    nfactors <- fa.parallel(tbl, plot = FALSE)  # Recalcula nfactors
    nfact <- nfactors$nfact         # Number of factors
    N <- nrow(tbl)                  # Number of rows in new table
    corMat <- cor(tbl)              # Recompute correlation
    faPC <- fa(r = corMat, nfactors = nfact, n.obs = N, rotate = "varimax")
    h2 <- faPC$communality          # Column h2 
    exclui <- mean(h2 < 0.40) > 0   # Continue while h2 < 0.40
}
## Parallel analysis suggests that the number of factors =  3  and the number of components =  3
## Warning in fa.stats(r = r, f = f, phi = phi, n.obs = n.obs, np.obs = np.obs, :
## The estimated weights for the factor scores are probably incorrect. Try a
## different factor score estimation method.
## Warning in fac(r = r, nfactors = nfactors, n.obs = n.obs, rotate = rotate, : An
## ultra-Heywood case was detected. Examine the results carefully
## Parallel analysis suggests that the number of factors =  3  and the number of components =  3 
## Parallel analysis suggests that the number of factors =  3  and the number of components =  3 
## Parallel analysis suggests that the number of factors =  3  and the number of components =  3 
## Parallel analysis suggests that the number of factors =  3  and the number of components =  2
## Warning in fa.stats(r = r, f = f, phi = phi, n.obs = n.obs, np.obs = np.obs, :
## The estimated weights for the factor scores are probably incorrect. Try a
## different factor score estimation method.
## Parallel analysis suggests that the number of factors =  3  and the number of components =  3 
## Parallel analysis suggests that the number of factors =  3  and the number of components =  2 
## Parallel analysis suggests that the number of factors =  3  and the number of components =  2 
## Parallel analysis suggests that the number of factors =  3  and the number of components =  3
print(faPC)
## Factor Analysis using method =  minres
## Call: fa(r = corMat, nfactors = nfact, n.obs = N, rotate = "varimax")
## Standardized loadings (pattern matrix) based upon correlation matrix
##       MR2   MR1   MR3   h2   u2 com
## V1  -0.27 -0.86 -0.09 0.83 0.17 1.2
## V3   0.08  0.74  0.18 0.58 0.42 1.1
## V4  -0.20 -0.83 -0.12 0.74 0.26 1.2
## V5   0.25  0.58  0.22 0.44 0.56 1.7
## V10  0.69  0.02  0.31 0.58 0.42 1.4
## V11  0.62  0.24  0.15 0.47 0.53 1.4
## V15  0.79  0.10  0.10 0.64 0.36 1.1
## V17  0.76  0.23  0.04 0.64 0.36 1.2
## V20  0.37  0.54  0.36 0.55 0.45 2.6
## V21  0.63  0.51  0.03 0.66 0.34 1.9
## V22  0.76  0.26  0.06 0.65 0.35 1.2
## V24  0.70  0.12  0.14 0.52 0.48 1.1
## V27 -0.12  0.41  0.73 0.71 0.29 1.6
## V29  0.21  0.46  0.59 0.61 0.39 2.2
## V30  0.25 -0.08  0.67 0.52 0.48 1.3
## V31  0.29  0.47  0.48 0.53 0.47 2.6
## V33  0.15  0.34  0.65 0.56 0.44 1.6
## V35  0.13 -0.03  0.71 0.52 0.48 1.1
## V36  0.05  0.36  0.70 0.62 0.38 1.5
## 
##                        MR2  MR1  MR3
## SS loadings           4.12 3.91 3.36
## Proportion Var        0.22 0.21 0.18
## Cumulative Var        0.22 0.42 0.60
## Proportion Explained  0.36 0.34 0.30
## Cumulative Proportion 0.36 0.70 1.00
## 
## Mean item complexity =  1.5
## Test of the hypothesis that 3 factors are sufficient.
## 
## The degrees of freedom for the null model are  171  and the objective function was  14.69 with Chi Square of  526.21
## The degrees of freedom for the model are 117  and the objective function was  3.48 
## 
## The root mean square of the residuals (RMSR) is  0.06 
## The df corrected root mean square of the residuals is  0.07 
## 
## The harmonic number of observations is  44 with the empirical chi square  46.96  with prob <  1 
## The total number of observations was  44  with Likelihood Chi Square =  117.61  with prob <  0.47 
## 
## Tucker Lewis Index of factoring reliability =  0.997
## RMSEA index =  0  and the 90 % confidence intervals are  0 0.077
## BIC =  -325.14
## Fit based upon off diagonal values = 0.98
## Measures of factor score adequacy             
##                                                    MR2  MR1  MR3
## Correlation of (regression) scores with factors   0.94 0.95 0.93
## Multiple R square of scores with factors          0.89 0.90 0.86
## Minimum correlation of possible factor scores     0.78 0.79 0.72

Scree plot

fa.parallel(tbl)

## Parallel analysis suggests that the number of factors =  3  and the number of components =  3

Graph factor loading matrices. Identify factors with corresponding variables.

fa.diagram(faPC)

Apply the Very Simple Structure, MAP, and other criteria to determine the appropriate number of factors.

vss(tbl, n.obs=N, rotate='varimax')

## 
## Very Simple Structure
## Call: vss(x = tbl, rotate = "varimax", n.obs = N)
## VSS complexity 1 achieves a maximimum of 0.8  with  1  factors
## VSS complexity 2 achieves a maximimum of 0.89  with  2  factors
## 
## The Velicer MAP achieves a minimum of 0.04  with  4  factors 
## BIC achieves a minimum of  -325.14  with  3  factors
## Sample Size adjusted BIC achieves a minimum of  -5.09  with  8  factors
## 
## Statistics by number of factors 
##   vss1 vss2   map dof chisq    prob sqresid  fit RMSEA  BIC  SABIC complex
## 1 0.80 0.00 0.069 152   277 2.3e-09    15.6 0.80 0.135 -298 178.49     1.0
## 2 0.67 0.89 0.048 134   183 3.1e-03     8.2 0.89 0.088 -324  95.94     1.3
## 3 0.58 0.89 0.040 117   118 4.7e-01     4.3 0.94 0.000 -325  41.49     1.5
## 4 0.56 0.82 0.037 101    84 8.8e-01     3.2 0.96 0.000 -298  18.77     1.6
## 5 0.51 0.77 0.042  86    63 9.7e-01     2.6 0.97 0.000 -262   7.53     1.7
## 6 0.49 0.73 0.045  72    47 9.9e-01     2.1 0.97 0.000 -226  -0.33     1.9
## 7 0.47 0.74 0.049  59    35 9.9e-01     1.7 0.98 0.000 -188  -3.17     2.0
## 8 0.47 0.71 0.056  47    25 1.0e+00     1.4 0.98 0.000 -152  -5.09     2.1
##   eChisq  SRMR eCRMS eBIC
## 1  355.9 0.154 0.163 -219
## 2  143.6 0.098 0.110 -363
## 3   47.0 0.056 0.068 -396
## 4   25.7 0.041 0.054 -357
## 5   17.7 0.034 0.048 -308
## 6   10.3 0.026 0.040 -262
## 7    6.4 0.021 0.035 -217
## 8    3.5 0.015 0.029 -174

Part III: Confirmatory Factorial Analysis

Build the model for future use.

library(lavaan, semPlot)
## This is lavaan 0.6-7
## lavaan is BETA software! Please report any bugs.
## 
## Attaching package: 'lavaan'
## The following object is masked from 'package:psych':
## 
##     cor2cov
library(qlcMatrix)
## Loading required package: Matrix
## 
## Attaching package: 'Matrix'
## The following objects are masked from 'package:tidyr':
## 
##     expand, pack, unpack
## Loading required package: slam
## Loading required package: sparsesvd
## 
## Attaching package: 'qlcMatrix'
## The following object is masked from 'package:purrr':
## 
##     none
faResult <- data.frame(faPC$Structure %>% head(nrow(tbl)))
MR <- apply(faResult, 1, function(x) colnames(faResult[which.max(x)]))

create_fml <- function(x) {
    varNames <- names(MR[MR == x])
    vars <- str_c(varNames, collapse = ' + ')
    fml <- paste0(x, " =~ ", vars)
    return(fml)
}
# Model
mdl <- str_c(sapply(unique(MR), create_fml))
print(mdl)
## [1] "MR3 =~ V1 + V4 + V27 + V29 + V30 + V31 + V33 + V35 + V36"
## [2] "MR1 =~ V3 + V5 + V20"                                    
## [3] "MR2 =~ V10 + V11 + V15 + V17 + V21 + V22 + V24"

Fit confirmatory factor analysis models.

fit<- lavaan::cfa(mdl,data= tbl)
summary(fit, fit.measures=TRUE)
## lavaan 0.6-7 ended normally after 43 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of free parameters                         41
##                                                       
##   Number of observations                            44
##                                                       
## Model Test User Model:
##                                                       
##   Test statistic                               258.141
##   Degrees of freedom                               149
##   P-value (Chi-square)                           0.000
## 
## Model Test Baseline Model:
## 
##   Test statistic                               646.140
##   Degrees of freedom                               171
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.770
##   Tucker-Lewis Index (TLI)                       0.736
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)              -1037.766
##   Loglikelihood unrestricted model (H1)       -908.696
##                                                       
##   Akaike (AIC)                                2157.532
##   Bayesian (BIC)                              2230.684
##   Sample-size adjusted Bayesian (BIC)         2102.206
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.129
##   90 Percent confidence interval - lower         0.102
##   90 Percent confidence interval - upper         0.155
##   P-value RMSEA <= 0.05                          0.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.117
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   MR3 =~                                              
##     V1                1.000                           
##     V4                1.093    0.292    3.742    0.000
##     V27              -1.150    0.271   -4.248    0.000
##     V29              -0.917    0.199   -4.605    0.000
##     V30              -0.730    0.268   -2.724    0.006
##     V31              -0.804    0.190   -4.243    0.000
##     V33              -1.104    0.254   -4.347    0.000
##     V35              -0.701    0.241   -2.905    0.004
##     V36              -1.288    0.306   -4.214    0.000
##   MR1 =~                                              
##     V3                1.000                           
##     V5                0.961    0.258    3.724    0.000
##     V20               1.087    0.253    4.306    0.000
##   MR2 =~                                              
##     V10               1.000                           
##     V11               1.447    0.330    4.386    0.000
##     V15               1.228    0.262    4.687    0.000
##     V17               1.414    0.294    4.815    0.000
##     V21               1.412    0.305    4.630    0.000
##     V22               1.457    0.293    4.966    0.000
##     V24               1.108    0.255    4.339    0.000
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   MR3 ~~                                              
##     MR1              -0.585    0.206   -2.834    0.005
##     MR2              -0.201    0.088   -2.277    0.023
##   MR1 ~~                                              
##     MR2               0.263    0.104    2.527    0.012
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##    .V1                0.882    0.203    4.352    0.000
##    .V4                1.154    0.263    4.382    0.000
##    .V27               0.719    0.174    4.140    0.000
##    .V29               0.273    0.072    3.764    0.000
##    .V30               1.401    0.306    4.577    0.000
##    .V31               0.354    0.085    4.144    0.000
##    .V33               0.582    0.143    4.063    0.000
##    .V35               1.082    0.237    4.555    0.000
##    .V36               0.942    0.226    4.163    0.000
##    .V3                0.876    0.215    4.070    0.000
##    .V5                0.841    0.205    4.094    0.000
##    .V20               0.494    0.152    3.256    0.001
##    .V10               0.266    0.063    4.227    0.000
##    .V11               0.514    0.123    4.190    0.000
##    .V15               0.272    0.068    4.005    0.000
##    .V17               0.311    0.080    3.896    0.000
##    .V21               0.382    0.094    4.047    0.000
##    .V22               0.274    0.073    3.731    0.000
##    .V24               0.316    0.075    4.213    0.000
##     MR3               0.654    0.278    2.348    0.019
##     MR1               0.681    0.295    2.312    0.021
##     MR2               0.253    0.099    2.559    0.010

Plot path diagram for SEM models.

semPlot::semPaths(fit, 'par', edge.label.cex=1.2,fade=FALSE)
## Registered S3 methods overwritten by 'huge':
##   method    from   
##   plot.sim  BDgraph
##   print.sim BDgraph

Parameter estimates of a latent variable model.

parameterEstimates(fit, standardized=TRUE)
##    lhs op rhs    est    se      z pvalue ci.lower ci.upper std.lv std.all
## 1  MR3 =~  V1  1.000 0.000     NA     NA    1.000    1.000  0.808   0.653
## 2  MR3 =~  V4  1.093 0.292  3.742  0.000    0.521    1.666  0.884   0.635
## 3  MR3 =~ V27 -1.150 0.271 -4.248  0.000   -1.680   -0.619 -0.929  -0.739
## 4  MR3 =~ V29 -0.917 0.199 -4.605  0.000   -1.307   -0.527 -0.741  -0.818
## 5  MR3 =~ V30 -0.730 0.268 -2.724  0.006   -1.256   -0.205 -0.590  -0.446
## 6  MR3 =~ V31 -0.804 0.190 -4.243  0.000   -1.176   -0.433 -0.650  -0.738
## 7  MR3 =~ V33 -1.104 0.254 -4.347  0.000   -1.601   -0.606 -0.892  -0.760
## 8  MR3 =~ V35 -0.701 0.241 -2.905  0.004   -1.174   -0.228 -0.567  -0.479
## 9  MR3 =~ V36 -1.288 0.306 -4.214  0.000   -1.887   -0.689 -1.042  -0.732
## 10 MR1 =~  V3  1.000 0.000     NA     NA    1.000    1.000  0.825   0.661
## 11 MR1 =~  V5  0.961 0.258  3.724  0.000    0.455    1.467  0.794   0.654
## 12 MR1 =~ V20  1.087 0.253  4.306  0.000    0.592    1.582  0.898   0.787
## 13 MR2 =~ V10  1.000 0.000     NA     NA    1.000    1.000  0.503   0.698
## 14 MR2 =~ V11  1.447 0.330  4.386  0.000    0.800    2.093  0.727   0.712
## 15 MR2 =~ V15  1.228 0.262  4.687  0.000    0.715    1.742  0.617   0.764
## 16 MR2 =~ V17  1.414 0.294  4.815  0.000    0.838    1.989  0.710   0.787
## 17 MR2 =~ V21  1.412 0.305  4.630  0.000    0.814    2.010  0.710   0.754
## 18 MR2 =~ V22  1.457 0.293  4.966  0.000    0.882    2.032  0.732   0.814
## 19 MR2 =~ V24  1.108 0.255  4.339  0.000    0.607    1.608  0.557   0.704
## 20  V1 ~~  V1  0.882 0.203  4.352  0.000    0.485    1.279  0.882   0.574
## 21  V4 ~~  V4  1.154 0.263  4.382  0.000    0.638    1.670  1.154   0.596
## 22 V27 ~~ V27  0.719 0.174  4.140  0.000    0.379    1.059  0.719   0.454
## 23 V29 ~~ V29  0.273 0.072  3.764  0.000    0.131    0.415  0.273   0.332
## 24 V30 ~~ V30  1.401 0.306  4.577  0.000    0.801    2.001  1.401   0.801
## 25 V31 ~~ V31  0.354 0.085  4.144  0.000    0.187    0.522  0.354   0.456
## 26 V33 ~~ V33  0.582 0.143  4.063  0.000    0.301    0.863  0.582   0.422
## 27 V35 ~~ V35  1.082 0.237  4.555  0.000    0.616    1.547  1.082   0.771
## 28 V36 ~~ V36  0.942 0.226  4.163  0.000    0.499    1.386  0.942   0.465
## 29  V3 ~~  V3  0.876 0.215  4.070  0.000    0.454    1.298  0.876   0.563
## 30  V5 ~~  V5  0.841 0.205  4.094  0.000    0.439    1.244  0.841   0.572
## 31 V20 ~~ V20  0.494 0.152  3.256  0.001    0.196    0.791  0.494   0.380
## 32 V10 ~~ V10  0.266 0.063  4.227  0.000    0.142    0.389  0.266   0.513
## 33 V11 ~~ V11  0.514 0.123  4.190  0.000    0.274    0.755  0.514   0.493
## 34 V15 ~~ V15  0.272 0.068  4.005  0.000    0.139    0.405  0.272   0.416
## 35 V17 ~~ V17  0.311 0.080  3.896  0.000    0.155    0.467  0.311   0.381
## 36 V21 ~~ V21  0.382 0.094  4.047  0.000    0.197    0.568  0.382   0.432
## 37 V22 ~~ V22  0.274 0.073  3.731  0.000    0.130    0.418  0.274   0.338
## 38 V24 ~~ V24  0.316 0.075  4.213  0.000    0.169    0.463  0.316   0.505
## 39 MR3 ~~ MR3  0.654 0.278  2.348  0.019    0.108    1.199  1.000   1.000
## 40 MR1 ~~ MR1  0.681 0.295  2.312  0.021    0.104    1.259  1.000   1.000
## 41 MR2 ~~ MR2  0.253 0.099  2.559  0.010    0.059    0.446  1.000   1.000
## 42 MR3 ~~ MR1 -0.585 0.206 -2.834  0.005   -0.989   -0.180 -0.876  -0.876
## 43 MR3 ~~ MR2 -0.201 0.088 -2.277  0.023   -0.374   -0.028 -0.494  -0.494
## 44 MR1 ~~ MR2  0.263 0.104  2.527  0.012    0.059    0.467  0.634   0.634
##    std.nox
## 1    0.653
## 2    0.635
## 3   -0.739
## 4   -0.818
## 5   -0.446
## 6   -0.738
## 7   -0.760
## 8   -0.479
## 9   -0.732
## 10   0.661
## 11   0.654
## 12   0.787
## 13   0.698
## 14   0.712
## 15   0.764
## 16   0.787
## 17   0.754
## 18   0.814
## 19   0.704
## 20   0.574
## 21   0.596
## 22   0.454
## 23   0.332
## 24   0.801
## 25   0.456
## 26   0.422
## 27   0.771
## 28   0.465
## 29   0.563
## 30   0.572
## 31   0.380
## 32   0.513
## 33   0.493
## 34   0.416
## 35   0.381
## 36   0.432
## 37   0.338
## 38   0.505
## 39   1.000
## 40   1.000
## 41   1.000
## 42  -0.876
## 43  -0.494
## 44   0.634

Part IV: Cronbach’s Alpha

Alfa_R.pdf

2a Methodology: Method 1: see CFA_Plot1.pdf (page 11) (α ≥ 0,7 better if ≥0,9)

factor1 <- select(tbl, nep1, nep6, nep11) #subset data using dplyr 
factor2 <- select(tbl, nep2, nep7, nep12)(
alpha(factor1) #function from psych package to calculate cronbach's alpha 

Method 2: see CReliability.pdf Correlation data frame

library(corrr)
tbl %>% correlate()
## 
## Correlation method: 'pearson'
## Missing treated using: 'pairwise.complete.obs'
## # A tibble: 19 x 20
##    rowname     V1      V3     V4     V5     V10    V11     V15      V17    V20
##    <chr>    <dbl>   <dbl>  <dbl>  <dbl>   <dbl>  <dbl>   <dbl>    <dbl>  <dbl>
##  1 V1      NA     -0.697   0.855 -0.638 -0.231  -0.355 -0.314  -0.370   -0.533
##  2 V3      -0.697 NA      -0.650  0.463  0.0621  0.209  0.207   0.288    0.517
##  3 V4       0.855 -0.650  NA     -0.626 -0.264  -0.239 -0.294  -0.309   -0.614
##  4 V5      -0.638  0.463  -0.626 NA      0.265   0.369  0.261   0.351    0.502
##  5 V10     -0.231  0.0621 -0.264  0.265 NA       0.557  0.618   0.489    0.371
##  6 V11     -0.355  0.209  -0.239  0.369  0.557  NA      0.521   0.545    0.392
##  7 V15     -0.314  0.207  -0.294  0.261  0.618   0.521 NA       0.657    0.406
##  8 V17     -0.370  0.288  -0.309  0.351  0.489   0.545  0.657  NA        0.462
##  9 V20     -0.533  0.517  -0.614  0.502  0.371   0.392  0.406   0.462   NA    
## 10 V21     -0.610  0.448  -0.517  0.404  0.438   0.536  0.440   0.651    0.534
## 11 V22     -0.434  0.237  -0.366  0.273  0.606   0.609  0.591   0.569    0.439
## 12 V24     -0.381  0.128  -0.271  0.327  0.477   0.428  0.646   0.597    0.274
## 13 V27     -0.354  0.372  -0.366  0.389  0.233   0.259 -0.0467  0.00727  0.409
## 14 V29     -0.463  0.444  -0.419  0.468  0.310   0.379  0.290   0.293    0.522
## 15 V30     -0.129  0.140  -0.102  0.216  0.396   0.104  0.271   0.225    0.327
## 16 V31     -0.477  0.456  -0.413  0.354  0.319   0.415  0.267   0.387    0.537
## 17 V33     -0.355  0.423  -0.366  0.254  0.302   0.263  0.338   0.174    0.487
## 18 V35     -0.106  0.126  -0.125  0.210  0.302   0.102  0.112   0.140    0.319
## 19 V36     -0.439  0.395  -0.416  0.373  0.213   0.220  0.151   0.141    0.417
## # ... with 10 more variables: V21 <dbl>, V22 <dbl>, V24 <dbl>, V27 <dbl>,
## #   V29 <dbl>, V30 <dbl>, V31 <dbl>, V33 <dbl>, V35 <dbl>, V36 <dbl>
psych::alpha(tbl) 
## Warning in psych::alpha(tbl): Some items were negatively correlated with the total scale and probably 
## should be reversed.  
## To do this, run the function again with the 'check.keys=TRUE' option
## Some items ( V1 V4 ) were negatively correlated with the total scale and 
## probably should be reversed.  
## To do this, run the function again with the 'check.keys=TRUE' option
## 
## Reliability analysis   
## Call: psych::alpha(x = tbl)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N   ase mean   sd median_r
##       0.81      0.84    0.94      0.22 5.3 0.038  3.1 0.52      0.3
## 
##  lower alpha upper     95% confidence boundaries
## 0.73 0.81 0.88 
## 
##  Reliability if an item is dropped:
##     raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## V1       0.85      0.88    0.94      0.28 7.1    0.029 0.083  0.33
## V3       0.80      0.84    0.94      0.22 5.1    0.040 0.122  0.30
## V4       0.86      0.87    0.94      0.28 7.0    0.028 0.087  0.33
## V5       0.79      0.83    0.93      0.22 4.9    0.041 0.124  0.29
## V10      0.79      0.82    0.93      0.21 4.7    0.040 0.128  0.29
## V11      0.79      0.83    0.93      0.21 4.7    0.041 0.127  0.29
## V15      0.79      0.83    0.93      0.21 4.8    0.040 0.126  0.30
## V17      0.79      0.83    0.93      0.21 4.7    0.041 0.125  0.30
## V20      0.78      0.82    0.93      0.21 4.6    0.043 0.122  0.27
## V21      0.79      0.83    0.93      0.21 4.7    0.041 0.121  0.29
## V22      0.79      0.83    0.93      0.21 4.7    0.041 0.124  0.30
## V24      0.79      0.83    0.93      0.21 4.8    0.040 0.127  0.30
## V27      0.79      0.83    0.93      0.21 4.9    0.042 0.125  0.30
## V29      0.78      0.82    0.93      0.20 4.6    0.043 0.123  0.27
## V30      0.79      0.83    0.93      0.21 4.9    0.041 0.131  0.31
## V31      0.78      0.82    0.93      0.20 4.6    0.042 0.123  0.29
## V33      0.78      0.82    0.93      0.21 4.7    0.043 0.125  0.29
## V35      0.79      0.83    0.93      0.22 4.9    0.041 0.131  0.31
## V36      0.78      0.83    0.93      0.21 4.8    0.043 0.125  0.30
## 
##  Item statistics 
##      n raw.r std.r r.cor r.drop mean   sd
## V1  44 -0.49 -0.52 -0.55  -0.58  2.3 1.25
## V3  44  0.48  0.47  0.45   0.37  2.8 1.26
## V4  44 -0.44 -0.47 -0.50  -0.54  2.3 1.41
## V5  44  0.54  0.54  0.51   0.44  3.7 1.23
## V10 44  0.62  0.67  0.66   0.58  4.4 0.73
## V11 44  0.61  0.65  0.63   0.54  3.8 1.03
## V15 44  0.57  0.63  0.63   0.51  4.3 0.82
## V17 44  0.60  0.65  0.64   0.53  4.2 0.91
## V20 44  0.70  0.70  0.68   0.63  3.3 1.15
## V21 44  0.60  0.65  0.65   0.53  3.5 0.95
## V22 44  0.59  0.65  0.64   0.53  4.1 0.91
## V24 44  0.55  0.60  0.58   0.49  4.3 0.80
## V27 44  0.61  0.55  0.55   0.52  2.1 1.27
## V29 44  0.74  0.73  0.73   0.70  1.6 0.92
## V30 44  0.62  0.58  0.56   0.53  3.0 1.34
## V31 44  0.72  0.72  0.71   0.67  1.6 0.89
## V33 44  0.70  0.67  0.67   0.63  2.4 1.19
## V35 44  0.59  0.54  0.52   0.51  2.8 1.20
## V36 44  0.67  0.62  0.61   0.58  2.9 1.44
## 
## Non missing response frequency for each item
##        1    2    3    4    5 miss
## V1  0.36 0.18 0.30 0.09 0.07    0
## V3  0.16 0.27 0.30 0.14 0.14    0
## V4  0.45 0.11 0.20 0.14 0.09    0
## V5  0.09 0.07 0.16 0.39 0.30    0
## V10 0.00 0.00 0.14 0.30 0.57    0
## V11 0.02 0.02 0.41 0.18 0.36    0
## V15 0.00 0.00 0.23 0.27 0.50    0
## V17 0.02 0.00 0.20 0.34 0.43    0
## V20 0.09 0.11 0.36 0.27 0.16    0
## V21 0.02 0.05 0.52 0.20 0.20    0
## V22 0.00 0.02 0.30 0.25 0.43    0
## V24 0.00 0.00 0.20 0.27 0.52    0
## V27 0.48 0.16 0.23 0.07 0.07    0
## V29 0.64 0.11 0.23 0.02 0.00    0
## V30 0.18 0.16 0.27 0.23 0.16    0
## V31 0.59 0.23 0.14 0.05 0.00    0
## V33 0.27 0.30 0.23 0.16 0.05    0
## V35 0.18 0.23 0.30 0.23 0.07    0
## V36 0.23 0.23 0.18 0.18 0.18    0
psych::alpha(tbl, check.keys = TRUE)$total$std.alpha
## Warning in psych::alpha(tbl, check.keys = TRUE): Some items were negatively correlated with total scale and were automatically reversed.
##  This is indicated by a negative sign for the variable name.
## [1] 0.9184763

3b Reliability - see “reliability function.pdf” Calculate reliability values of factors

semTools::reliability(fit)
##              MR3       MR1       MR2
## alpha  0.6497646 0.7440909 0.8958109
## omega  0.6518882 0.7412252 0.8988574
## omega2 0.6518882 0.7412252 0.8988574
## omega3 0.4424298 0.7374587 0.9003546
## avevar 0.4407139 0.4891054 0.5636193

Cronbach’s Alpha

psych::alpha(tbl) 
## Warning in psych::alpha(tbl): Some items were negatively correlated with the total scale and probably 
## should be reversed.  
## To do this, run the function again with the 'check.keys=TRUE' option
## Some items ( V1 V4 ) were negatively correlated with the total scale and 
## probably should be reversed.  
## To do this, run the function again with the 'check.keys=TRUE' option
## 
## Reliability analysis   
## Call: psych::alpha(x = tbl)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N   ase mean   sd median_r
##       0.81      0.84    0.94      0.22 5.3 0.038  3.1 0.52      0.3
## 
##  lower alpha upper     95% confidence boundaries
## 0.73 0.81 0.88 
## 
##  Reliability if an item is dropped:
##     raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## V1       0.85      0.88    0.94      0.28 7.1    0.029 0.083  0.33
## V3       0.80      0.84    0.94      0.22 5.1    0.040 0.122  0.30
## V4       0.86      0.87    0.94      0.28 7.0    0.028 0.087  0.33
## V5       0.79      0.83    0.93      0.22 4.9    0.041 0.124  0.29
## V10      0.79      0.82    0.93      0.21 4.7    0.040 0.128  0.29
## V11      0.79      0.83    0.93      0.21 4.7    0.041 0.127  0.29
## V15      0.79      0.83    0.93      0.21 4.8    0.040 0.126  0.30
## V17      0.79      0.83    0.93      0.21 4.7    0.041 0.125  0.30
## V20      0.78      0.82    0.93      0.21 4.6    0.043 0.122  0.27
## V21      0.79      0.83    0.93      0.21 4.7    0.041 0.121  0.29
## V22      0.79      0.83    0.93      0.21 4.7    0.041 0.124  0.30
## V24      0.79      0.83    0.93      0.21 4.8    0.040 0.127  0.30
## V27      0.79      0.83    0.93      0.21 4.9    0.042 0.125  0.30
## V29      0.78      0.82    0.93      0.20 4.6    0.043 0.123  0.27
## V30      0.79      0.83    0.93      0.21 4.9    0.041 0.131  0.31
## V31      0.78      0.82    0.93      0.20 4.6    0.042 0.123  0.29
## V33      0.78      0.82    0.93      0.21 4.7    0.043 0.125  0.29
## V35      0.79      0.83    0.93      0.22 4.9    0.041 0.131  0.31
## V36      0.78      0.83    0.93      0.21 4.8    0.043 0.125  0.30
## 
##  Item statistics 
##      n raw.r std.r r.cor r.drop mean   sd
## V1  44 -0.49 -0.52 -0.55  -0.58  2.3 1.25
## V3  44  0.48  0.47  0.45   0.37  2.8 1.26
## V4  44 -0.44 -0.47 -0.50  -0.54  2.3 1.41
## V5  44  0.54  0.54  0.51   0.44  3.7 1.23
## V10 44  0.62  0.67  0.66   0.58  4.4 0.73
## V11 44  0.61  0.65  0.63   0.54  3.8 1.03
## V15 44  0.57  0.63  0.63   0.51  4.3 0.82
## V17 44  0.60  0.65  0.64   0.53  4.2 0.91
## V20 44  0.70  0.70  0.68   0.63  3.3 1.15
## V21 44  0.60  0.65  0.65   0.53  3.5 0.95
## V22 44  0.59  0.65  0.64   0.53  4.1 0.91
## V24 44  0.55  0.60  0.58   0.49  4.3 0.80
## V27 44  0.61  0.55  0.55   0.52  2.1 1.27
## V29 44  0.74  0.73  0.73   0.70  1.6 0.92
## V30 44  0.62  0.58  0.56   0.53  3.0 1.34
## V31 44  0.72  0.72  0.71   0.67  1.6 0.89
## V33 44  0.70  0.67  0.67   0.63  2.4 1.19
## V35 44  0.59  0.54  0.52   0.51  2.8 1.20
## V36 44  0.67  0.62  0.61   0.58  2.9 1.44
## 
## Non missing response frequency for each item
##        1    2    3    4    5 miss
## V1  0.36 0.18 0.30 0.09 0.07    0
## V3  0.16 0.27 0.30 0.14 0.14    0
## V4  0.45 0.11 0.20 0.14 0.09    0
## V5  0.09 0.07 0.16 0.39 0.30    0
## V10 0.00 0.00 0.14 0.30 0.57    0
## V11 0.02 0.02 0.41 0.18 0.36    0
## V15 0.00 0.00 0.23 0.27 0.50    0
## V17 0.02 0.00 0.20 0.34 0.43    0
## V20 0.09 0.11 0.36 0.27 0.16    0
## V21 0.02 0.05 0.52 0.20 0.20    0
## V22 0.00 0.02 0.30 0.25 0.43    0
## V24 0.00 0.00 0.20 0.27 0.52    0
## V27 0.48 0.16 0.23 0.07 0.07    0
## V29 0.64 0.11 0.23 0.02 0.00    0
## V30 0.18 0.16 0.27 0.23 0.16    0
## V31 0.59 0.23 0.14 0.05 0.00    0
## V33 0.27 0.30 0.23 0.16 0.05    0
## V35 0.18 0.23 0.30 0.23 0.07    0
## V36 0.23 0.23 0.18 0.18 0.18    0

Discriminant validity

Assessing discriminant validity using Heterotrait-Monotrait Ratio

semTools::htmt(mdl, tbl, sample.cov = NULL, missing = 'listwise', ordered = NULL, absolute = TRUE)
##     MR3   MR1   MR2  
## MR3 1.000            
## MR1 0.902 1.000      
## MR2 0.526 0.608 1.000

Multitrait Multimethod approach of scale validation

y <- psy::mtmm(tbl,list(c("V15","V22","V17","V24","V10","V21","V11"),
                                              c("V1","V4","V3","V5","V20"),
                                              c("V27","V36","V33","V29","V31")),
                             
#y <- psy::mtmm(tbl,list(c('V3', 'V5', 'V20'),
#                                               c('V10', 'V11', 'V15', 'V17', 'V21', 'V22', 'V24'),
#                                               c('V1', 'V4', 'V27', 'V29', 'V30', 'V31', 'V33', 'V35', 'V36')),
                             color=TRUE,
                             itemTot=TRUE,
                             graphItem=FALSE,
                             stripChart=FALSE,
                             namesDim=NULL)

y<-psy::mtmm(tbl,list(c("V15","V22","V17","V24","V10","V21","V11"),c("V1","V4","V3","V5","V20"),c("V27","V35","V36","V30","V33","V29","V31")),color=TRUE,itemTot=TRUE,graphItem=FALSE,stripChart=FALSE,namesDim=NULL)