Part 1 -Basics:
#Part 1 -Basics
library(lavaan)
## Warning: package 'lavaan' was built under R version 4.2.3
## This is lavaan 0.6-15
## lavaan is FREE software! Please report any bugs.
dat <- read.csv("cattell_open_psych_ger.csv")
colnames(dat) # variable names
##   [1] "A1"  "A2"  "A3"  "A4"  "A5"  "A6"  "A7"  "A8"  "A9"  "A10" "B1"  "B2" 
##  [13] "B3"  "B4"  "B5"  "B6"  "B7"  "B8"  "B9"  "B10" "B11" "B12" "B13" "C1" 
##  [25] "C2"  "C3"  "C4"  "C5"  "C6"  "C7"  "C8"  "C9"  "C10" "D1"  "D2"  "D3" 
##  [37] "D4"  "D5"  "D6"  "D7"  "D8"  "D9"  "D10" "E1"  "E2"  "E3"  "E4"  "E5" 
##  [49] "E6"  "E7"  "E8"  "E9"  "E10" "F1"  "F2"  "F3"  "F4"  "F5"  "F6"  "F7" 
##  [61] "F8"  "F9"  "F10" "G1"  "G2"  "G3"  "G4"  "G5"  "G6"  "G7"  "G8"  "G9" 
##  [73] "G10" "H1"  "H2"  "H3"  "H4"  "H5"  "H6"  "H7"  "H8"  "H9"  "H10" "I1" 
##  [85] "I2"  "I3"  "I4"  "I5"  "I6"  "I7"  "I8"  "I9"  "I10" "J1"  "J2"  "J3" 
##  [97] "J4"  "J5"  "J6"  "J7"  "J8"  "J9"  "J10" "K1"  "K2"  "K3"  "K4"  "K5" 
## [109] "K6"  "K7"  "K8"  "K9"  "K10" "L1"  "L2"  "L3"  "L4"  "L5"  "L6"  "L7" 
## [121] "L8"  "L9"  "L10" "M1"  "M2"  "M3"  "M4"  "M5"  "M6"  "M7"  "M8"  "M9" 
## [133] "M10" "N1"  "N2"  "N3"  "N4"  "N5"  "N6"  "N7"  "N8"  "N9"  "N10" "O1" 
## [145] "O2"  "O3"  "O4"  "O5"  "O6"  "O7"  "O8"  "O9"  "O10" "P1"  "P2"  "P3" 
## [157] "P4"  "P5"  "P6"  "P7"  "P8"  "P9"  "P10"
#
library(psych)
## Warning: package 'psych' was built under R version 4.2.2
## 
## Attaching package: 'psych'
## The following object is masked from 'package:lavaan':
## 
##     cor2cov
describe(dat)
##     vars   n mean   sd median trimmed  mad min max range  skew kurtosis   se
## A1     1 357 3.45 1.08      4    3.50 1.48   1   5     4 -0.57    -0.48 0.06
## A2     2 355 3.52 1.05      4    3.58 1.48   1   5     4 -0.57    -0.19 0.06
## A3     3 356 3.60 1.13      4    3.69 1.48   1   5     4 -0.71    -0.29 0.06
## A4     4 356 3.59 1.02      4    3.67 0.00   1   5     4 -0.83     0.16 0.05
## A5     5 355 3.62 0.96      4    3.69 1.48   1   5     4 -0.73     0.21 0.05
## A6     6 353 3.48 0.89      4    3.51 1.48   1   5     4 -0.34     0.10 0.05
## A7     7 355 3.67 1.00      4    3.76 0.00   1   5     4 -0.88     0.40 0.05
## A8     8 356 2.91 1.04      3    2.87 1.48   1   5     4  0.24    -0.82 0.06
## A9     9 357 2.24 1.08      2    2.14 1.48   1   5     4  0.75    -0.16 0.06
## A10   10 353 2.56 1.04      2    2.53 1.48   1   5     4  0.39    -0.51 0.06
## B1    11 357 3.76 0.86      4    3.83 0.00   1   5     4 -0.62     0.21 0.05
## B2    12 357 3.75 0.95      4    3.83 1.48   1   5     4 -0.67     0.12 0.05
## B3    13 356 4.33 0.72      4    4.44 1.48   2   5     3 -0.98     0.95 0.04
## B4    14 357 4.48 0.64      5    4.56 0.00   1   5     4 -1.09     1.63 0.03
## B5    15 354 4.13 0.83      4    4.23 1.48   1   5     4 -0.96     1.11 0.04
## B6    16 353 3.78 0.91      4    3.86 1.48   1   5     4 -0.57    -0.01 0.05
## B7    17 357 3.82 0.95      4    3.92 1.48   1   5     4 -0.81     0.36 0.05
## B8    18 356 3.95 0.93      4    4.05 1.48   1   5     4 -0.87     0.68 0.05
## B9    19 356 2.56 1.15      2    2.51 1.48   1   5     4  0.43    -0.86 0.06
## B10   20 356 2.44 1.02      2    2.39 1.48   1   5     4  0.54    -0.36 0.05
## B11   21 356 2.65 1.20      2    2.58 1.48   1   5     4  0.43    -0.80 0.06
## B12   22 357 1.71 0.83      2    1.57 1.48   1   5     4  1.31     1.85 0.04
## B13   23 357 1.91 1.02      2    1.75 1.48   1   5     4  0.99     0.16 0.05
## C1    24 356 2.90 1.17      3    2.89 1.48   1   5     4  0.04    -0.92 0.06
## C2    25 356 3.59 1.13      4    3.68 1.48   1   5     4 -0.61    -0.42 0.06
## C3    26 353 3.25 0.98      3    3.27 1.48   1   5     4 -0.26    -0.48 0.05
## C4    27 357 3.34 1.05      4    3.35 1.48   1   5     4 -0.30    -0.71 0.06
## C5    28 358 3.24 1.15      3    3.25 1.48   1   5     4 -0.18    -0.98 0.06
## C6    29 355 2.81 1.26      3    2.76 1.48   1   5     4  0.15    -1.13 0.07
## C7    30 357 2.82 1.22      3    2.78 1.48   1   5     4  0.16    -1.01 0.06
## C8    31 358 2.35 1.23      2    2.24 1.48   1   5     4  0.55    -0.79 0.07
## C9    32 355 2.45 1.24      2    2.34 1.48   1   5     4  0.50    -0.81 0.07
## C10   33 356 2.46 1.05      2    2.42 1.48   1   5     4  0.44    -0.63 0.06
## D1    34 356 3.48 1.00      4    3.51 1.48   1   5     4 -0.44    -0.43 0.05
## D2    35 356 3.31 1.06      3    3.31 1.48   1   5     4 -0.29    -0.73 0.06
## D3    36 355 3.53 1.04      4    3.58 1.48   1   5     4 -0.45    -0.48 0.06
## D4    37 355 3.70 1.03      4    3.77 1.48   1   5     4 -0.60    -0.46 0.05
## D5    38 357 3.56 0.96      4    3.62 1.48   1   5     4 -0.68     0.06 0.05
## D6    39 355 3.50 0.92      4    3.52 1.48   1   5     4 -0.39    -0.30 0.05
## D7    40 354 2.61 1.09      2    2.60 1.48   1   5     4  0.26    -0.93 0.06
## D8    41 356 2.01 0.84      2    1.92 0.00   1   5     4  0.83     0.68 0.04
## D9    42 358 2.67 0.98      3    2.69 1.48   1   5     4  0.14    -0.78 0.05
## D10   43 356 2.37 1.09      2    2.32 1.48   1   5     4  0.38    -0.93 0.06
## E1    44 357 2.25 1.06      2    2.17 1.48   1   5     4  0.42    -0.71 0.06
## E2    45 356 2.64 1.24      3    2.60 1.48   1   5     4  0.14    -1.13 0.07
## E3    46 356 3.56 1.04      4    3.62 1.48   1   5     4 -0.50    -0.46 0.06
## E4    47 357 2.48 1.16      2    2.42 1.48   1   5     4  0.37    -0.86 0.06
## E5    48 356 3.76 0.85      4    3.83 0.00   1   5     4 -0.83     0.81 0.04
## E6    49 357 2.55 1.17      2    2.49 1.48   1   5     4  0.38    -0.77 0.06
## E7    50 356 2.23 1.01      2    2.15 1.48   1   5     4  0.68    -0.30 0.05
## E8    51 356 3.31 1.21      3    3.35 1.48   1   5     4 -0.17    -1.04 0.06
## E9    52 355 2.03 0.97      2    1.89 1.48   1   5     4  1.05     0.92 0.05
## E10   53 357 2.43 1.17      2    2.32 1.48   1   5     4  0.61    -0.48 0.06
## F1    54 357 2.84 1.07      3    2.87 1.48   1   5     4 -0.05    -0.76 0.06
## F2    55 357 3.37 1.03      4    3.39 1.48   1   5     4 -0.49    -0.51 0.05
## F3    56 356 1.78 1.18      1    1.54 0.00   1   5     4  1.39     0.80 0.06
## F4    57 357 3.29 1.12      4    3.30 1.48   1   5     4 -0.29    -0.89 0.06
## F5    58 355 2.41 1.32      2    2.28 1.48   1   5     4  0.46    -0.99 0.07
## F6    59 356 2.85 1.05      3    2.87 1.48   1   5     4  0.07    -0.75 0.06
## F7    60 355 3.02 1.13      3    3.07 1.48   1   5     4 -0.23    -0.98 0.06
## F8    61 357 3.40 1.20      4    3.49 1.48   1   5     4 -0.55    -0.69 0.06
## F9    62 357 2.85 1.07      3    2.85 1.48   1   5     4  0.15    -0.77 0.06
## F10   63 357 3.19 1.04      3    3.22 1.48   1   5     4 -0.29    -0.69 0.05
## G1    64 357 3.31 1.05      3    3.34 1.48   1   5     4 -0.46    -0.43 0.06
## G2    65 357 2.74 1.21      3    2.71 1.48   1   5     4  0.13    -1.12 0.06
## G3    66 356 3.08 1.19      3    3.10 1.48   1   5     4 -0.13    -0.92 0.06
## G4    67 357 3.01 1.23      3    3.02 1.48   1   5     4 -0.13    -1.07 0.06
## G5    68 357 3.27 1.14      4    3.31 1.48   1   5     4 -0.37    -0.85 0.06
## G6    69 355 3.01 1.23      3    3.01 1.48   1   5     4  0.00    -1.06 0.07
## G7    70 357 2.85 1.21      3    2.82 1.48   1   5     4  0.13    -1.02 0.06
## G8    71 357 2.31 1.11      2    2.21 1.48   1   5     4  0.78    -0.21 0.06
## G9    72 357 3.41 1.17      4    3.46 1.48   1   5     4 -0.35    -0.90 0.06
## G10   73 356 3.18 1.12      3    3.16 1.48   1   5     4  0.01    -0.94 0.06
## H1    74 355 4.20 0.86      4    4.33 1.48   1   5     4 -1.06     0.72 0.05
## H2    75 356 4.02 0.97      4    4.15 1.48   1   5     4 -0.94     0.45 0.05
## H3    76 357 3.97 0.98      4    4.09 1.48   1   5     4 -0.66    -0.50 0.05
## H4    77 356 2.43 1.18      2    2.34 1.48   1   5     4  0.55    -0.68 0.06
## H5    78 357 3.04 1.30      3    3.06 1.48   1   5     4 -0.17    -1.17 0.07
## H6    79 357 3.51 1.07      4    3.57 1.48   1   5     4 -0.43    -0.44 0.06
## H7    80 357 2.79 1.32      2    2.74 1.48   1   5     4  0.27    -1.16 0.07
## H8    81 357 2.43 1.16      2    2.32 1.48   1   5     4  0.66    -0.35 0.06
## H9    82 355 1.91 1.00      2    1.74 1.48   1   5     4  1.04     0.40 0.05
## H10   83 356 2.50 1.14      2    2.42 1.48   1   5     4  0.64    -0.49 0.06
## I1    84 357 2.64 1.14      2    2.60 1.48   1   5     4  0.45    -0.75 0.06
## I2    85 356 3.37 1.09      4    3.40 1.48   1   5     4 -0.33    -0.79 0.06
## I3    86 354 3.13 1.04      3    3.15 1.48   1   5     4 -0.21    -0.71 0.06
## I4    87 357 2.91 1.14      3    2.90 1.48   1   5     4  0.14    -0.82 0.06
## I5    88 355 3.49 1.12      4    3.54 1.48   1   5     4 -0.47    -0.70 0.06
## I6    89 356 2.14 1.11      2    2.00 1.48   1   5     4  0.81    -0.12 0.06
## I7    90 356 2.99 1.02      3    3.06 1.48   1   5     4 -0.30    -0.67 0.05
## I8    91 358 3.28 1.10      4    3.32 1.48   1   5     4 -0.47    -0.62 0.06
## I9    92 356 3.29 0.98      3    3.36 1.48   1   5     4 -0.60    -0.13 0.05
## I10   93 355 3.23 1.08      3    3.28 1.48   1   5     4 -0.44    -0.60 0.06
## J1    94 356 3.73 1.05      4    3.82 1.48   1   5     4 -0.77    -0.09 0.06
## J2    95 357 3.82 1.14      4    3.95 1.48   1   5     4 -0.76    -0.35 0.06
## J3    96 355 3.66 1.13      4    3.75 1.48   1   5     4 -0.63    -0.43 0.06
## J4    97 357 3.76 1.11      4    3.87 1.48   1   5     4 -0.61    -0.50 0.06
## J5    98 355 3.52 0.98      4    3.55 1.48   1   5     4 -0.34    -0.35 0.05
## J6    99 357 3.31 1.03      3    3.33 1.48   1   5     4 -0.30    -0.38 0.05
## J7   100 356 3.36 1.05      4    3.38 1.48   1   5     4 -0.31    -0.67 0.06
## J8   101 356 2.72 1.03      3    2.74 1.48   1   5     4  0.14    -0.83 0.05
## J9   102 356 2.45 1.19      2    2.37 1.48   1   5     4  0.48    -0.86 0.06
## J10  103 355 2.34 1.13      2    2.25 1.48   1   5     4  0.61    -0.56 0.06
## K1   104 356 3.21 1.16      3    3.22 1.48   1   5     4 -0.13    -1.01 0.06
## K2   105 356 3.26 1.21      3    3.30 1.48   1   5     4 -0.18    -1.04 0.06
## K3   106 355 2.90 1.22      3    2.87 1.48   1   5     4  0.12    -1.05 0.06
## K4   107 356 3.16 1.17      3    3.18 1.48   1   5     4 -0.16    -0.98 0.06
## K5   108 355 3.16 1.12      3    3.13 1.48   1   5     4  0.02    -1.03 0.06
## K6   109 356 3.04 1.20      3    3.06 1.48   1   5     4 -0.19    -1.06 0.06
## K7   110 355 2.89 1.18      3    2.92 1.48   1   5     4 -0.12    -1.11 0.06
## K8   111 355 2.76 1.17      3    2.76 1.48   1   5     4  0.04    -1.07 0.06
## K9   112 356 2.89 1.21      3    2.91 1.48   1   5     4 -0.14    -1.19 0.06
## K10  113 356 3.50 1.11      4    3.57 1.48   1   5     4 -0.57    -0.49 0.06
## L1   114 355 3.24 1.28      4    3.30 1.48   1   5     4 -0.30    -1.10 0.07
## L2   115 353 2.67 1.14      2    2.64 1.48   1   5     4  0.31    -0.90 0.06
## L3   116 355 2.95 1.17      3    2.97 1.48   1   5     4 -0.03    -1.12 0.06
## L4   117 357 3.68 1.05      4    3.76 1.48   1   5     4 -0.64    -0.30 0.06
## L5   118 357 3.64 1.06      4    3.71 1.48   1   5     4 -0.64    -0.37 0.06
## L6   119 357 2.94 1.21      3    2.94 1.48   1   5     4 -0.05    -1.12 0.06
## L7   120 356 2.95 1.11      3    2.94 1.48   1   5     4  0.09    -0.96 0.06
## L8   121 354 2.68 1.16      2    2.65 1.48   1   5     4  0.31    -0.97 0.06
## L9   122 357 3.06 1.07      3    3.06 1.48   1   5     4 -0.07    -1.00 0.06
## L10  123 355 3.43 1.09      4    3.46 1.48   1   5     4 -0.37    -0.68 0.06
## M1   124 357 3.76 1.12      4    3.89 1.48   1   5     4 -0.83    -0.06 0.06
## M2   125 356 3.94 0.87      4    4.02 1.48   1   5     4 -0.84     0.84 0.05
## M3   126 357 4.33 0.71      4    4.44 1.48   2   5     3 -0.95     0.90 0.04
## M4   127 357 3.66 0.87      4    3.71 1.48   1   5     4 -0.41    -0.14 0.05
## M5   128 357 3.61 1.08      4    3.68 1.48   1   5     4 -0.49    -0.53 0.06
## M6   129 357 1.94 1.02      2    1.78 1.48   1   5     4  1.08     0.60 0.05
## M7   130 356 1.99 1.05      2    1.83 1.48   1   5     4  1.10     0.55 0.06
## M8   131 355 1.94 0.99      2    1.79 1.48   1   5     4  1.11     0.86 0.05
## M9   132 353 1.97 0.93      2    1.84 1.48   1   5     4  0.99     0.72 0.05
## M10  133 356 2.11 0.95      2    2.00 1.48   1   5     4  0.80     0.39 0.05
## N1   134 354 2.71 1.19      2    2.67 1.48   1   5     4  0.30    -0.93 0.06
## N2   135 357 3.75 0.98      4    3.82 1.48   1   5     4 -0.56    -0.37 0.05
## N3   136 356 4.01 0.85      4    4.09 1.48   1   5     4 -0.76     0.46 0.04
## N4   137 356 3.37 1.02      3    3.36 1.48   1   5     4 -0.11    -0.72 0.05
## N5   138 357 3.83 1.15      4    3.96 1.48   1   5     4 -0.84    -0.24 0.06
## N6   139 357 3.79 1.05      4    3.89 1.48   1   5     4 -0.68    -0.22 0.06
## N7   140 356 4.18 0.79      4    4.28 1.48   1   5     4 -0.97     1.22 0.04
## N8   141 355 3.48 0.99      4    3.54 1.48   1   5     4 -0.68     0.04 0.05
## N9   142 357 3.29 1.13      4    3.34 1.48   1   5     4 -0.42    -0.70 0.06
## N10  143 358 2.41 1.14      2    2.34 1.48   1   5     4  0.47    -0.71 0.06
## O1   144 356 3.44 1.04      4    3.47 1.48   1   5     4 -0.45    -0.55 0.06
## O2   145 354 2.71 1.18      3    2.69 1.48   1   5     4  0.12    -0.98 0.06
## O3   146 354 3.42 1.00      4    3.45 1.48   1   5     4 -0.56    -0.21 0.05
## O4   147 356 3.52 1.09      4    3.58 1.48   1   5     4 -0.53    -0.52 0.06
## O5   148 357 3.62 1.02      4    3.69 1.48   1   5     4 -0.53    -0.21 0.05
## O6   149 355 3.19 1.09      3    3.17 1.48   1   5     4 -0.13    -1.03 0.06
## O7   150 357 3.15 1.13      3    3.14 1.48   1   5     4 -0.08    -1.03 0.06
## O8   151 356 3.14 1.28      3    3.17 1.48   1   5     4 -0.13    -1.19 0.07
## O9   152 354 2.99 1.20      3    3.00 1.48   1   5     4 -0.06    -1.08 0.06
## O10  153 357 3.24 1.11      3    3.24 1.48   1   5     4 -0.22    -0.92 0.06
## P1   154 356 2.62 1.15      2    2.58 1.48   1   5     4  0.34    -0.91 0.06
## P2   155 357 2.41 1.17      2    2.33 1.48   1   5     4  0.51    -0.73 0.06
## P3   156 357 3.06 1.10      3    3.07 1.48   1   5     4 -0.08    -0.93 0.06
## P4   157 356 3.15 1.12      3    3.16 1.48   1   5     4 -0.19    -0.95 0.06
## P5   158 353 2.60 0.94      3    2.59 1.48   1   5     4  0.31    -0.17 0.05
## P6   159 357 3.00 1.10      3    2.96 1.48   1   5     4  0.13    -0.80 0.06
## P7   160 357 2.79 1.11      3    2.82 1.48   1   5     4 -0.03    -0.99 0.06
## P8   161 356 3.26 1.14      3    3.27 1.48   1   5     4 -0.20    -1.03 0.06
## P9   162 358 3.70 1.07      4    3.80 1.48   1   5     4 -0.83     0.07 0.06
## P10  163 357 3.39 1.05      4    3.42 1.48   1   5     4 -0.37    -0.53 0.06

1.a) How many factors? Warmth, Dominance

1.b) How many items on each factor?

warmth has 10 factors(A1-A10) ,Dominance has 10 factors(D1-D10)

2.Count the number of unique elements in your variance covariance matrix of the data.

unique elements in the variance-covariance matrix= 20*(20+1)/2= 210

3.Count the number of parameters in your basic model.

20 factors loadings + 20 error variances+ 1 correlation between both factors=41 parameters

4.The model degrees of freedom (df) should be (2) – (3) above.

df = 210-41= 169

#Fit the CFA
cfa_syntax <- " Warmth =~ A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + A10
Dominance =~ D1 + D2 + D3 + D4 + D5 + D6 + D7 + D8 + D9 + D10"
cfa_fit <- cfa(cfa_syntax, data = dat, std.lv = TRUE)
summary(cfa_fit,standardize= TRUE, rsquare= TRUE)
## lavaan 0.6.15 ended normally after 15 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        41
## 
##                                                   Used       Total
##   Number of observations                           328         358
## 
## Model Test User Model:
##                                                       
##   Test statistic                               465.974
##   Degrees of freedom                               169
##   P-value (Chi-square)                           0.000
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   Warmth =~                                                             
##     A1                0.637    0.057   11.165    0.000    0.637    0.596
##     A2                0.652    0.054   12.012    0.000    0.652    0.632
##     A3                0.700    0.058   11.991    0.000    0.700    0.631
##     A4                0.674    0.051   13.107    0.000    0.674    0.676
##     A5                0.638    0.050   12.786    0.000    0.638    0.663
##     A6                0.529    0.047   11.345    0.000    0.529    0.603
##     A7                0.579    0.053   10.926    0.000    0.579    0.585
##     A8               -0.586    0.056  -10.480    0.000   -0.586   -0.565
##     A9               -0.827    0.053  -15.461    0.000   -0.827   -0.763
##     A10              -0.384    0.059   -6.532    0.000   -0.384   -0.372
##   Dominance =~                                                          
##     D1                0.756    0.050   15.139    0.000    0.756    0.759
##     D2                0.630    0.058   10.802    0.000    0.630    0.585
##     D3                0.360    0.060    6.018    0.000    0.360    0.348
##     D4                0.474    0.057    8.252    0.000    0.474    0.464
##     D5                0.655    0.051   12.877    0.000    0.655    0.673
##     D6                0.463    0.051    9.145    0.000    0.463    0.508
##     D7               -0.779    0.056  -13.944    0.000   -0.779   -0.715
##     D8               -0.348    0.047   -7.322    0.000   -0.348   -0.417
##     D9               -0.602    0.052  -11.531    0.000   -0.602   -0.617
##     D10              -0.577    0.060   -9.642    0.000   -0.577   -0.532
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   Warmth ~~                                                             
##     Dominance         0.264    0.060    4.379    0.000    0.264    0.264
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .A1                0.739    0.063   11.746    0.000    0.739    0.645
##    .A2                0.641    0.056   11.525    0.000    0.641    0.601
##    .A3                0.741    0.064   11.531    0.000    0.741    0.602
##    .A4                0.540    0.048   11.179    0.000    0.540    0.543
##    .A5                0.518    0.046   11.289    0.000    0.518    0.560
##    .A6                0.488    0.042   11.702    0.000    0.488    0.636
##    .A7                0.643    0.054   11.803    0.000    0.643    0.658
##    .A8                0.732    0.061   11.901    0.000    0.732    0.680
##    .A9                0.490    0.048   10.101    0.000    0.490    0.417
##    .A10               0.916    0.073   12.498    0.000    0.916    0.861
##    .D1                0.420    0.043    9.751    0.000    0.420    0.424
##    .D2                0.763    0.065   11.648    0.000    0.763    0.658
##    .D3                0.943    0.075   12.501    0.000    0.943    0.879
##    .D4                0.819    0.067   12.196    0.000    0.819    0.784
##    .D5                0.520    0.047   10.955    0.000    0.520    0.547
##    .D6                0.615    0.051   12.033    0.000    0.615    0.742
##    .D7                0.582    0.056   10.463    0.000    0.582    0.489
##    .D8                0.574    0.047   12.339    0.000    0.574    0.826
##    .D9                0.590    0.052   11.436    0.000    0.590    0.620
##    .D10               0.846    0.071   11.930    0.000    0.846    0.717
##     Warmth            1.000                               1.000    1.000
##     Dominance         1.000                               1.000    1.000
## 
## R-Square:
##                    Estimate
##     A1                0.355
##     A2                0.399
##     A3                0.398
##     A4                0.457
##     A5                0.440
##     A6                0.364
##     A7                0.342
##     A8                0.320
##     A9                0.583
##     A10               0.139
##     D1                0.576
##     D2                0.342
##     D3                0.121
##     D4                0.216
##     D5                0.453
##     D6                0.258
##     D7                0.511
##     D8                0.174
##     D9                0.380
##     D10               0.283
  1. Let’s examine the model parameters:
  1. Loadings: are they consistent with any theoretical expectations?

all factors are significant P<0.001 , negative loadings indicates to reverse coding in the survye items.

  1. Are there any marked differences between the unstandardized and standardized loadings?

there are slight differences between the unstandardized and standardized loadings.

  1. What proportion of variance is explained in the items by the factors?

we can conclude that from the R-Square which is between 12.1% and 58.3%: A1 0.355 A2 0.399 A3 0.398 A4 0.457 A5 0.440 A6 0.364 A7 0.342 A8 0.320 A9 0.583 A10 0.139 D1 0.576 D2 0.342 D3 0.121 D4 0.216 D5 0.453 D6 0.258 D7 0.511 D8 0.174 D9 0.380 D10 0.283

  1. If you have multiple factors, what is the correlation between your factors? If any two factors have a very high correlation, can you claim these factor to relate to different constructs? Might there be some justification to merge both these factors into one.

I have 2 factors (Warmth, Dominance ) and they are slightly low correlated 0.264

Part2:Experimentation
#Part2- Experimentation
cfa2_syntax <- "
Warmth =~ A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + A10
Dominance1 =~ D1 + D2 + D3 + D4 + D5 
Dominance2=~  D6 + D7 + D8 + D9 + D10"
cfa2_fit <- cfa(cfa2_syntax, data = dat, std.lv = TRUE)
summary(cfa2_fit,standardize= TRUE, rsquare= TRUE)
## lavaan 0.6.15 ended normally after 17 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        43
## 
##                                                   Used       Total
##   Number of observations                           328         358
## 
## Model Test User Model:
##                                                       
##   Test statistic                               449.657
##   Degrees of freedom                               167
##   P-value (Chi-square)                           0.000
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   Warmth =~                                                             
##     A1                0.639    0.057   11.192    0.000    0.639    0.597
##     A2                0.655    0.054   12.085    0.000    0.655    0.634
##     A3                0.700    0.058   11.998    0.000    0.700    0.631
##     A4                0.674    0.051   13.096    0.000    0.674    0.675
##     A5                0.639    0.050   12.813    0.000    0.639    0.664
##     A6                0.530    0.047   11.377    0.000    0.530    0.605
##     A7                0.579    0.053   10.944    0.000    0.579    0.586
##     A8               -0.582    0.056  -10.399    0.000   -0.582   -0.562
##     A9               -0.826    0.053  -15.452    0.000   -0.826   -0.763
##     A10              -0.379    0.059   -6.452    0.000   -0.379   -0.368
##   Dominance1 =~                                                         
##     D1                0.784    0.050   15.644    0.000    0.784    0.787
##     D2                0.634    0.059   10.807    0.000    0.634    0.589
##     D3                0.356    0.060    5.903    0.000    0.356    0.344
##     D4                0.458    0.058    7.885    0.000    0.458    0.449
##     D5                0.670    0.051   13.115    0.000    0.670    0.687
##   Dominance2 =~                                                         
##     D6                0.446    0.052    8.619    0.000    0.446    0.490
##     D7               -0.820    0.057  -14.509    0.000   -0.820   -0.752
##     D8               -0.346    0.048   -7.172    0.000   -0.346   -0.415
##     D9               -0.642    0.052  -12.268    0.000   -0.642   -0.658
##     D10              -0.605    0.060  -10.019    0.000   -0.605   -0.557
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   Warmth ~~                                                             
##     Dominance1        0.331    0.061    5.385    0.000    0.331    0.331
##     Dominance2        0.177    0.067    2.651    0.008    0.177    0.177
##   Dominance1 ~~                                                         
##     Dominance2        0.905    0.033   27.341    0.000    0.905    0.905
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .A1                0.738    0.063   11.747    0.000    0.738    0.644
##    .A2                0.637    0.055   11.513    0.000    0.637    0.597
##    .A3                0.741    0.064   11.537    0.000    0.741    0.602
##    .A4                0.541    0.048   11.194    0.000    0.541    0.544
##    .A5                0.517    0.046   11.290    0.000    0.517    0.559
##    .A6                0.487    0.042   11.701    0.000    0.487    0.635
##    .A7                0.642    0.054   11.805    0.000    0.642    0.657
##    .A8                0.737    0.062   11.924    0.000    0.737    0.685
##    .A9                0.491    0.048   10.125    0.000    0.491    0.418
##    .A10               0.919    0.073   12.508    0.000    0.919    0.865
##    .D1                0.377    0.044    8.612    0.000    0.377    0.380
##    .D2                0.757    0.066   11.508    0.000    0.757    0.653
##    .D3                0.946    0.076   12.484    0.000    0.946    0.882
##    .D4                0.834    0.068   12.197    0.000    0.834    0.799
##    .D5                0.501    0.047   10.574    0.000    0.501    0.527
##    .D6                0.630    0.053   11.954    0.000    0.630    0.760
##    .D7                0.517    0.057    9.105    0.000    0.517    0.435
##    .D8                0.575    0.047   12.245    0.000    0.575    0.828
##    .D9                0.539    0.050   10.689    0.000    0.539    0.567
##    .D10               0.813    0.070   11.579    0.000    0.813    0.689
##     Warmth            1.000                               1.000    1.000
##     Dominance1        1.000                               1.000    1.000
##     Dominance2        1.000                               1.000    1.000
## 
## R-Square:
##                    Estimate
##     A1                0.356
##     A2                0.403
##     A3                0.398
##     A4                0.456
##     A5                0.441
##     A6                0.365
##     A7                0.343
##     A8                0.315
##     A9                0.582
##     A10               0.135
##     D1                0.620
##     D2                0.347
##     D3                0.118
##     D4                0.201
##     D5                0.473
##     D6                0.240
##     D7                0.565
##     D8                0.172
##     D9                0.433
##     D10               0.311

What is the correlation between the two new sub-factors? Any comments?

The new sub-factors Dominance1 and Dominance2 they are high correlated. Dominance1 ~~ Dominance2 = 0.905

Manual Calculation:

1.Use the unstandardized loadings and any other relevant parameters to compute the standardized loadings – verify the result is correct (3 items).

The standardized loading for items are: A2: \(\frac{0.652}{\sqrt{(0.652^2 +0.641)}}\) = 0.631

A8: \(\frac{ -0.586}{\sqrt{( -0.586)^2 + 0.732}}\) = -0.565

D1: \(\frac{0.756}{\sqrt{(0.756^2 + 0.420)}}\) = 0.759

2.Compute the proportion of variance explained in an item by the factor using the unstandardized estimates – verify the result is correct (3 items).

The variance is the square of standard deviation

  1. Use the standardized estimates to compute the model-implied correlation between 3 pairs of items.

A2 and A8 is: \(0.632 \times -0.565 =\) -0.357

A2 and D1 is: \(0.632 \times 0.759 \times 0.264 =\) 0.127

D1 and A8 is: $ 0.759 =$ -0.113

  1. Your result should match the model-implied correlation matrix from lavaan. i.This syntax: cov2cor(fitted([FITTED MODEL OBJECT])$cov) should return the model-implied correlation between your items.
lav_cor <- cov2cor(fitted(cfa_fit)$cov)
lav_cor["A2", "A8"]
## [1] -0.357081
lav_cor["A2", "D1"]
## [1] 0.1268034
lav_cor["D1", "A8"]
## [1] -0.1135029
  1. Compare the model-implied correlation to the sample correlation between the pair of items. In your opinion, does the model do a good job of matching the correlation between the pair of items?

I compare the same three sample correlations:

The model-implied and sample correlations are all close to each other for the three pairs I considered.

lavaan also returns the matrix of residual correlations:

resid(cfa_fit, type = "cor")$cov
##         A1     A2     A3     A4     A5     A6     A7     A8     A9    A10
## A1   0.000                                                               
## A2   0.001  0.000                                                        
## A3   0.108 -0.050  0.000                                                 
## A4  -0.053 -0.033 -0.057  0.000                                          
## A5   0.060  0.082 -0.011 -0.112  0.000                                   
## A6   0.178  0.131 -0.062 -0.088  0.167  0.000                            
## A7  -0.107  0.003 -0.020  0.043  0.020 -0.037  0.000                     
## A8   0.064  0.090 -0.013 -0.085  0.075  0.059 -0.119  0.000              
## A9   0.082  0.024 -0.035 -0.139  0.047  0.109  0.009  0.047  0.000       
## A10  0.028  0.051 -0.135 -0.012  0.071  0.087  0.016  0.006  0.046  0.000
## D1   0.130  0.091  0.050  0.064  0.106  0.053  0.079  0.021 -0.085 -0.038
## D2   0.075  0.061 -0.081 -0.045  0.024 -0.027 -0.057  0.116  0.031  0.008
## D3   0.021  0.084  0.021  0.058  0.033  0.029  0.049  0.045 -0.043 -0.044
## D4  -0.016  0.001 -0.110 -0.056  0.019 -0.069 -0.075  0.052  0.033  0.043
## D5   0.097  0.082 -0.060 -0.030  0.056  0.020  0.080  0.019 -0.031 -0.032
## D6   0.036  0.053 -0.010 -0.051  0.025  0.028 -0.022  0.135  0.059 -0.039
## D7  -0.051  0.025  0.059  0.020 -0.023 -0.041 -0.025  0.040 -0.031  0.097
## D8   0.005 -0.002  0.067 -0.013  0.001  0.100  0.002  0.032  0.087  0.160
## D9   0.018  0.081  0.103  0.081  0.036  0.151  0.053 -0.056 -0.059  0.050
## D10 -0.013  0.054  0.190  0.142  0.035  0.117  0.161 -0.104 -0.090 -0.015
##         D1     D2     D3     D4     D5     D6     D7     D8     D9    D10
## A1                                                                       
## A2                                                                       
## A3                                                                       
## A4                                                                       
## A5                                                                       
## A6                                                                       
## A7                                                                       
## A8                                                                       
## A9                                                                       
## A10                                                                      
## D1   0.000                                                               
## D2   0.049  0.000                                                        
## D3  -0.032 -0.022  0.000                                                 
## D4  -0.068 -0.027  0.167  0.000                                          
## D5   0.052  0.020 -0.056 -0.007  0.000                                   
## D6   0.026  0.093  0.077  0.034 -0.015  0.000                            
## D7   0.031  0.045  0.009 -0.006  0.036  0.034  0.000                     
## D8   0.035 -0.017 -0.007 -0.064  0.002 -0.029  0.005  0.000              
## D9   0.012  0.053  0.050 -0.026  0.043  0.086  0.129 -0.036  0.000       
## D10  0.034  0.045 -0.052 -0.018 -0.016  0.048  0.039  0.019  0.052  0.000

It’s difficult to look at all of this, so I try using a heatmap:

library(corrplot)
## Warning: package 'corrplot' was built under R version 4.2.3
## corrplot 0.92 loaded
corrplot(
  resid(cfa_fit, type = "cor")$cov,
  type = "lower", is.corr = FALSE
)

Part3:Model misspecification

There is some misspecification given the \(\chi^2\) test results, \(\chi^2(169) = 466,\ p < .001\). And the goodness of fit indices are larger than the guidelines suggest.

#Part3-misspecification
summary(cfa_fit, fit.measures = TRUE, estimates = FALSE)
## lavaan 0.6.15 ended normally after 15 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        41
## 
##                                                   Used       Total
##   Number of observations                           328         358
## 
## Model Test User Model:
##                                                       
##   Test statistic                               465.974
##   Degrees of freedom                               169
##   P-value (Chi-square)                           0.000
## 
## Model Test Baseline Model:
## 
##   Test statistic                              2206.555
##   Degrees of freedom                               190
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.853
##   Tucker-Lewis Index (TLI)                       0.834
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)              -8482.372
##   Loglikelihood unrestricted model (H1)      -8249.385
##                                                       
##   Akaike (AIC)                               17046.745
##   Bayesian (BIC)                             17202.258
##   Sample-size adjusted Bayesian (SABIC)      17072.207
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.073
##   90 Percent confidence interval - lower         0.065
##   90 Percent confidence interval - upper         0.081
##   P-value H_0: RMSEA <= 0.050                    0.000
##   P-value H_0: RMSEA >= 0.080                    0.081
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.064
# missing ML
cfa_fit <- cfa(cfa_syntax, data = dat, std.lv = TRUE, missing = "ML")
head(modificationIndices(cfa_fit, sort. = TRUE, power = TRUE))
##     lhs op rhs     mi    epc sepc.all delta    ncp power decision
## 144  A4 ~~  A9 46.237 -0.235   -0.460   0.1  8.378 0.825  *epc:m*
## 90   A1 ~~  A6 34.428  0.204    0.348   0.1  8.303 0.822  *epc:m*
## 156  A5 ~~  A6 31.760  0.170    0.342   0.1 10.939 0.911  *epc:m*
## 271  D7 ~~  D9 26.327  0.199    0.326   0.1  6.638 0.731  **(m)**
## 173  A6 ~~  A9 25.823  0.158    0.333   0.1 10.303 0.894  *epc:m*
## 140  A4 ~~  A5 20.502 -0.151   -0.281   0.1  9.038 0.852  *epc:m*
#Modification A4~~A9
cfa_syntax_mod <- " Warmth =~ A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + A10
Dominance =~ D1 + D2 + D3 + D4 + D5 + D6 + D7 + D8 + D9 + D10
A4~~A9
"
cfa_fit_mod <- cfa(cfa_syntax_mod, data = dat, std.lv = TRUE)
summary(cfa_fit_mod,standardize= TRUE, rsquare= TRUE)
## lavaan 0.6.15 ended normally after 19 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        42
## 
##                                                   Used       Total
##   Number of observations                           328         358
## 
## Model Test User Model:
##                                                       
##   Test statistic                               420.841
##   Degrees of freedom                               168
##   P-value (Chi-square)                           0.000
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   Warmth =~                                                             
##     A1                0.670    0.057   11.775    0.000    0.670    0.626
##     A2                0.671    0.054   12.344    0.000    0.671    0.650
##     A3                0.701    0.059   11.904    0.000    0.701    0.631
##     A4                0.594    0.054   10.977    0.000    0.594    0.595
##     A5                0.675    0.049   13.648    0.000    0.675    0.702
##     A6                0.568    0.046   12.310    0.000    0.568    0.648
##     A7                0.568    0.054   10.592    0.000    0.568    0.574
##     A8               -0.557    0.057   -9.778    0.000   -0.557   -0.537
##     A9               -0.758    0.056  -13.562    0.000   -0.758   -0.700
##     A10              -0.369    0.059   -6.218    0.000   -0.369   -0.358
##   Dominance =~                                                          
##     D1                0.756    0.050   15.142    0.000    0.756    0.759
##     D2                0.630    0.058   10.808    0.000    0.630    0.585
##     D3                0.360    0.060    6.015    0.000    0.360    0.348
##     D4                0.474    0.057    8.249    0.000    0.474    0.464
##     D5                0.656    0.051   12.887    0.000    0.656    0.673
##     D6                0.463    0.051    9.156    0.000    0.463    0.509
##     D7               -0.780    0.056  -13.946    0.000   -0.780   -0.715
##     D8               -0.347    0.047   -7.307    0.000   -0.347   -0.416
##     D9               -0.601    0.052  -11.519    0.000   -0.601   -0.616
##     D10              -0.577    0.060   -9.641    0.000   -0.577   -0.532
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##  .A4 ~~                                                                 
##    .A9               -0.258    0.044   -5.837    0.000   -0.258   -0.415
##   Warmth ~~                                                             
##     Dominance         0.273    0.061    4.494    0.000    0.273    0.273
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .A1                0.697    0.061   11.405    0.000    0.697    0.608
##    .A2                0.616    0.055   11.216    0.000    0.616    0.578
##    .A3                0.740    0.065   11.364    0.000    0.740    0.601
##    .A4                0.642    0.056   11.494    0.000    0.642    0.646
##    .A5                0.469    0.044   10.688    0.000    0.469    0.507
##    .A6                0.445    0.040   11.228    0.000    0.445    0.580
##    .A7                0.655    0.056   11.738    0.000    0.655    0.670
##    .A8                0.765    0.064   11.927    0.000    0.765    0.711
##    .A9                0.599    0.056   10.668    0.000    0.599    0.511
##    .A10               0.927    0.074   12.488    0.000    0.927    0.872
##    .D1                0.420    0.043    9.752    0.000    0.420    0.424
##    .D2                0.762    0.065   11.647    0.000    0.762    0.658
##    .D3                0.943    0.075   12.501    0.000    0.943    0.879
##    .D4                0.819    0.067   12.197    0.000    0.819    0.785
##    .D5                0.519    0.047   10.952    0.000    0.519    0.547
##    .D6                0.615    0.051   12.031    0.000    0.615    0.741
##    .D7                0.582    0.056   10.464    0.000    0.582    0.489
##    .D8                0.574    0.047   12.342    0.000    0.574    0.827
##    .D9                0.590    0.052   11.441    0.000    0.590    0.620
##    .D10               0.846    0.071   11.930    0.000    0.846    0.717
##     Warmth            1.000                               1.000    1.000
##     Dominance         1.000                               1.000    1.000
## 
## R-Square:
##                    Estimate
##     A1                0.392
##     A2                0.422
##     A3                0.399
##     A4                0.354
##     A5                0.493
##     A6                0.420
##     A7                0.330
##     A8                0.289
##     A9                0.489
##     A10               0.128
##     D1                0.576
##     D2                0.342
##     D3                0.121
##     D4                0.215
##     D5                0.453
##     D6                0.259
##     D7                0.511
##     D8                0.173
##     D9                0.380
##     D10               0.283
#
cfa_fit_mod <- cfa(cfa_syntax_mod, data = dat, std.lv = TRUE, missing = "ML")
head(modificationIndices(cfa_fit_mod, sort. = TRUE, power = TRUE))
##     lhs op rhs     mi    epc sepc.all delta    ncp power decision
## 271  D7 ~~  D9 26.451  0.200    0.326   0.1  6.637 0.731  **(m)**
## 91   A1 ~~  A6 24.971  0.170    0.311   0.1  8.689 0.838  *epc:m*
## 156  A5 ~~  A6 19.776  0.131    0.288   0.1 11.461 0.923  *epc:m*
## 248  D3 ~~  D4 17.301  0.204    0.230   0.1  4.177 0.533  **(m)**
## 92   A1 ~~  A7 16.554 -0.161   -0.245   0.1  6.408 0.716  **(m)**
## 185  A7 ~~  A8 14.676 -0.155   -0.224   0.1  6.083 0.694  **(m)**
#Modification D7~~D9
cfa_syntax_mod <- " Warmth =~ A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + A10
Dominance =~ D1 + D2 + D3 + D4 + D5 + D6 + D7 + D8 + D9 + D10
A4~~A9
D7~~D9
"
cfa_fit_mod <- cfa(cfa_syntax_mod, data = dat, std.lv = TRUE)
summary(cfa_fit_mod,standardize= TRUE, rsquare= TRUE)
## lavaan 0.6.15 ended normally after 20 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        43
## 
##                                                   Used       Total
##   Number of observations                           328         358
## 
## Model Test User Model:
##                                                       
##   Test statistic                               394.746
##   Degrees of freedom                               167
##   P-value (Chi-square)                           0.000
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   Warmth =~                                                             
##     A1                0.670    0.057   11.783    0.000    0.670    0.626
##     A2                0.672    0.054   12.361    0.000    0.672    0.650
##     A3                0.700    0.059   11.897    0.000    0.700    0.631
##     A4                0.594    0.054   10.973    0.000    0.594    0.595
##     A5                0.675    0.049   13.656    0.000    0.675    0.702
##     A6                0.568    0.046   12.316    0.000    0.568    0.649
##     A7                0.568    0.054   10.589    0.000    0.568    0.574
##     A8               -0.556    0.057   -9.760    0.000   -0.556   -0.536
##     A9               -0.758    0.056  -13.562    0.000   -0.758   -0.700
##     A10              -0.369    0.059   -6.211    0.000   -0.369   -0.358
##   Dominance =~                                                          
##     D1                0.770    0.050   15.383    0.000    0.770    0.773
##     D2                0.645    0.058   11.053    0.000    0.645    0.599
##     D3                0.365    0.060    6.058    0.000    0.365    0.352
##     D4                0.470    0.058    8.116    0.000    0.470    0.460
##     D5                0.669    0.051   13.122    0.000    0.669    0.686
##     D6                0.476    0.051    9.400    0.000    0.476    0.523
##     D7               -0.733    0.058  -12.736    0.000   -0.733   -0.672
##     D8               -0.349    0.048   -7.319    0.000   -0.349   -0.419
##     D9               -0.547    0.054  -10.109    0.000   -0.547   -0.561
##     D10              -0.567    0.060   -9.376    0.000   -0.567   -0.522
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##  .A4 ~~                                                                 
##    .A9               -0.258    0.044   -5.843    0.000   -0.258   -0.416
##  .D7 ~~                                                                 
##    .D9                0.205    0.045    4.606    0.000    0.205    0.315
##   Warmth ~~                                                             
##     Dominance         0.286    0.061    4.718    0.000    0.286    0.286
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .A1                0.696    0.061   11.405    0.000    0.696    0.608
##    .A2                0.615    0.055   11.212    0.000    0.615    0.577
##    .A3                0.741    0.065   11.369    0.000    0.741    0.602
##    .A4                0.643    0.056   11.497    0.000    0.643    0.646
##    .A5                0.469    0.044   10.688    0.000    0.469    0.507
##    .A6                0.445    0.040   11.228    0.000    0.445    0.579
##    .A7                0.656    0.056   11.740    0.000    0.656    0.670
##    .A8                0.766    0.064   11.933    0.000    0.766    0.712
##    .A9                0.599    0.056   10.672    0.000    0.599    0.511
##    .A10               0.927    0.074   12.490    0.000    0.927    0.872
##    .D1                0.399    0.043    9.195    0.000    0.399    0.402
##    .D2                0.743    0.065   11.457    0.000    0.743    0.641
##    .D3                0.939    0.075   12.468    0.000    0.939    0.876
##    .D4                0.823    0.068   12.164    0.000    0.823    0.788
##    .D5                0.502    0.047   10.643    0.000    0.502    0.529
##    .D6                0.602    0.051   11.903    0.000    0.602    0.726
##    .D7                0.652    0.061   10.738    0.000    0.652    0.548
##    .D8                0.573    0.047   12.297    0.000    0.573    0.824
##    .D9                0.652    0.056   11.577    0.000    0.652    0.685
##    .D10               0.858    0.072   11.908    0.000    0.858    0.728
##     Warmth            1.000                               1.000    1.000
##     Dominance         1.000                               1.000    1.000
## 
## R-Square:
##                    Estimate
##     A1                0.392
##     A2                0.423
##     A3                0.398
##     A4                0.354
##     A5                0.493
##     A6                0.421
##     A7                0.330
##     A8                0.288
##     A9                0.489
##     A10               0.128
##     D1                0.598
##     D2                0.359
##     D3                0.124
##     D4                0.212
##     D5                0.471
##     D6                0.274
##     D7                0.452
##     D8                0.176
##     D9                0.315
##     D10               0.272
#
cfa_fit_mod <- cfa(cfa_syntax_mod, data = dat, std.lv = TRUE, missing = "ML")
head(modificationIndices(cfa_fit_mod, sort. = TRUE, power = TRUE))
##     lhs op rhs     mi    epc sepc.all delta    ncp power decision
## 92   A1 ~~  A6 24.876  0.169    0.311   0.1  8.697 0.839  *epc:m*
## 157  A5 ~~  A6 19.683  0.131    0.287   0.1 11.473 0.923  *epc:m*
## 249  D3 ~~  D4 17.279  0.204    0.230   0.1  4.152 0.531  **(m)**
## 93   A1 ~~  A7 16.558 -0.161   -0.245   0.1  6.410 0.716  **(m)**
## 186  A7 ~~  A8 14.767 -0.156   -0.224   0.1  6.079 0.693  **(m)**
## 131  A3 ~~ A10 14.055 -0.179   -0.215   0.1  4.364 0.551  **(m)**
#Modification A1~~A6
cfa_syntax_mod <- " Warmth =~ A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + A10
Dominance =~ D1 + D2 + D3 + D4 + D5 + D6 + D7 + D8 + D9 + D10
A4~~A9
D7~~D9
A1~~A6
"
cfa_fit_mod <- cfa(cfa_syntax_mod, data = dat, std.lv = TRUE)
summary(cfa_fit_mod,standardize= TRUE, rsquare= TRUE)
## lavaan 0.6.15 ended normally after 20 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        44
## 
##                                                   Used       Total
##   Number of observations                           328         358
## 
## Model Test User Model:
##                                                       
##   Test statistic                               372.855
##   Degrees of freedom                               166
##   P-value (Chi-square)                           0.000
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   Warmth =~                                                             
##     A1                0.625    0.058   10.698    0.000    0.625    0.584
##     A2                0.665    0.055   12.137    0.000    0.665    0.644
##     A3                0.707    0.059   11.971    0.000    0.707    0.637
##     A4                0.612    0.054   11.301    0.000    0.612    0.614
##     A5                0.660    0.050   13.193    0.000    0.660    0.687
##     A6                0.529    0.047   11.161    0.000    0.529    0.604
##     A7                0.586    0.054   10.942    0.000    0.586    0.592
##     A8               -0.576    0.057  -10.122    0.000   -0.576   -0.555
##     A9               -0.784    0.056  -14.107    0.000   -0.784   -0.724
##     A10              -0.383    0.059   -6.440    0.000   -0.383   -0.372
##   Dominance =~                                                          
##     D1                0.770    0.050   15.378    0.000    0.770    0.773
##     D2                0.645    0.058   11.047    0.000    0.645    0.599
##     D3                0.365    0.060    6.060    0.000    0.365    0.352
##     D4                0.470    0.058    8.120    0.000    0.470    0.460
##     D5                0.669    0.051   13.118    0.000    0.669    0.686
##     D6                0.476    0.051    9.393    0.000    0.476    0.523
##     D7               -0.733    0.058  -12.734    0.000   -0.733   -0.672
##     D8               -0.350    0.048   -7.331    0.000   -0.350   -0.420
##     D9               -0.548    0.054  -10.120    0.000   -0.548   -0.561
##     D10              -0.567    0.060   -9.375    0.000   -0.567   -0.522
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##  .A4 ~~                                                                 
##    .A9               -0.228    0.043   -5.264    0.000   -0.228   -0.387
##  .D7 ~~                                                                 
##    .D9                0.205    0.045    4.599    0.000    0.205    0.314
##  .A1 ~~                                                                 
##    .A6                0.173    0.040    4.359    0.000    0.173    0.286
##   Warmth ~~                                                             
##     Dominance         0.283    0.061    4.629    0.000    0.283    0.283
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .A1                0.755    0.065   11.539    0.000    0.755    0.659
##    .A2                0.625    0.056   11.172    0.000    0.625    0.586
##    .A3                0.732    0.065   11.232    0.000    0.732    0.595
##    .A4                0.620    0.055   11.229    0.000    0.620    0.623
##    .A5                0.488    0.045   10.739    0.000    0.488    0.528
##    .A6                0.488    0.043   11.413    0.000    0.488    0.635
##    .A7                0.635    0.055   11.562    0.000    0.635    0.649
##    .A8                0.744    0.063   11.782    0.000    0.744    0.692
##    .A9                0.558    0.055   10.179    0.000    0.558    0.476
##    .A10               0.916    0.074   12.440    0.000    0.916    0.862
##    .D1                0.399    0.043    9.195    0.000    0.399    0.403
##    .D2                0.744    0.065   11.458    0.000    0.744    0.641
##    .D3                0.939    0.075   12.468    0.000    0.939    0.876
##    .D4                0.823    0.068   12.163    0.000    0.823    0.788
##    .D5                0.502    0.047   10.643    0.000    0.502    0.529
##    .D6                0.603    0.051   11.903    0.000    0.603    0.727
##    .D7                0.652    0.061   10.737    0.000    0.652    0.548
##    .D8                0.572    0.047   12.294    0.000    0.572    0.824
##    .D9                0.652    0.056   11.573    0.000    0.652    0.685
##    .D10               0.858    0.072   11.907    0.000    0.858    0.728
##     Warmth            1.000                               1.000    1.000
##     Dominance         1.000                               1.000    1.000
## 
## R-Square:
##                    Estimate
##     A1                0.341
##     A2                0.414
##     A3                0.405
##     A4                0.377
##     A5                0.472
##     A6                0.365
##     A7                0.351
##     A8                0.308
##     A9                0.524
##     A10               0.138
##     D1                0.597
##     D2                0.359
##     D3                0.124
##     D4                0.212
##     D5                0.471
##     D6                0.273
##     D7                0.452
##     D8                0.176
##     D9                0.315
##     D10               0.272
#
cfa_fit_mod <- cfa(cfa_syntax_mod, data = dat, std.lv = TRUE, missing = "ML")
head(modificationIndices(cfa_fit_mod, sort. = TRUE, power = TRUE))
##        lhs op rhs     mi    epc sepc.all delta    ncp power decision
## 157     A5 ~~  A6 26.344  0.147    0.302   0.1 12.170 0.937  *epc:m*
## 110     A2 ~~  A6 21.020  0.145    0.265   0.1  9.990 0.885  *epc:m*
## 90      A1 ~~  A3 20.699  0.191    0.257   0.1  5.678 0.664  **(m)**
## 249     D3 ~~  D4 17.265  0.204    0.230   0.1  4.152 0.531  **(m)**
## 69  Warmth =~  D1 13.414  0.167    0.167   0.1  4.826 0.594  **(m)**
## 131     A3 ~~ A10 12.604 -0.170   -0.206   0.1  4.387 0.553  **(m)**
#####
#Modification A5~~A6
cfa_syntax_mod <- " Warmth =~ A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + A10
Dominance =~ D1 + D2 + D3 + D4 + D5 + D6 + D7 + D8 + D9 + D10
A4~~A9
D7~~D9
A1~~A6
A5~~A6
"
cfa_fit_mod <- cfa(cfa_syntax_mod, data = dat, std.lv = TRUE)
summary(cfa_fit_mod,standardize= TRUE, rsquare= TRUE)
## lavaan 0.6.15 ended normally after 24 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        45
## 
##                                                   Used       Total
##   Number of observations                           328         358
## 
## Model Test User Model:
##                                                       
##   Test statistic                               346.172
##   Degrees of freedom                               165
##   P-value (Chi-square)                           0.000
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   Warmth =~                                                             
##     A1                0.620    0.058   10.594    0.000    0.620    0.579
##     A2                0.644    0.055   11.610    0.000    0.644    0.623
##     A3                0.724    0.059   12.305    0.000    0.724    0.653
##     A4                0.631    0.054   11.641    0.000    0.631    0.632
##     A5                0.626    0.051   12.249    0.000    0.626    0.651
##     A6                0.482    0.048    9.956    0.000    0.482    0.554
##     A7                0.589    0.054   10.983    0.000    0.589    0.596
##     A8               -0.592    0.057  -10.417    0.000   -0.592   -0.570
##     A9               -0.806    0.055  -14.554    0.000   -0.806   -0.744
##     A10              -0.400    0.059   -6.721    0.000   -0.400   -0.388
##   Dominance =~                                                          
##     D1                0.770    0.050   15.378    0.000    0.770    0.773
##     D2                0.645    0.058   11.044    0.000    0.645    0.599
##     D3                0.365    0.060    6.059    0.000    0.365    0.352
##     D4                0.470    0.058    8.120    0.000    0.470    0.460
##     D5                0.669    0.051   13.116    0.000    0.669    0.686
##     D6                0.476    0.051    9.385    0.000    0.476    0.522
##     D7               -0.733    0.058  -12.730    0.000   -0.733   -0.672
##     D8               -0.350    0.048   -7.342    0.000   -0.350   -0.420
##     D9               -0.548    0.054  -10.132    0.000   -0.548   -0.562
##     D10              -0.567    0.060   -9.377    0.000   -0.567   -0.522
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##  .A4 ~~                                                                 
##    .A9               -0.199    0.043   -4.683    0.000   -0.199   -0.356
##  .D7 ~~                                                                 
##    .D9                0.205    0.045    4.593    0.000    0.205    0.314
##  .A1 ~~                                                                 
##    .A6                0.182    0.038    4.785    0.000    0.182    0.288
##  .A5 ~~                                                                 
##    .A6                0.157    0.033    4.739    0.000    0.157    0.297
##   Warmth ~~                                                             
##     Dominance         0.282    0.061    4.603    0.000    0.282    0.282
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .A1                0.762    0.066   11.585    0.000    0.762    0.665
##    .A2                0.652    0.058   11.277    0.000    0.652    0.612
##    .A3                0.707    0.064   11.016    0.000    0.707    0.574
##    .A4                0.597    0.055   10.937    0.000    0.597    0.600
##    .A5                0.533    0.048   11.016    0.000    0.533    0.576
##    .A6                0.524    0.045   11.770    0.000    0.524    0.693
##    .A7                0.631    0.055   11.484    0.000    0.631    0.645
##    .A8                0.726    0.062   11.649    0.000    0.726    0.675
##    .A9                0.524    0.054    9.692    0.000    0.524    0.446
##    .A10               0.903    0.073   12.385    0.000    0.903    0.850
##    .D1                0.399    0.043    9.195    0.000    0.399    0.403
##    .D2                0.744    0.065   11.459    0.000    0.744    0.642
##    .D3                0.939    0.075   12.468    0.000    0.939    0.876
##    .D4                0.823    0.068   12.162    0.000    0.823    0.788
##    .D5                0.502    0.047   10.644    0.000    0.502    0.529
##    .D6                0.603    0.051   11.905    0.000    0.603    0.727
##    .D7                0.652    0.061   10.738    0.000    0.652    0.548
##    .D8                0.572    0.047   12.292    0.000    0.572    0.823
##    .D9                0.651    0.056   11.570    0.000    0.651    0.684
##    .D10               0.858    0.072   11.907    0.000    0.858    0.728
##     Warmth            1.000                               1.000    1.000
##     Dominance         1.000                               1.000    1.000
## 
## R-Square:
##                    Estimate
##     A1                0.335
##     A2                0.388
##     A3                0.426
##     A4                0.400
##     A5                0.424
##     A6                0.307
##     A7                0.355
##     A8                0.325
##     A9                0.554
##     A10               0.150
##     D1                0.597
##     D2                0.358
##     D3                0.124
##     D4                0.212
##     D5                0.471
##     D6                0.273
##     D7                0.452
##     D8                0.177
##     D9                0.316
##     D10               0.272
#
cfa_fit_mod <- cfa(cfa_syntax_mod, data = dat, std.lv = TRUE, missing = "ML")
head(modificationIndices(cfa_fit_mod, sort. = TRUE, power = TRUE))
##        lhs op rhs     mi    epc sepc.all delta    ncp power decision
## 111     A2 ~~  A6 22.828  0.148    0.256   0.1 10.440 0.898  *epc:m*
## 91      A1 ~~  A3 18.024  0.179    0.244   0.1  5.621 0.659  **(m)**
## 249     D3 ~~  D4 17.272  0.204    0.230   0.1  4.152 0.531  **(m)**
## 70  Warmth =~  D1 13.758  0.169    0.170   0.1  4.812 0.592  **(m)**
## 94      A1 ~~  A7 11.769 -0.131   -0.194   0.1  6.872 0.746  **(m)**
## 79  Warmth =~ D10 11.380  0.195    0.179   0.1  2.996 0.409  **(m)**
#####
#Modification A2~~A6
cfa_syntax_mod <- " Warmth =~ A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + A10
Dominance =~ D1 + D2 + D3 + D4 + D5 + D6 + D7 + D8 + D9 + D10
A4~~A9
D7~~D9
A1~~A6
A5~~A6
A2~~A6
"
cfa_fit_mod <- cfa(cfa_syntax_mod, data = dat, std.lv = TRUE)
summary(cfa_fit_mod,standardize= TRUE, rsquare= TRUE)
## lavaan 0.6.15 ended normally after 24 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        46
## 
##                                                   Used       Total
##   Number of observations                           328         358
## 
## Model Test User Model:
##                                                       
##   Test statistic                               326.103
##   Degrees of freedom                               164
##   P-value (Chi-square)                           0.000
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   Warmth =~                                                             
##     A1                0.619    0.058   10.594    0.000    0.619    0.579
##     A2                0.633    0.056   11.356    0.000    0.633    0.613
##     A3                0.731    0.059   12.447    0.000    0.731    0.659
##     A4                0.631    0.054   11.628    0.000    0.631    0.632
##     A5                0.624    0.051   12.213    0.000    0.624    0.649
##     A6                0.455    0.049    9.328    0.000    0.455    0.528
##     A7                0.588    0.054   10.937    0.000    0.588    0.594
##     A8               -0.592    0.057  -10.410    0.000   -0.592   -0.570
##     A9               -0.810    0.055  -14.643    0.000   -0.810   -0.748
##     A10              -0.404    0.059   -6.793    0.000   -0.404   -0.392
##   Dominance =~                                                          
##     D1                0.770    0.050   15.379    0.000    0.770    0.773
##     D2                0.645    0.058   11.044    0.000    0.645    0.599
##     D3                0.365    0.060    6.058    0.000    0.365    0.352
##     D4                0.470    0.058    8.121    0.000    0.470    0.460
##     D5                0.669    0.051   13.115    0.000    0.669    0.686
##     D6                0.475    0.051    9.381    0.000    0.475    0.522
##     D7               -0.733    0.058  -12.725    0.000   -0.733   -0.672
##     D8               -0.351    0.048   -7.348    0.000   -0.351   -0.421
##     D9               -0.548    0.054  -10.139    0.000   -0.548   -0.562
##     D10              -0.567    0.060   -9.379    0.000   -0.567   -0.522
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##  .A4 ~~                                                                 
##    .A9               -0.196    0.043   -4.618    0.000   -0.196   -0.354
##  .D7 ~~                                                                 
##    .D9                0.204    0.045    4.591    0.000    0.204    0.314
##  .A1 ~~                                                                 
##    .A6                0.194    0.037    5.243    0.000    0.194    0.304
##  .A5 ~~                                                                 
##    .A6                0.152    0.032    4.801    0.000    0.152    0.283
##  .A2 ~~                                                                 
##    .A6                0.141    0.034    4.188    0.000    0.141    0.236
##   Warmth ~~                                                             
##     Dominance         0.285    0.061    4.647    0.000    0.285    0.285
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .A1                0.762    0.066   11.588    0.000    0.762    0.665
##    .A2                0.666    0.059   11.351    0.000    0.666    0.625
##    .A3                0.697    0.064   10.939    0.000    0.697    0.566
##    .A4                0.597    0.055   10.908    0.000    0.597    0.600
##    .A5                0.535    0.048   11.035    0.000    0.535    0.578
##    .A6                0.535    0.045   12.000    0.000    0.535    0.721
##    .A7                0.633    0.055   11.486    0.000    0.633    0.647
##    .A8                0.726    0.062   11.641    0.000    0.726    0.675
##    .A9                0.517    0.054    9.597    0.000    0.517    0.441
##    .A10               0.900    0.073   12.371    0.000    0.900    0.847
##    .D1                0.399    0.043    9.195    0.000    0.399    0.402
##    .D2                0.744    0.065   11.459    0.000    0.744    0.642
##    .D3                0.939    0.075   12.468    0.000    0.939    0.876
##    .D4                0.823    0.068   12.162    0.000    0.823    0.788
##    .D5                0.502    0.047   10.645    0.000    0.502    0.529
##    .D6                0.603    0.051   11.906    0.000    0.603    0.727
##    .D7                0.653    0.061   10.740    0.000    0.653    0.548
##    .D8                0.572    0.047   12.292    0.000    0.572    0.823
##    .D9                0.651    0.056   11.568    0.000    0.651    0.684
##    .D10               0.858    0.072   11.907    0.000    0.858    0.727
##     Warmth            1.000                               1.000    1.000
##     Dominance         1.000                               1.000    1.000
## 
## R-Square:
##                    Estimate
##     A1                0.335
##     A2                0.375
##     A3                0.434
##     A4                0.400
##     A5                0.422
##     A6                0.279
##     A7                0.353
##     A8                0.325
##     A9                0.559
##     A10               0.153
##     D1                0.598
##     D2                0.358
##     D3                0.124
##     D4                0.212
##     D5                0.471
##     D6                0.273
##     D7                0.452
##     D8                0.177
##     D9                0.316
##     D10               0.273
#
cfa_fit_mod <- cfa(cfa_syntax_mod, data = dat, std.lv = TRUE, missing = "ML")
head(modificationIndices(cfa_fit_mod, sort. = TRUE, power = TRUE))
##           lhs op rhs     mi    epc sepc.all delta   ncp power decision
## 249        D3 ~~  D4 17.275  0.204    0.230   0.1 4.152 0.531  **(m)**
## 92         A1 ~~  A3 14.978  0.164    0.224   0.1 5.600 0.658  **(m)**
## 71     Warmth =~  D1 13.696  0.169    0.169   0.1 4.803 0.592  **(m)**
## 111        A2 ~~  A5 13.344  0.136    0.229   0.1 7.181 0.764  *epc:m*
## 95         A1 ~~  A7 13.085 -0.139   -0.205   0.1 6.793 0.741  **(m)**
## 83  Dominance =~  A3 11.604 -0.190   -0.169   0.1 3.214 0.434  **(m)**
#####
#Modification D3~~D4
cfa_syntax_mod <- " Warmth =~ A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + A10
Dominance =~ D1 + D2 + D3 + D4 + D5 + D6 + D7 + D8 + D9 + D10
A4~~A9
D7~~D9
A1~~A6
A5~~A6
A2~~A6
D3~~D4
"
cfa_fit_mod <- cfa(cfa_syntax_mod, data = dat, std.lv = TRUE)
summary(cfa_fit_mod,standardize= TRUE, rsquare= TRUE)
## lavaan 0.6.15 ended normally after 23 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        47
## 
##                                                   Used       Total
##   Number of observations                           328         358
## 
## Model Test User Model:
##                                                       
##   Test statistic                               311.685
##   Degrees of freedom                               163
##   P-value (Chi-square)                           0.000
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   Warmth =~                                                             
##     A1                0.620    0.058   10.597    0.000    0.620    0.579
##     A2                0.633    0.056   11.355    0.000    0.633    0.612
##     A3                0.731    0.059   12.448    0.000    0.731    0.659
##     A4                0.631    0.054   11.627    0.000    0.631    0.632
##     A5                0.624    0.051   12.214    0.000    0.624    0.649
##     A6                0.455    0.049    9.329    0.000    0.455    0.528
##     A7                0.588    0.054   10.938    0.000    0.588    0.594
##     A8               -0.591    0.057  -10.410    0.000   -0.591   -0.570
##     A9               -0.810    0.055  -14.642    0.000   -0.810   -0.748
##     A10              -0.404    0.059   -6.793    0.000   -0.404   -0.392
##   Dominance =~                                                          
##     D1                0.776    0.050   15.521    0.000    0.776    0.779
##     D2                0.647    0.058   11.082    0.000    0.647    0.601
##     D3                0.343    0.061    5.652    0.000    0.343    0.331
##     D4                0.454    0.058    7.802    0.000    0.454    0.445
##     D5                0.672    0.051   13.187    0.000    0.672    0.689
##     D6                0.473    0.051    9.326    0.000    0.473    0.520
##     D7               -0.732    0.058  -12.687    0.000   -0.732   -0.671
##     D8               -0.349    0.048   -7.307    0.000   -0.349   -0.419
##     D9               -0.548    0.054  -10.129    0.000   -0.548   -0.562
##     D10              -0.564    0.061   -9.322    0.000   -0.564   -0.520
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##  .A4 ~~                                                                 
##    .A9               -0.197    0.043   -4.620    0.000   -0.197   -0.354
##  .D7 ~~                                                                 
##    .D9                0.205    0.045    4.595    0.000    0.205    0.314
##  .A1 ~~                                                                 
##    .A6                0.194    0.037    5.242    0.000    0.194    0.304
##  .A5 ~~                                                                 
##    .A6                0.152    0.032    4.801    0.000    0.152    0.283
##  .A2 ~~                                                                 
##    .A6                0.141    0.034    4.188    0.000    0.141    0.236
##  .D3 ~~                                                                 
##    .D4                0.192    0.053    3.640    0.000    0.192    0.214
##   Warmth ~~                                                             
##     Dominance         0.286    0.061    4.672    0.000    0.286    0.286
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .A1                0.762    0.066   11.588    0.000    0.762    0.665
##    .A2                0.666    0.059   11.351    0.000    0.666    0.625
##    .A3                0.696    0.064   10.939    0.000    0.696    0.566
##    .A4                0.597    0.055   10.909    0.000    0.597    0.600
##    .A5                0.535    0.048   11.035    0.000    0.535    0.578
##    .A6                0.535    0.045   12.000    0.000    0.535    0.721
##    .A7                0.633    0.055   11.486    0.000    0.633    0.647
##    .A8                0.726    0.062   11.641    0.000    0.726    0.675
##    .A9                0.517    0.054    9.598    0.000    0.517    0.441
##    .A10               0.900    0.073   12.371    0.000    0.900    0.847
##    .D1                0.390    0.043    9.021    0.000    0.390    0.393
##    .D2                0.741    0.065   11.433    0.000    0.741    0.639
##    .D3                0.955    0.076   12.500    0.000    0.955    0.890
##    .D4                0.838    0.069   12.204    0.000    0.838    0.802
##    .D5                0.498    0.047   10.585    0.000    0.498    0.525
##    .D6                0.605    0.051   11.911    0.000    0.605    0.730
##    .D7                0.654    0.061   10.734    0.000    0.654    0.550
##    .D8                0.573    0.047   12.294    0.000    0.573    0.825
##    .D9                0.651    0.056   11.559    0.000    0.651    0.684
##    .D10               0.861    0.072   11.912    0.000    0.861    0.730
##     Warmth            1.000                               1.000    1.000
##     Dominance         1.000                               1.000    1.000
## 
## R-Square:
##                    Estimate
##     A1                0.335
##     A2                0.375
##     A3                0.434
##     A4                0.400
##     A5                0.422
##     A6                0.279
##     A7                0.353
##     A8                0.325
##     A9                0.559
##     A10               0.153
##     D1                0.607
##     D2                0.361
##     D3                0.110
##     D4                0.198
##     D5                0.475
##     D6                0.270
##     D7                0.450
##     D8                0.175
##     D9                0.316
##     D10               0.270
#
cfa_fit_mod <- cfa(cfa_syntax_mod, data = dat, std.lv = TRUE, missing = "ML")
head(modificationIndices(cfa_fit_mod, sort. = TRUE, power = TRUE))
##           lhs op rhs     mi    epc sepc.all delta   ncp power decision
## 93         A1 ~~  A3 14.959  0.163    0.224   0.1 5.601 0.658  **(m)**
## 72     Warmth =~  D1 13.629  0.168    0.169   0.1 4.821 0.593  **(m)**
## 112        A2 ~~  A5 13.350  0.136    0.229   0.1 7.181 0.764  *epc:m*
## 96         A1 ~~  A7 13.102 -0.139   -0.205   0.1 6.794 0.741  **(m)**
## 84  Dominance =~  A3 11.463 -0.189   -0.168   0.1 3.208 0.433  **(m)**
## 147        A4 ~~  A8 11.178 -0.121   -0.183   0.1 7.653 0.790  *epc:m*
#####
##

#####
#Modification A1~~A3
cfa_syntax_mod <- " Warmth =~ A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + A10
Dominance =~ D1 + D2 + D3 + D4 + D5 + D6 + D7 + D8 + D9 + D10
A4~~A9
D7~~D9
A1~~A6
A5~~A6
A2~~A6
D3~~D4
A1~~A3
"
cfa_fit_mod <- cfa(cfa_syntax_mod, data = dat, std.lv = TRUE)
summary(cfa_fit_mod,standardize= TRUE, rsquare= TRUE)
## lavaan 0.6.15 ended normally after 24 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        48
## 
##                                                   Used       Total
##   Number of observations                           328         358
## 
## Model Test User Model:
##                                                       
##   Test statistic                               297.510
##   Degrees of freedom                               162
##   P-value (Chi-square)                           0.000
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   Warmth =~                                                             
##     A1                0.580    0.060    9.686    0.000    0.580    0.542
##     A2                0.635    0.056   11.356    0.000    0.635    0.615
##     A3                0.700    0.060   11.682    0.000    0.700    0.631
##     A4                0.643    0.054   11.823    0.000    0.643    0.645
##     A5                0.619    0.051   12.039    0.000    0.619    0.644
##     A6                0.457    0.049    9.413    0.000    0.457    0.533
##     A7                0.601    0.054   11.203    0.000    0.601    0.608
##     A8               -0.603    0.057  -10.603    0.000   -0.603   -0.581
##     A9               -0.820    0.055  -14.781    0.000   -0.820   -0.757
##     A10              -0.400    0.060   -6.709    0.000   -0.400   -0.388
##   Dominance =~                                                          
##     D1                0.775    0.050   15.512    0.000    0.775    0.779
##     D2                0.647    0.058   11.078    0.000    0.647    0.601
##     D3                0.343    0.061    5.654    0.000    0.343    0.331
##     D4                0.455    0.058    7.806    0.000    0.455    0.445
##     D5                0.672    0.051   13.187    0.000    0.672    0.690
##     D6                0.473    0.051    9.322    0.000    0.473    0.520
##     D7               -0.732    0.058  -12.693    0.000   -0.732   -0.671
##     D8               -0.349    0.048   -7.312    0.000   -0.349   -0.419
##     D9               -0.548    0.054  -10.130    0.000   -0.548   -0.562
##     D10              -0.564    0.061   -9.323    0.000   -0.564   -0.520
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##  .A4 ~~                                                                 
##    .A9               -0.180    0.043   -4.211    0.000   -0.180   -0.334
##  .D7 ~~                                                                 
##    .D9                0.205    0.045    4.591    0.000    0.205    0.314
##  .A1 ~~                                                                 
##    .A6                0.200    0.036    5.543    0.000    0.200    0.307
##  .A5 ~~                                                                 
##    .A6                0.146    0.032    4.601    0.000    0.146    0.274
##  .A2 ~~                                                                 
##    .A6                0.130    0.034    3.891    0.000    0.130    0.221
##  .D3 ~~                                                                 
##    .D4                0.192    0.053    3.638    0.000    0.192    0.214
##  .A1 ~~                                                                 
##    .A3                0.170    0.048    3.560    0.000    0.170    0.219
##   Warmth ~~                                                             
##     Dominance         0.283    0.062    4.597    0.000    0.283    0.283
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .A1                0.809    0.069   11.773    0.000    0.809    0.706
##    .A2                0.664    0.059   11.264    0.000    0.664    0.622
##    .A3                0.742    0.067   11.066    0.000    0.742    0.602
##    .A4                0.581    0.055   10.637    0.000    0.581    0.584
##    .A5                0.541    0.049   11.000    0.000    0.541    0.585
##    .A6                0.527    0.044   11.940    0.000    0.527    0.716
##    .A7                0.617    0.054   11.322    0.000    0.617    0.631
##    .A8                0.713    0.062   11.518    0.000    0.713    0.662
##    .A9                0.500    0.054    9.218    0.000    0.500    0.427
##    .A10               0.903    0.073   12.361    0.000    0.903    0.849
##    .D1                0.391    0.043    9.025    0.000    0.391    0.394
##    .D2                0.741    0.065   11.434    0.000    0.741    0.639
##    .D3                0.955    0.076   12.499    0.000    0.955    0.890
##    .D4                0.837    0.069   12.203    0.000    0.837    0.802
##    .D5                0.498    0.047   10.583    0.000    0.498    0.525
##    .D6                0.605    0.051   11.911    0.000    0.605    0.730
##    .D7                0.654    0.061   10.729    0.000    0.654    0.550
##    .D8                0.573    0.047   12.292    0.000    0.573    0.824
##    .D9                0.651    0.056   11.557    0.000    0.651    0.684
##    .D10               0.861    0.072   11.911    0.000    0.861    0.730
##     Warmth            1.000                               1.000    1.000
##     Dominance         1.000                               1.000    1.000
## 
## R-Square:
##                    Estimate
##     A1                0.294
##     A2                0.378
##     A3                0.398
##     A4                0.416
##     A5                0.415
##     A6                0.284
##     A7                0.369
##     A8                0.338
##     A9                0.573
##     A10               0.151
##     D1                0.606
##     D2                0.361
##     D3                0.110
##     D4                0.198
##     D5                0.475
##     D6                0.270
##     D7                0.450
##     D8                0.176
##     D9                0.316
##     D10               0.270
#
cfa_fit_mod <- cfa(cfa_syntax_mod, data = dat, std.lv = TRUE, missing = "ML")
head(modificationIndices(cfa_fit_mod, sort. = TRUE, power = TRUE))
##           lhs op rhs     mi    epc sepc.all delta   ncp power decision
## 85  Dominance =~  A3 13.814 -0.203   -0.180   0.1 3.365 0.450  **(m)**
## 112        A2 ~~  A5 13.661  0.140    0.235   0.1 7.016 0.755  *epc:m*
## 73     Warmth =~  D1 13.339  0.167    0.167   0.1 4.792 0.591  **(m)**
## 133        A3 ~~ A10 11.917 -0.159   -0.193   0.1 4.730 0.585  **(m)**
## 83  Dominance =~  A1 11.492  0.172    0.160   0.1 3.889 0.505  **(m)**
## 82     Warmth =~ D10 11.136  0.194    0.178   0.1 2.961 0.406  **(m)**

The fit of the model has improved.

library(corrplot)
corrplot(
  resid(cfa_fit, type = "cor")$cov,
  type = "lower", is.corr = FALSE )

##########

library(corrplot)
corrplot(
  resid(cfa_fit_mod, type = "cor")$cov,
  type = "lower", is.corr = FALSE)

Part 4: Model diagram for both original model, and final model.

#Part 4: Model diagram for both original model, and final model.

library(lavaanPlot)
## Warning: package 'lavaanPlot' was built under R version 4.2.2
lavaanPlot(model = cfa_fit, coefs = TRUE, covs = TRUE, stars = "regress")
##### modified model
library(lavaanPlot)
lavaanPlot(model = cfa_fit_mod, coefs = TRUE, covs = TRUE, stars = "regress")