From Julie Butler and Peggy Kerns PERMA & EPOCH
library(lavaan)
## This is lavaan 0.5-19
## lavaan is BETA software! Please report any bugs.
require(semPlot)
## Loading required package: semPlot
library(dplyr)
##
## Attaching package: 'dplyr'
##
## The following objects are masked from 'package:stats':
##
## filter, lag
##
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(GPArotation)
library(psych)
Loadthedata
data <- read.csv("~/Git/stats/Perma_Study/PERMAfinal.csv")
Create Dataset with Coplete Cases
data1 <- na.omit(data)
Create the model with 9 factors as the instrument was designed
five.model= 'Acomplishment =~ PERMA_A1_1 + PERMA_A2_1 + PERMA_A3_1
Engagement =~ PERMA_E1_1 + PERMA_E2_1 + PERMA_E3_1
Positive Emotion =~ PERMA_P1_1 + PERMA_P2 + PERMA_P3_1
Relationship =~ PERMA_R1_1 + PERMA_R2_1 + PERMA_R3_1
Meaning =~ PERMA_M1_1 + PERMA_M2_1 + PERMA_M3_1'
Run the model with all data
five.fit=cfa(five.model, data=data, missing="fiml")
## Warning in lav_data_full(data = data, group = group, group.label = group.label, : lavaan WARNING: some cases are empty and will be removed:
## 14 15 16 20 25 26 27 28 29 32 33 34 35 37 39 41 42 44 51 55 56 59 60 66 70 73 74 75 76 77 78 80 81 83 84 87 88 90 91 92 93 96 98 99 101 104 106 107 108 111 112 114 116 118 119 121 124 126 127 128 130 131 132 133 134 138 142 144 147 149 150 151 153 156 159 160 169 170 171 172 174 175 178 179 184 185 186 188 190 191 193 195 196 202 204 208 213 214 215 216 219 220 221 224 226 229 231 234 237 238 240 243 244 248 252 254 255 256 258 259 261 264 265 266 268 269 270 271 272 273 274 275 276 277 278 279 280 281 283 284 285 288 289 290 293 294 301 302 303 304 305 306 307 308 309 310 311 312 314 320 321 322 323 324 325 326 327 328 329 331 332 333 334 335 336 338 340 348 349 350 351 352 356 357 358 359 360 361 363 364 366 367 368 369 371 372 374 376 377 378 379 380 382 385 386 389 390 394 395 397 399 443 444 445 446 447 448 449 450 452 453 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 485 486 488 489 490 491 492 493 494 495 496 497 498 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514
## Found more than one class "Model" in cache; using the first, from namespace 'lavaan'
## Warning in lav_object_post_check(lavobject): lavaan WARNING:
## covariance matrix of latent variables is not positive definite; use
## inspect(fit,"cov.lv") to investigate.
Run the model with complete cases
five.fit1=cfa(five.model, data=data1, missing = "fiml")
Create pictures with all data
semPaths(five.fit, whatLabels = "std", layout = "tree")
## Warning in lav_object_post_check(lavobject): lavaan WARNING:
## covariance matrix of latent variables is not positive definite; use
## inspect(fit,"cov.lv") to investigate.
Create pictures with all complet cases
semPaths(five.fit1, whatLabels = "std", layout = "tree")
Summarie with all data
summary(five.fit, standardized = TRUE, rsquare=TRUE)
## lavaan (0.5-19) converged normally after 96 iterations
##
## Used Total
## Number of observations 476 753
##
## Number of missing patterns 2
##
## Estimator ML
## Minimum Function Test Statistic 241.641
## Degrees of freedom 80
## P-value (Chi-square) 0.000
## Warning in lav_object_post_check(lavobject): lavaan WARNING:
## covariance matrix of latent variables is not positive definite; use
## inspect(fit,"cov.lv") to investigate.
##
## Parameter Estimates:
##
## Information Observed
## Standard Errors Standard
##
## Latent Variables:
## Estimate Std.Err Z-value P(>|z|) Std.lv Std.all
## Acomplishment =~
## PERMA_A1_1 1.000 1.914 0.801
## PERMA_A2_1 0.855 0.054 15.831 0.000 1.637 0.696
## PERMA_A3_1 0.788 0.053 14.770 0.000 1.508 0.663
## Engagement =~
## PERMA_E1_1 1.000 1.528 0.683
## PERMA_E2_1 1.165 0.080 14.506 0.000 1.779 0.795
## PERMA_E3_1 0.839 0.082 10.286 0.000 1.281 0.517
## PositiveEmotion =~
## PERMA_P1_1 1.000 1.901 0.823
## PERMA_P2 1.086 0.050 21.871 0.000 2.065 0.853
## PERMA_P3_1 0.799 0.052 15.337 0.000 1.519 0.673
## Relationship =~
## PERMA_R1_1 1.000 1.646 0.614
## PERMA_R2_1 1.167 0.097 12.068 0.000 1.922 0.720
## PERMA_R3_1 1.107 0.096 11.504 0.000 1.822 0.685
## Meaning =~
## PERMA_M1_1 1.000 1.986 0.846
## PERMA_M2_1 1.070 0.057 18.848 0.000 2.125 0.908
## PERMA_M3_1 0.939 0.058 16.065 0.000 1.865 0.830
## fmi
##
## NA
## 0.087
## 0.101
##
## NA
## 0.047
## -0.020
##
## NA
## 0.029
## 0.081
##
## NA
## 0.015
## 0.041
##
## NA
## 0.505
## 0.506
##
## Covariances:
## Estimate Std.Err Z-value P(>|z|) Std.lv Std.all
## Acomplishment ~~
## Engagement 2.590 0.253 10.251 0.000 0.886 0.886
## PositiveEmotin 3.230 0.279 11.599 0.000 0.888 0.888
## Relationship 2.680 0.288 9.316 0.000 0.851 0.851
## Meaning 3.805 0.336 11.312 0.000 1.001 1.001
## Engagement ~~
## PositiveEmotin 2.574 0.245 10.523 0.000 0.886 0.886
## Relationship 2.178 0.250 8.718 0.000 0.866 0.866
## Meaning 2.622 0.267 9.812 0.000 0.864 0.864
## PositiveEmotion ~~
## Relationship 2.780 0.286 9.736 0.000 0.888 0.888
## Meaning 3.557 0.317 11.228 0.000 0.942 0.942
## Relationship ~~
## Meaning 2.671 0.303 8.824 0.000 0.817 0.817
## fmi
##
## 0.011
## -0.003
## 0.029
## 0.187
##
## -0.009
## 0.036
## 0.132
##
## 0.010
## 0.174
##
## 0.153
##
## Intercepts:
## Estimate Std.Err Z-value P(>|z|) Std.lv Std.all
## PERMA_A1_1 6.826 0.110 62.314 0.000 6.826 2.856
## PERMA_A2_1 7.088 0.108 65.787 0.000 7.088 3.015
## PERMA_A3_1 7.828 0.104 75.034 0.000 7.828 3.439
## PERMA_E1_1 7.721 0.102 75.333 0.000 7.721 3.453
## PERMA_E2_1 7.683 0.103 74.850 0.000 7.683 3.431
## PERMA_E3_1 8.359 0.114 73.615 0.000 8.359 3.374
## PERMA_P1_1 7.298 0.106 68.963 0.000 7.298 3.161
## PERMA_P2 7.330 0.111 66.087 0.000 7.330 3.029
## PERMA_P3_1 6.834 0.103 66.074 0.000 6.834 3.028
## PERMA_R1_1 7.265 0.123 59.125 0.000 7.265 2.710
## PERMA_R2_1 7.513 0.122 61.446 0.000 7.513 2.816
## PERMA_R3_1 7.263 0.122 59.549 0.000 7.263 2.729
## PERMA_M1_1 7.229 0.126 57.271 0.000 7.229 3.081
## PERMA_M2_1 7.285 0.121 59.973 0.000 7.285 3.112
## PERMA_M3_1 7.009 0.122 57.489 0.000 7.009 3.119
## Acomplishment 0.000 0.000 0.000
## Engagement 0.000 0.000 0.000
## PositiveEmotin 0.000 0.000 0.000
## Relationship 0.000 0.000 0.000
## Meaning 0.000 0.000 0.000
## fmi
## 0.000
## 0.000
## 0.000
## 0.000
## 0.000
## 0.000
## 0.000
## 0.000
## 0.000
## 0.000
## 0.000
## 0.000
## 0.274
## 0.220
## 0.286
## NA
## NA
## NA
## NA
## NA
##
## Variances:
## Estimate Std.Err Z-value P(>|z|) Std.lv Std.all
## PERMA_A1_1 2.048 0.183 11.175 0.000 2.048 0.359
## PERMA_A2_1 2.846 0.214 13.279 0.000 2.846 0.515
## PERMA_A3_1 2.906 0.209 13.890 0.000 2.906 0.561
## PERMA_E1_1 2.665 0.207 12.889 0.000 2.665 0.533
## PERMA_E2_1 1.849 0.174 10.627 0.000 1.849 0.369
## PERMA_E3_1 4.496 0.314 14.318 0.000 4.496 0.732
## PERMA_P1_1 1.717 0.152 11.309 0.000 1.717 0.322
## PERMA_P2 1.593 0.156 10.209 0.000 1.593 0.272
## PERMA_P3_1 2.784 0.201 13.886 0.000 2.784 0.547
## PERMA_R1_1 4.475 0.328 13.658 0.000 4.475 0.623
## PERMA_R2_1 3.423 0.298 11.505 0.000 3.423 0.481
## PERMA_R3_1 3.759 0.297 12.675 0.000 3.759 0.531
## PERMA_M1_1 1.561 0.171 9.142 0.000 1.561 0.284
## PERMA_M2_1 0.961 0.127 7.591 0.000 0.961 0.175
## PERMA_M3_1 1.572 0.168 9.355 0.000 1.572 0.311
## Acomplishment 3.663 0.368 9.956 0.000 1.000 1.000
## Engagement 2.334 0.297 7.865 0.000 1.000 1.000
## PositiveEmotin 3.614 0.343 10.534 0.000 1.000 1.000
## Relationship 2.711 0.395 6.862 0.000 1.000 1.000
## Meaning 3.945 0.439 8.988 0.000 1.000 1.000
## fmi
## 0.159
## 0.112
## 0.067
## 0.034
## -0.071
## 0.028
## 0.160
## 0.188
## 0.058
## -0.005
## 0.074
## 0.000
## 0.514
## 0.506
## 0.514
## 0.039
## 0.017
## 0.031
## -0.004
## 0.372
##
## R-Square:
## Estimate
## PERMA_A1_1 0.641
## PERMA_A2_1 0.485
## PERMA_A3_1 0.439
## PERMA_E1_1 0.467
## PERMA_E2_1 0.631
## PERMA_E3_1 0.268
## PERMA_P1_1 0.678
## PERMA_P2 0.728
## PERMA_P3_1 0.453
## PERMA_R1_1 0.377
## PERMA_R2_1 0.519
## PERMA_R3_1 0.469
## PERMA_M1_1 0.716
## PERMA_M2_1 0.825
## PERMA_M3_1 0.689
Summarie with complete cases
summary(five.fit1, standardized = TRUE, rsquare=TRUE)
## lavaan (0.5-19) converged normally after 81 iterations
##
## Number of observations 239
##
## Number of missing patterns 1
##
## Estimator ML
## Minimum Function Test Statistic 281.723
## Degrees of freedom 80
## P-value (Chi-square) 0.000
##
## Parameter Estimates:
##
## Information Observed
## Standard Errors Standard
##
## Latent Variables:
## Estimate Std.Err Z-value P(>|z|) Std.lv Std.all
## Acomplishment =~
## PERMA_A1_1 1.000 1.874 0.847
## PERMA_A2_1 0.947 0.060 15.691 0.000 1.775 0.821
## PERMA_A3_1 0.802 0.065 12.324 0.000 1.503 0.715
## Engagement =~
## PERMA_E1_1 1.000 1.561 0.764
## PERMA_E2_1 1.224 0.084 14.564 0.000 1.911 0.899
## PERMA_E3_1 0.996 0.095 10.489 0.000 1.554 0.665
## PositiveEmotion =~
## PERMA_P1_1 1.000 2.010 0.905
## PERMA_P2 1.038 0.042 24.520 0.000 2.087 0.938
## PERMA_P3_1 0.663 0.055 12.011 0.000 1.332 0.662
## Relationship =~
## PERMA_R1_1 1.000 1.891 0.761
## PERMA_R2_1 1.047 0.083 12.625 0.000 1.979 0.808
## PERMA_R3_1 0.966 0.082 11.721 0.000 1.827 0.776
## Meaning =~
## PERMA_M1_1 1.000 1.980 0.847
## PERMA_M2_1 1.070 0.056 18.945 0.000 2.118 0.908
## PERMA_M3_1 0.935 0.058 16.029 0.000 1.851 0.826
## fmi
##
## NA
## -0.005
## 0.059
##
## NA
## 0.016
## -0.007
##
## NA
## -0.028
## 0.035
##
## NA
## 0.008
## 0.066
##
## NA
## 0.005
## 0.006
##
## Covariances:
## Estimate Std.Err Z-value P(>|z|) Std.lv Std.all
## Acomplishment ~~
## Engagement 2.617 0.322 8.124 0.000 0.895 0.895
## PositiveEmotin 3.253 0.369 8.827 0.000 0.863 0.863
## Relationship 2.996 0.383 7.830 0.000 0.845 0.845
## Meaning 3.600 0.400 9.007 0.000 0.970 0.970
## Engagement ~~
## PositiveEmotin 2.825 0.332 8.516 0.000 0.901 0.901
## Relationship 2.546 0.338 7.526 0.000 0.863 0.863
## Meaning 2.735 0.335 8.175 0.000 0.885 0.885
## PositiveEmotion ~~
## Relationship 3.436 0.409 8.394 0.000 0.904 0.904
## Meaning 3.642 0.401 9.085 0.000 0.915 0.915
## Relationship ~~
## Meaning 3.133 0.400 7.840 0.000 0.837 0.837
## fmi
##
## 0.010
## -0.012
## 0.014
## 0.003
##
## -0.014
## 0.021
## -0.004
##
## 0.007
## -0.002
##
## 0.014
##
## Intercepts:
## Estimate Std.Err Z-value P(>|z|) Std.lv Std.all
## PERMA_A1_1 7.163 0.143 50.037 0.000 7.163 3.237
## PERMA_A2_1 7.126 0.140 50.927 0.000 7.126 3.294
## PERMA_A3_1 7.845 0.136 57.664 0.000 7.845 3.730
## PERMA_E1_1 7.816 0.132 59.133 0.000 7.816 3.825
## PERMA_E2_1 7.845 0.137 57.074 0.000 7.845 3.692
## PERMA_E3_1 8.268 0.151 54.702 0.000 8.268 3.538
## PERMA_P1_1 7.695 0.144 53.565 0.000 7.695 3.465
## PERMA_P2 7.552 0.144 52.477 0.000 7.552 3.394
## PERMA_P3_1 7.184 0.130 55.189 0.000 7.184 3.570
## PERMA_R1_1 7.406 0.161 46.046 0.000 7.406 2.978
## PERMA_R2_1 7.527 0.158 47.514 0.000 7.527 3.073
## PERMA_R3_1 7.531 0.152 49.478 0.000 7.531 3.200
## PERMA_M1_1 7.456 0.151 49.286 0.000 7.456 3.188
## PERMA_M2_1 7.527 0.151 49.903 0.000 7.527 3.228
## PERMA_M3_1 7.222 0.145 49.841 0.000 7.222 3.224
## Acomplishment 0.000 0.000 0.000
## Engagement 0.000 0.000 0.000
## PositiveEmotin 0.000 0.000 0.000
## Relationship 0.000 0.000 0.000
## Meaning 0.000 0.000 0.000
## fmi
## 0.000
## 0.000
## 0.000
## 0.000
## 0.000
## 0.000
## 0.000
## 0.000
## 0.000
## 0.000
## 0.000
## 0.000
## 0.000
## 0.000
## 0.000
## NA
## NA
## NA
## NA
## NA
##
## Variances:
## Estimate Std.Err Z-value P(>|z|) Std.lv Std.all
## PERMA_A1_1 1.385 0.172 8.033 0.000 1.385 0.283
## PERMA_A2_1 1.527 0.179 8.535 0.000 1.527 0.326
## PERMA_A3_1 2.164 0.218 9.912 0.000 2.164 0.489
## PERMA_E1_1 1.739 0.187 9.317 0.000 1.739 0.417
## PERMA_E2_1 0.864 0.139 6.229 0.000 0.864 0.191
## PERMA_E3_1 3.043 0.302 10.079 0.000 3.043 0.557
## PERMA_P1_1 0.891 0.111 7.995 0.000 0.891 0.181
## PERMA_P2 0.595 0.098 6.069 0.000 0.595 0.120
## PERMA_P3_1 2.275 0.221 10.284 0.000 2.275 0.562
## PERMA_R1_1 2.607 0.290 9.004 0.000 2.607 0.422
## PERMA_R2_1 2.081 0.270 7.705 0.000 2.081 0.347
## PERMA_R3_1 2.201 0.248 8.866 0.000 2.201 0.397
## PERMA_M1_1 1.549 0.169 9.143 0.000 1.549 0.283
## PERMA_M2_1 0.952 0.126 7.578 0.000 0.952 0.175
## PERMA_M3_1 1.593 0.170 9.382 0.000 1.593 0.317
## Acomplishment 3.513 0.445 7.887 0.000 1.000 1.000
## Engagement 2.436 0.361 6.754 0.000 1.000 1.000
## PositiveEmotin 4.041 0.450 8.975 0.000 1.000 1.000
## Relationship 3.576 0.538 6.641 0.000 1.000 1.000
## Meaning 3.921 0.489 8.021 0.000 1.000 1.000
## fmi
## 0.089
## 0.095
## 0.022
## 0.040
## -0.047
## 0.013
## 0.019
## 0.056
## 0.035
## 0.023
## 0.149
## 0.007
## 0.031
## 0.015
## 0.035
## 0.013
## 0.011
## 0.001
## 0.007
## 0.004
##
## R-Square:
## Estimate
## PERMA_A1_1 0.717
## PERMA_A2_1 0.674
## PERMA_A3_1 0.511
## PERMA_E1_1 0.583
## PERMA_E2_1 0.809
## PERMA_E3_1 0.443
## PERMA_P1_1 0.819
## PERMA_P2 0.880
## PERMA_P3_1 0.438
## PERMA_R1_1 0.578
## PERMA_R2_1 0.653
## PERMA_R3_1 0.603
## PERMA_M1_1 0.717
## PERMA_M2_1 0.825
## PERMA_M3_1 0.683
Residual correlations with all data
correl = residuals(five.fit, type="cor")
correl
## $type
## [1] "cor.bollen"
##
## $cor
## PERMA_A1 PERMA_A2 PERMA_A3 PERMA_E1 PERMA_E2 PERMA_E3 PERMA_P1
## PERMA_A1_1 0.000
## PERMA_A2_1 0.017 0.000
## PERMA_A3_1 -0.023 0.005 0.000
## PERMA_E1_1 -0.011 0.026 0.058 0.000
## PERMA_E2_1 0.015 -0.015 0.041 -0.032 0.000
## PERMA_E3_1 -0.108 -0.069 0.002 0.116 -0.012 0.000
## PERMA_P1_1 -0.055 -0.040 0.029 -0.039 0.016 -0.013 0.000
## PERMA_P2 -0.022 -0.004 0.034 -0.035 0.024 -0.007 0.035
## PERMA_P3_1 0.080 0.074 0.043 0.041 0.002 -0.014 -0.026
## PERMA_R1_1 0.026 0.017 0.006 0.035 0.025 0.006 -0.053
## PERMA_R2_1 -0.019 -0.022 -0.032 -0.004 -0.026 -0.004 0.016
## PERMA_R3_1 0.001 0.013 0.034 0.018 -0.020 0.020 0.046
## PERMA_M1_1 0.018 -0.049 -0.131 -0.022 0.013 0.007 -0.011
## PERMA_M2_1 0.006 -0.021 -0.048 -0.070 0.040 -0.032 -0.009
## PERMA_M3_1 0.036 0.056 0.063 -0.017 0.021 -0.015 -0.126
## PERMA_P2 PERMA_P3 PERMA_R1 PERMA_R2 PERMA_R3 PERMA_M1 PERMA_M2
## PERMA_A1_1
## PERMA_A2_1
## PERMA_A3_1
## PERMA_E1_1
## PERMA_E2_1
## PERMA_E3_1
## PERMA_P1_1
## PERMA_P2 0.000
## PERMA_P3_1 -0.051 0.000
## PERMA_R1_1 0.028 0.047 0.000
## PERMA_R2_1 -0.041 0.052 0.017 0.000
## PERMA_R3_1 -0.057 0.068 -0.062 0.028 0.000
## PERMA_M1_1 0.055 -0.004 0.024 0.056 0.017 0.000
## PERMA_M2_1 0.054 0.003 -0.055 -0.040 -0.037 0.005 0.000
## PERMA_M3_1 -0.071 0.041 -0.008 0.027 -0.042 -0.002 -0.023
## PERMA_M3
## PERMA_A1_1
## PERMA_A2_1
## PERMA_A3_1
## PERMA_E1_1
## PERMA_E2_1
## PERMA_E3_1
## PERMA_P1_1
## PERMA_P2
## PERMA_P3_1
## PERMA_R1_1
## PERMA_R2_1
## PERMA_R3_1
## PERMA_M1_1
## PERMA_M2_1
## PERMA_M3_1 0.000
##
## $mean
## PERMA_A1_1 PERMA_A2_1 PERMA_A3_1 PERMA_E1_1 PERMA_E2_1 PERMA_E3_1
## 0.000 0.000 0.000 0.000 0.000 0.000
## PERMA_P1_1 PERMA_P2 PERMA_P3_1 PERMA_R1_1 PERMA_R2_1 PERMA_R3_1
## 0.000 0.000 0.000 0.000 0.000 0.000
## PERMA_M1_1 PERMA_M2_1 PERMA_M3_1
## -0.048 -0.076 0.002
Residual correlations with complete cases
correl1 = residuals(five.fit1, type="cor")
correl1
## $type
## [1] "cor.bollen"
##
## $cor
## PERMA_A1 PERMA_A2 PERMA_A3 PERMA_E1 PERMA_E2 PERMA_E3 PERMA_P1
## PERMA_A1_1 0.000
## PERMA_A2_1 0.032 0.000
## PERMA_A3_1 -0.050 -0.007 0.000
## PERMA_E1_1 0.013 0.072 0.086 0.000
## PERMA_E2_1 -0.010 -0.045 0.067 -0.003 0.000
## PERMA_E3_1 -0.093 -0.071 0.075 0.068 -0.023 0.000
## PERMA_P1_1 -0.066 -0.019 0.082 -0.057 0.000 0.011 0.000
## PERMA_P2 -0.059 0.003 0.070 -0.064 0.023 0.008 0.014
## PERMA_P3_1 0.119 0.161 0.148 0.074 0.047 0.026 -0.029
## PERMA_R1_1 0.003 0.079 -0.003 0.029 0.044 0.039 -0.016
## PERMA_R2_1 -0.061 -0.026 -0.014 -0.022 -0.067 0.072 -0.006
## PERMA_R3_1 -0.001 0.015 0.066 -0.034 0.022 -0.003 0.043
## PERMA_M1_1 0.006 -0.030 -0.075 -0.017 0.002 0.016 0.001
## PERMA_M2_1 -0.001 -0.022 -0.002 -0.039 0.017 -0.013 0.000
## PERMA_M3_1 0.036 0.038 0.076 0.019 -0.005 0.009 -0.085
## PERMA_P2 PERMA_P3 PERMA_R1 PERMA_R2 PERMA_R3 PERMA_M1 PERMA_M2
## PERMA_A1_1
## PERMA_A2_1
## PERMA_A3_1
## PERMA_E1_1
## PERMA_E2_1
## PERMA_E3_1
## PERMA_P1_1
## PERMA_P2 0.000
## PERMA_P3_1 -0.042 0.000
## PERMA_R1_1 0.002 0.071 0.000
## PERMA_R2_1 -0.032 -0.001 0.044 0.000
## PERMA_R3_1 -0.004 0.113 -0.093 0.032 0.000
## PERMA_M1_1 0.025 0.036 0.038 0.042 0.043 0.000
## PERMA_M2_1 0.023 0.061 -0.025 -0.048 0.010 0.002 0.000
## PERMA_M3_1 -0.061 0.105 0.010 -0.006 -0.010 0.017 -0.012
## PERMA_M3
## PERMA_A1_1
## PERMA_A2_1
## PERMA_A3_1
## PERMA_E1_1
## PERMA_E2_1
## PERMA_E3_1
## PERMA_P1_1
## PERMA_P2
## PERMA_P3_1
## PERMA_R1_1
## PERMA_R2_1
## PERMA_R3_1
## PERMA_M1_1
## PERMA_M2_1
## PERMA_M3_1 0.000
##
## $mean
## PERMA_A1_1 PERMA_A2_1 PERMA_A3_1 PERMA_E1_1 PERMA_E2_1 PERMA_E3_1
## 0 0 0 0 0 0
## PERMA_P1_1 PERMA_P2 PERMA_P3_1 PERMA_R1_1 PERMA_R2_1 PERMA_R3_1
## 0 0 0 0 0 0
## PERMA_M1_1 PERMA_M2_1 PERMA_M3_1
## 0 0 0
Zscore correlation for all data anything over 1.96 is going to be statistically significant at the .05 level
zcorrels = residuals(five.fit, type = "standardized")
Zscore correlation for complete cases anything over 1.96 is going to be statistically significant at the .05 level
zcorrels1 = residuals(five.fit1, type = "standardized")
Modification indicies for all data
modindices(five.fit, sort. = TRUE, minimum.value = 3.84)
## Warning in lav_object_post_check(lavobject): lavaan WARNING:
## covariance matrix of latent variables is not positive definite; use
## inspect(fit,"cov.lv") to investigate.
## lhs op rhs mi epc sepc.lv sepc.all sepc.nox
## 195 PERMA_P1_1 ~~ PERMA_P2 26.899 0.800 0.800 0.143 0.143
## 71 Acomplishment =~ PERMA_P3_1 24.764 0.836 1.600 0.709 0.709
## 166 PERMA_E1_1 ~~ PERMA_E3_1 21.639 0.848 0.848 0.153 0.153
## 110 Relationship =~ PERMA_P3_1 20.335 0.890 1.466 0.650 0.650
## 69 Acomplishment =~ PERMA_P1_1 20.032 -0.829 -1.587 -0.687 -0.687
## 118 Meaning =~ PERMA_E2_1 17.426 0.909 1.806 0.806 0.806
## 203 PERMA_P2 ~~ PERMA_P3_1 14.875 -0.500 -0.500 -0.092 -0.092
## 162 PERMA_A3_1 ~~ PERMA_M1_1 14.174 -0.594 -0.594 -0.111 -0.111
## 120 Meaning =~ PERMA_P1_1 14.126 -0.678 -1.347 -0.583 -0.583
## 130 PERMA_A1_1 ~~ PERMA_E3_1 13.739 -0.592 -0.592 -0.100 -0.100
## 109 Relationship =~ PERMA_P2 13.453 -0.743 -1.223 -0.505 -0.505
## 206 PERMA_P2 ~~ PERMA_R3_1 13.356 -0.537 -0.537 -0.083 -0.083
## 94 PositiveEmotion =~ PERMA_E2_1 13.333 1.003 1.906 0.851 0.851
## 119 Meaning =~ PERMA_E3_1 12.607 -0.641 -1.274 -0.514 -0.514
## 122 Meaning =~ PERMA_P3_1 12.187 0.648 1.288 0.571 0.571
## 101 PositiveEmotion =~ PERMA_M3_1 11.806 -0.724 -1.376 -0.612 -0.612
## 68 Acomplishment =~ PERMA_E3_1 11.151 -0.678 -1.297 -0.524 -0.524
## 197 PERMA_P1_1 ~~ PERMA_R1_1 11.137 -0.510 -0.510 -0.082 -0.082
## 80 Engagement =~ PERMA_A3_1 10.890 0.702 1.072 0.471 0.471
## 133 PERMA_A1_1 ~~ PERMA_P3_1 9.655 0.394 0.394 0.073 0.073
## 165 PERMA_E1_1 ~~ PERMA_E2_1 9.654 -0.633 -0.633 -0.126 -0.126
## 217 PERMA_R1_1 ~~ PERMA_R3_1 8.985 -0.719 -0.719 -0.101 -0.101
## 202 PERMA_P1_1 ~~ PERMA_M3_1 8.621 -0.377 -0.377 -0.073 -0.073
## 67 Acomplishment =~ PERMA_E2_1 8.606 0.670 1.283 0.573 0.573
## 76 Acomplishment =~ PERMA_M2_1 8.494 -1.165 -2.230 -0.953 -0.953
## 83 Engagement =~ PERMA_P3_1 8.282 0.616 0.942 0.417 0.417
## 199 PERMA_P1_1 ~~ PERMA_R3_1 8.068 0.414 0.414 0.067 0.067
## 92 PositiveEmotion =~ PERMA_A3_1 7.678 0.498 0.946 0.416 0.416
## 131 PERMA_A1_1 ~~ PERMA_P1_1 6.748 -0.287 -0.287 -0.052 -0.052
## 77 Acomplishment =~ PERMA_M3_1 6.706 1.049 2.009 0.894 0.894
## 93 PositiveEmotion =~ PERMA_E1_1 6.399 -0.587 -1.116 -0.499 -0.499
## 208 PERMA_P2 ~~ PERMA_M2_1 5.689 0.274 0.274 0.048 0.048
## 99 PositiveEmotion =~ PERMA_M1_1 5.422 0.501 0.952 0.406 0.406
## 204 PERMA_P2 ~~ PERMA_R1_1 5.303 0.354 0.354 0.055 0.055
## 85 Engagement =~ PERMA_R2_1 5.063 -0.779 -1.190 -0.446 -0.446
## 146 PERMA_A2_1 ~~ PERMA_P3_1 4.855 0.312 0.312 0.059 0.059
## 205 PERMA_P2 ~~ PERMA_R2_1 4.679 -0.313 -0.313 -0.048 -0.048
## 209 PERMA_P2 ~~ PERMA_M3_1 4.637 -0.276 -0.276 -0.051 -0.051
## 78 Engagement =~ PERMA_A1_1 4.459 -0.484 -0.740 -0.310 -0.310
## 222 PERMA_R2_1 ~~ PERMA_M1_1 4.332 0.374 0.374 0.060 0.060
## 111 Relationship =~ PERMA_M1_1 4.321 0.327 0.538 0.229 0.229
## 84 Engagement =~ PERMA_R1_1 4.266 0.642 0.981 0.366 0.366
## 215 PERMA_P3_1 ~~ PERMA_M3_1 4.022 0.303 0.303 0.060 0.060
## 164 PERMA_A3_1 ~~ PERMA_M3_1 3.865 0.307 0.307 0.060 0.060
Modification indicies for complet cases
modindices(five.fit1, sort. = TRUE, minimum.value = 3.84)
## lhs op rhs mi epc sepc.lv sepc.all sepc.nox
## 71 Acomplishment =~ PERMA_P3_1 38.164 0.891 1.670 0.830 0.830
## 195 PERMA_P1_1 ~~ PERMA_P2 26.776 0.848 0.848 0.172 0.172
## 122 Meaning =~ PERMA_P3_1 25.651 0.849 1.682 0.836 0.836
## 77 Acomplishment =~ PERMA_M3_1 23.908 1.781 3.338 1.490 1.490
## 80 Engagement =~ PERMA_A3_1 23.300 1.074 1.677 0.797 0.797
## 217 PERMA_R1_1 ~~ PERMA_R3_1 22.743 -1.002 -1.002 -0.171 -0.171
## 92 PositiveEmotion =~ PERMA_A3_1 19.581 0.630 1.267 0.602 0.602
## 93 PositiveEmotion =~ PERMA_E1_1 18.637 -0.844 -1.697 -0.830 -0.830
## 101 PositiveEmotion =~ PERMA_M3_1 17.755 -0.662 -1.330 -0.594 -0.594
## 90 PositiveEmotion =~ PERMA_A1_1 16.473 -0.592 -1.189 -0.537 -0.537
## 83 Engagement =~ PERMA_P3_1 16.016 0.873 1.363 0.677 0.677
## 162 PERMA_A3_1 ~~ PERMA_M1_1 15.569 -0.536 -0.536 -0.109 -0.109
## 110 Relationship =~ PERMA_P3_1 13.667 0.719 1.360 0.676 0.676
## 85 Engagement =~ PERMA_R2_1 13.227 -0.988 -1.542 -0.630 -0.630
## 181 PERMA_E2_1 ~~ PERMA_R2_1 12.431 -0.451 -0.451 -0.087 -0.087
## 203 PERMA_P2 ~~ PERMA_P3_1 12.240 -0.370 -0.370 -0.083 -0.083
## 94 PositiveEmotion =~ PERMA_E2_1 11.497 0.809 1.626 0.765 0.765
## 141 PERMA_A2_1 ~~ PERMA_E1_1 10.577 0.402 0.402 0.091 0.091
## 142 PERMA_A2_1 ~~ PERMA_E2_1 10.371 -0.346 -0.346 -0.075 -0.075
## 102 Relationship =~ PERMA_A1_1 9.412 -0.435 -0.823 -0.372 -0.372
## 190 PERMA_E3_1 ~~ PERMA_R2_1 9.260 0.576 0.576 0.101 0.101
## 76 Acomplishment =~ PERMA_M2_1 8.693 -1.051 -1.971 -0.845 -0.845
## 69 Acomplishment =~ PERMA_P1_1 8.585 -0.412 -0.773 -0.348 -0.348
## 120 Meaning =~ PERMA_P1_1 8.301 -0.435 -0.861 -0.388 -0.388
## 202 PERMA_P1_1 ~~ PERMA_M3_1 8.275 -0.275 -0.275 -0.055 -0.055
## 78 Engagement =~ PERMA_A1_1 8.239 -0.644 -1.005 -0.454 -0.454
## 215 PERMA_P3_1 ~~ PERMA_M3_1 8.134 0.382 0.382 0.085 0.085
## 130 PERMA_A1_1 ~~ PERMA_E3_1 7.726 -0.426 -0.426 -0.082 -0.082
## 126 PERMA_A1_1 ~~ PERMA_A2_1 7.670 0.441 0.441 0.092 0.092
## 146 PERMA_A2_1 ~~ PERMA_P3_1 7.594 0.367 0.367 0.084 0.084
## 97 PositiveEmotion =~ PERMA_R2_1 7.427 -0.759 -1.526 -0.623 -0.623
## 84 Engagement =~ PERMA_R1_1 7.306 0.722 1.127 0.453 0.453
## 127 PERMA_A1_1 ~~ PERMA_A3_1 7.158 -0.387 -0.387 -0.083 -0.083
## 132 PERMA_A1_1 ~~ PERMA_P2 7.037 -0.229 -0.229 -0.047 -0.047
## 147 PERMA_A2_1 ~~ PERMA_R1_1 7.023 0.408 0.408 0.076 0.076
## 209 PERMA_P2 ~~ PERMA_M3_1 6.736 -0.228 -0.228 -0.046 -0.046
## 216 PERMA_R1_1 ~~ PERMA_R2_1 6.693 0.573 0.573 0.094 0.094
## 208 PERMA_P2 ~~ PERMA_M2_1 6.585 0.200 0.200 0.039 0.039
## 116 Meaning =~ PERMA_A3_1 6.567 1.037 2.054 0.976 0.976
## 73 Acomplishment =~ PERMA_R2_1 6.429 -0.450 -0.843 -0.344 -0.344
## 111 Relationship =~ PERMA_M1_1 6.424 0.336 0.635 0.272 0.272
## 109 Relationship =~ PERMA_P2 6.317 -0.431 -0.815 -0.366 -0.366
## 168 PERMA_E1_1 ~~ PERMA_P2 6.243 -0.228 -0.228 -0.050 -0.050
## 166 PERMA_E1_1 ~~ PERMA_E3_1 6.222 0.423 0.423 0.089 0.089
## 104 Relationship =~ PERMA_A3_1 6.022 0.350 0.662 0.315 0.315
## 178 PERMA_E2_1 ~~ PERMA_P2 5.878 0.197 0.197 0.042 0.042
## 124 Meaning =~ PERMA_R2_1 5.842 -0.425 -0.842 -0.344 -0.344
## 222 PERMA_R2_1 ~~ PERMA_M1_1 5.718 0.339 0.339 0.059 0.059
## 212 PERMA_P3_1 ~~ PERMA_R3_1 5.591 0.382 0.382 0.081 0.081
## 174 PERMA_E1_1 ~~ PERMA_M2_1 5.320 -0.241 -0.241 -0.051 -0.051
## 98 PositiveEmotion =~ PERMA_R3_1 5.107 0.579 1.165 0.495 0.495
## 133 PERMA_A1_1 ~~ PERMA_P3_1 5.025 0.290 0.290 0.065 0.065
## 164 PERMA_A3_1 ~~ PERMA_M3_1 4.732 0.295 0.295 0.063 0.063
## 156 PERMA_A3_1 ~~ PERMA_P1_1 4.645 0.231 0.231 0.050 0.050
## 99 PositiveEmotion =~ PERMA_M1_1 4.582 0.344 0.691 0.296 0.296
## 221 PERMA_R2_1 ~~ PERMA_R3_1 4.142 0.432 0.432 0.075 0.075
## 143 PERMA_A2_1 ~~ PERMA_E3_1 4.065 -0.317 -0.317 -0.063 -0.063
## 219 PERMA_R1_1 ~~ PERMA_M2_1 4.058 -0.263 -0.263 -0.045 -0.045
## 169 PERMA_E1_1 ~~ PERMA_P3_1 3.955 0.278 0.278 0.068 0.068
Fit Measures for all data
fitmeasures(five.fit)
## npar fmin chisq
## 55.000 0.254 241.641
## df pvalue baseline.chisq
## 80.000 0.000 3624.205
## baseline.df baseline.pvalue cfi
## 105.000 0.000 0.954
## tli nnfi rfi
## 0.940 0.940 0.912
## nfi pnfi ifi
## 0.933 0.711 0.954
## rni logl unrestricted.logl
## 0.954 -13049.462 -12928.642
## aic bic ntotal
## 26208.925 26438.023 476.000
## bic2 rmsea rmsea.ci.lower
## 26263.461 0.065 0.056
## rmsea.ci.upper rmsea.pvalue rmr
## 0.075 0.004 0.211
## rmr_nomean srmr srmr_bentler
## 0.224 0.037 0.037
## srmr_bentler_nomean srmr_bollen srmr_bollen_nomean
## 0.039 0.038 0.039
## srmr_mplus srmr_mplus_nomean cn_05
## 0.038 0.040 201.689
## cn_01 gfi agfi
## 222.273 0.980 0.967
## pgfi mfi ecvi
## 0.581 0.844 NA
Fit Measures for complate cases
fitmeasures(five.fit1)
## npar fmin chisq
## 55.000 0.589 281.723
## df pvalue baseline.chisq
## 80.000 0.000 3114.805
## baseline.df baseline.pvalue cfi
## 105.000 0.000 0.933
## tli nnfi rfi
## 0.912 0.912 0.881
## nfi pnfi ifi
## 0.910 0.693 0.934
## rni logl unrestricted.logl
## 0.933 -6559.524 -6418.662
## aic bic ntotal
## 13229.048 13420.254 239.000
## bic2 rmsea rmsea.ci.lower
## 13245.919 0.103 0.090
## rmsea.ci.upper rmsea.pvalue rmr
## 0.116 0.000 0.214
## rmr_nomean srmr srmr_bentler
## 0.227 0.045 0.045
## srmr_bentler_nomean srmr_bollen srmr_bollen_nomean
## 0.047 0.045 0.047
## srmr_mplus srmr_mplus_nomean cn_05
## 0.045 0.047 87.430
## cn_01 gfi agfi
## 96.294 0.965 0.941
## pgfi mfi ecvi
## 0.572 0.656 NA
Create dataset for Target rotation for all data
PermaTR<-select(data, PERMA_P1_1, PERMA_P2, PERMA_P3_1, PERMA_E1_1, PERMA_E2_1, PERMA_E3_1, PERMA_R1_1, PERMA_R2_1, PERMA_R3_1, PERMA_M1_1, PERMA_M2_1, PERMA_M3_1, PERMA_A1_1, PERMA_A2_1, PERMA_A3_1)
colnames(PermaTR) <- c("1","2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15")
PermaTR<-tbl_df(PermaTR)
PermaTR
## Source: local data frame [753 x 15]
##
## 1 2 3 4 5 6 7 8 9 10 11 12
## (int) (int) (int) (int) (int) (int) (int) (int) (int) (int) (int) (int)
## 1 7 7 8 8 7 7 9 11 8 NA NA NA
## 2 9 9 9 7 11 7 11 11 11 NA NA NA
## 3 2 3 5 3 3 5 2 3 2 NA NA NA
## 4 7 7 7 9 6 11 8 7 7 NA NA NA
## 5 8 4 9 6 7 8 7 11 7 NA NA NA
## 6 7 7 8 6 6 6 6 9 7 NA NA NA
## 7 9 7 9 5 8 9 8 11 11 NA NA NA
## 8 11 9 8 8 9 8 5 9 7 NA NA NA
## 9 5 5 5 5 7 7 5 7 5 NA NA NA
## 10 9 9 8 9 9 9 11 8 9 NA NA NA
## .. ... ... ... ... ... ... ... ... ... ... ... ...
## Variables not shown: 13 (int), 14 (int), 15 (int)
Target Rotation for all 753 cases
Targ_key <- make.keys(15,list(f1=1:3,f2=4:6, f3=7:9, f4=10:12, f5=13:15))
fix the 0s, allow the NAs to be estimated
Targ_key <- scrub(Targ_key,isvalue=1)
Targ_key <- list(Targ_key)
convert the raw data to correlation matrix uisng FIML
Perma_cor <- corFiml(PermaTR)
TargetT for orthogonal rotation
out_targetQ <- fa(Perma_cor,5,rotate="TargetQ", n.obs = 753, Target=Targ_key)
out_targetQ[c("loadings", "score.cor", "TLI", "RMSEA","uniquenesses")]
## $loadings
##
## Loadings:
## MR4 MR1 MR3 MR5 MR2
## 1 0.562 0.284
## 2 0.273 0.692 0.164
## 3 0.156 0.376 0.233
## 4 0.110 0.266 0.242 0.270
## 5 0.158 0.282 0.148 0.256 0.109
## 6 0.211 0.171 0.183
## 7 0.149 0.210 0.309
## 8 0.122 0.532 0.152
## 9 0.636
## 10 0.730 0.200 0.143 -0.189 0.150
## 11 0.553 0.393 0.291 -0.228
## 12 0.541 -0.116 0.412 0.195
## 13 0.540 0.190 0.252
## 14 0.310 0.110 0.363
## 15 0.174 0.600 0.225
##
## MR4 MR1 MR3 MR5 MR2
## SS loadings 1.673 1.208 1.152 1.042 0.439
## Proportion Var 0.112 0.081 0.077 0.069 0.029
## Cumulative Var 0.112 0.192 0.269 0.338 0.368
##
## $score.cor
## [,1] [,2] [,3] [,4]
## [1,] 1.0000000 0.8029568 0.7305003 0.7329355
## [2,] 0.8029568 1.0000000 0.7526710 0.6715957
## [3,] 0.7305003 0.7526710 1.0000000 0.6489682
## [4,] 0.7329355 0.6715957 0.6489682 1.0000000
##
## $TLI
## [1] 0.938391
##
## $RMSEA
## RMSEA lower upper confidence
## 0.07476504 0.06429075 0.08433872 0.10000000
##
## $uniquenesses
## 1 2 3 4 5 6
## 0.29643745 0.16154343 0.50264371 0.54050145 0.43614911 0.74615626
## 7 8 9 10 11 12
## 0.63053448 0.47743054 0.48216741 0.15103282 0.04644654 0.21215728
## 13 14 15
## 0.31823162 0.49402829 0.41539892
out_targetQ
## Factor Analysis using method = minres
## Call: fa(r = Perma_cor, nfactors = 5, n.obs = 753, rotate = "TargetQ",
## Target = Targ_key)
## Standardized loadings (pattern matrix) based upon correlation matrix
## MR4 MR1 MR3 MR5 MR2 h2 u2 com
## 1 0.06 0.56 0.28 0.04 0.03 0.70 0.296 1.5
## 2 0.27 0.69 -0.08 0.02 0.16 0.84 0.162 1.5
## 3 0.16 0.04 0.38 0.23 0.05 0.50 0.503 2.1
## 4 -0.03 0.11 0.27 0.24 0.27 0.46 0.541 3.3
## 5 0.16 0.28 0.15 0.26 0.11 0.56 0.436 3.5
## 6 -0.02 0.21 0.17 0.09 0.18 0.25 0.746 3.3
## 7 0.07 0.15 0.21 0.04 0.31 0.37 0.631 2.4
## 8 0.12 0.06 0.53 -0.03 0.15 0.52 0.477 1.3
## 9 -0.06 0.09 0.64 0.07 0.03 0.52 0.482 1.1
## 10 0.73 0.20 0.14 -0.19 0.15 0.85 0.151 1.5
## 11 0.55 0.39 0.01 0.29 -0.23 0.95 0.046 2.8
## 12 0.54 -0.12 0.01 0.41 0.20 0.79 0.212 2.3
## 13 0.54 -0.05 0.19 0.25 0.02 0.68 0.318 1.7
## 14 0.31 -0.01 0.11 0.36 0.09 0.51 0.494 2.3
## 15 -0.06 0.17 -0.03 0.60 0.22 0.58 0.415 1.5
##
## MR4 MR1 MR3 MR5 MR2
## SS loadings 2.58 1.96 1.91 1.77 0.87
## Proportion Var 0.17 0.13 0.13 0.12 0.06
## Cumulative Var 0.17 0.30 0.43 0.55 0.61
## Proportion Explained 0.28 0.22 0.21 0.19 0.10
## Cumulative Proportion 0.28 0.50 0.71 0.90 1.00
##
## With factor correlations of
## MR4 MR1 MR3 MR5 MR2
## MR4 1.00 0.57 0.59 0.59 0.37
## MR1 0.57 1.00 0.59 0.50 0.35
## MR3 0.59 0.59 1.00 0.54 0.49
## MR5 0.59 0.50 0.54 1.00 0.37
## MR2 0.37 0.35 0.49 0.37 1.00
##
## Mean item complexity = 2.1
## Test of the hypothesis that 5 factors are sufficient.
##
## The degrees of freedom for the null model are 105 and the objective function was 9.64 with Chi Square of 7193.1
## The degrees of freedom for the model are 40 and the objective function was 0.28
##
## The root mean square of the residuals (RMSR) is 0.02
## The df corrected root mean square of the residuals is 0.04
##
## The harmonic number of observations is 753 with the empirical chi square 89.85 with prob < 1.1e-05
## The total number of observations was 753 with MLE Chi Square = 205.6 with prob < 3.8e-24
##
## Tucker Lewis Index of factoring reliability = 0.938
## RMSEA index = 0.075 and the 90 % confidence intervals are 0.064 0.084
## BIC = -59.36
## Fit based upon off diagonal values = 1
## Measures of factor score adequacy
## MR4 MR1 MR3 MR5 MR2
## Correlation of scores with factors 0.95 0.93 0.88 0.90 0.84
## Multiple R square of scores with factors 0.90 0.86 0.78 0.81 0.70
## Minimum correlation of possible factor scores 0.80 0.72 0.56 0.62 0.41
CFI
1-((out_targetQ$STATISTIC - out_targetQ$dof)/(out_targetQ$null.chisq- out_targetQ$null.dof))
## [1] 0.9766363
Complete 239 cases
PermaTR<-select(data1, PERMA_P1_1, PERMA_P2, PERMA_P3_1, PERMA_E1_1, PERMA_E2_1, PERMA_E3_1, PERMA_R1_1, PERMA_R2_1, PERMA_R3_1, PERMA_M1_1, PERMA_M2_1, PERMA_M3_1, PERMA_A1_1, PERMA_A2_1, PERMA_A3_1)
colnames(PermaTR) <- c("1","2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15")
PermaTR<-tbl_df(PermaTR)
PermaTR
## Source: local data frame [239 x 15]
##
## 1 2 3 4 5 6 7 8 9 10 11 12
## (int) (int) (int) (int) (int) (int) (int) (int) (int) (int) (int) (int)
## 1 11 11 11 9 11 11 11 11 11 7 11 11
## 2 11 11 11 11 11 11 11 11 11 11 11 11
## 3 11 11 11 11 11 11 11 11 11 11 11 11
## 4 6 8 10 11 10 11 9 8 9 8 8 9
## 5 11 11 11 11 11 11 11 11 11 11 11 11
## 6 2 6 6 6 6 4 3 1 5 6 6 4
## 7 6 5 6 6 5 6 6 5 6 6 5 6
## 8 7 5 5 10 7 7 4 8 8 6 7 9
## 9 10 9 3 10 9 11 9 11 11 10 10 11
## 10 8 8 8 8 8 8 8 8 8 8 8 8
## .. ... ... ... ... ... ... ... ... ... ... ... ...
## Variables not shown: 13 (int), 14 (int), 15 (int)
Targ_key <- make.keys(15,list(f1=1:3,f2=4:6, f3=7:9, f4=10:12, f5=13:15))
fix the 0s, allow the NAs to be estimated
Targ_key <- scrub(Targ_key,isvalue=1)
Targ_key <- list(Targ_key)
convert the raw data to correlation matrix uisng FIML
Perma_cor <- corFiml(PermaTR)
TargetT for orthogonal rotation
out_targetQ <- fa(Perma_cor,5,rotate="TargetQ", n.obs = 239, Target=Targ_key)
## Warning in fac(r = r, nfactors = nfactors, n.obs = n.obs, rotate =
## rotate, : A Heywood case was detected. Examine the loadings carefully.
out_targetQ[c("loadings", "score.cor", "TLI", "RMSEA","uniquenesses")]
## $loadings
##
## Loadings:
## MR3 MR2 MR4 MR1 MR5
## 1 0.210 0.105 0.622
## 2 0.120 0.127 0.252 0.599
## 3 0.190 0.176 0.478
## 4 0.864 -0.124 0.162
## 5 0.510 0.163 0.286
## 6 0.117 0.688 -0.204
## 7 0.441 0.203
## 8 1.135 -0.131
## 9 0.498 0.317 0.190
## 10 0.122 0.652 0.112
## 11 0.562 0.283 0.156
## 12 0.103 0.169 0.485 0.288
## 13 0.473 0.427
## 14 0.160 0.192 0.485
## 15 0.350 0.277 0.251
##
## MR3 MR2 MR4 MR1 MR5
## SS loadings 1.899 1.732 1.349 1.178 0.953
## Proportion Var 0.127 0.115 0.090 0.079 0.064
## Cumulative Var 0.127 0.242 0.332 0.411 0.474
##
## $score.cor
## [,1] [,2] [,3] [,4] [,5]
## [1,] 1.0000000 0.7290056 0.7322217 0.7833113 0.7059846
## [2,] 0.7290056 1.0000000 0.7826899 0.7887300 0.7206277
## [3,] 0.7322217 0.7826899 1.0000000 0.7939168 0.7958536
## [4,] 0.7833113 0.7887300 0.7939168 1.0000000 0.7002563
## [5,] 0.7059846 0.7206277 0.7958536 0.7002563 1.0000000
##
## $TLI
## [1] 0.9569872
##
## $RMSEA
## RMSEA lower upper confidence
## 0.07293242 0.05008028 0.09036081 0.10000000
##
## $uniquenesses
## 1 2 3 4 5 6
## 0.160201953 0.100513043 0.418994610 0.267126654 0.236125486 0.461300545
## 7 8 9 10 11 12
## 0.445043140 0.004998883 0.400064274 0.234361576 0.173689243 0.279397797
## 13 14 15
## 0.239658222 0.281750782 0.427846134
out_targetQ
## Factor Analysis using method = minres
## Call: fa(r = Perma_cor, nfactors = 5, n.obs = 239, rotate = "TargetQ",
## Target = Targ_key)
##
## Warning: A Heywood case was detected.
## Standardized loadings (pattern matrix) based upon correlation matrix
## MR3 MR2 MR4 MR1 MR5 h2 u2 com
## 1 0.21 0.09 0.10 0.62 0.00 0.84 0.160 1.3
## 2 0.12 0.13 0.25 0.60 -0.04 0.90 0.101 1.6
## 3 0.19 0.08 0.00 0.18 0.48 0.58 0.419 1.7
## 4 0.01 0.86 -0.06 -0.12 0.16 0.73 0.267 1.1
## 5 -0.04 0.51 0.16 0.29 0.07 0.76 0.236 1.9
## 6 0.12 0.69 0.07 0.01 -0.20 0.54 0.461 1.3
## 7 0.44 0.20 0.02 0.10 0.09 0.55 0.445 1.6
## 8 1.13 -0.04 0.00 -0.10 -0.13 1.00 0.005 1.0
## 9 0.50 -0.06 -0.03 0.32 0.19 0.60 0.400 2.1
## 10 0.12 0.07 0.65 0.11 0.01 0.77 0.234 1.2
## 11 -0.01 0.06 0.56 0.28 0.16 0.83 0.174 1.7
## 12 0.10 0.17 0.48 -0.07 0.29 0.72 0.279 2.1
## 13 0.08 0.07 0.47 -0.05 0.43 0.76 0.240 2.1
## 14 0.16 0.10 0.19 0.09 0.48 0.72 0.282 1.7
## 15 0.04 0.35 -0.02 0.28 0.25 0.57 0.428 2.8
##
## MR3 MR2 MR4 MR1 MR5
## SS loadings 2.50 2.48 2.29 1.99 1.61
## Proportion Var 0.17 0.17 0.15 0.13 0.11
## Cumulative Var 0.17 0.33 0.49 0.62 0.72
## Proportion Explained 0.23 0.23 0.21 0.18 0.15
## Cumulative Proportion 0.23 0.46 0.67 0.85 1.00
##
## With factor correlations of
## MR3 MR2 MR4 MR1 MR5
## MR3 1.00 0.72 0.67 0.62 0.45
## MR2 0.72 1.00 0.68 0.66 0.57
## MR4 0.67 0.68 1.00 0.62 0.56
## MR1 0.62 0.66 0.62 1.00 0.41
## MR5 0.45 0.57 0.56 0.41 1.00
##
## Mean item complexity = 1.7
## Test of the hypothesis that 5 factors are sufficient.
##
## The degrees of freedom for the null model are 105 and the objective function was 13.03 with Chi Square of 3025.76
## The degrees of freedom for the model are 40 and the objective function was 0.38
##
## The root mean square of the residuals (RMSR) is 0.02
## The df corrected root mean square of the residuals is 0.03
##
## The harmonic number of observations is 239 with the empirical chi square 18.24 with prob < 1
## The total number of observations was 239 with MLE Chi Square = 87.15 with prob < 2.4e-05
##
## Tucker Lewis Index of factoring reliability = 0.957
## RMSEA index = 0.073 and the 90 % confidence intervals are 0.05 0.09
## BIC = -131.91
## Fit based upon off diagonal values = 1
## Measures of factor score adequacy
## MR3 MR2 MR4 MR1 MR5
## Correlation of scores with factors 1.00 0.94 0.93 0.94 0.89
## Multiple R square of scores with factors 0.99 0.88 0.87 0.89 0.79
## Minimum correlation of possible factor scores 0.99 0.76 0.74 0.78 0.57
CFI
1-((out_targetQ$STATISTIC - out_targetQ$dof)/(out_targetQ$null.chisq- out_targetQ$null.dof))
## [1] 0.9838579