The common factor model is often used in psychological research to model a correlation or covariance matrix in terms of a small number of latent factors. For instance, a \(p \times p\) correlation matrix, \(\Omega\), can be represented as
\[ \Omega = \Lambda \Phi \Lambda^\prime + \Psi^2, \]
where \(\Lambda\) is a \(p \times m\) matrix of factor-pattern coefficients, \(\Phi\) is a \(m \times m\) matrix of correlations between latent factors, and \(\Psi\) is a \(p \times p\) diagonal matrix of unique factor-pattern coefficients.
Though this model is often useful, it is implausible that a simple common factor model will perfectly fit a population correlation matrix for any set of real variables. Therefore, population correlation matrices that have a degree of misfit with the model-implied correlation matrix are more representative of empirical data. A few methods have been proposed to generate population correlation matrices with model error (i.e., that do not perfectly fit a particular factor model). Though these methods differ, they all involve finding a symmetric, positive semidefinite population correlation matrix, \(\Sigma\), such that
\[ \Sigma - \Omega = \mathbf{E} \] where \(\mathbf{E}\) is a non-null error matrix.
The noisemaker package includes functions that allow users to generate population correlation matrices with user-specified fit statistics, given a particular factor model. This vignette will demonstrate how to generate \(\Sigma\) matrices with user-specified root-mean-square error of approximation (RMSEA) and/or comparative fit index (CFI) values using (a) the Tucker, Koopman, and Linn (1969) method, (b) the Cudeck and Browne (1996) method, and (c) the Wu and Browne (2015) method. In the following sections, I will give examples and further details regarding how to generate population correlation matrices with model error using each of these methods.
For the purposes of this example, we will use a factor model with three latent factors and nine items. We can create this model using the fungible::simFA()
function.
# Specify the factor model
Lambda <- matrix(c(.5, .5, .5, 0, 0, 0, 0, 0, 0,
0, 0, 0, .6, .6, .6, 0, 0, 0,
0, 0, 0, 0, 0, 0, .7, .7, .7),
ncol = 3, byrow = FALSE)
Phi <- matrix(c( 1, .3, .3,
.3, 1, .3,
.3, .3, 1),
ncol = 3, byrow = TRUE)
mod <- fungible::simFA(
Model = list(NFac = 3,
NItemPerFac = 3,
Model = "oblique"),
Loadings = list(FacPattern = Lambda),
Phi = list(PhiType = "user",
UserPhi = Phi),
Seed = 42
)
Let’s take a quick look at the factor-pattern and factor correlation matrices:
# factor-pattern matrix
mod$loadings
#> F1 F2 F3
#> V1 0.5 0.0 0.0
#> V2 0.5 0.0 0.0
#> V3 0.5 0.0 0.0
#> V4 0.0 0.6 0.0
#> V5 0.0 0.6 0.0
#> V6 0.0 0.6 0.0
#> V7 0.0 0.0 0.7
#> V8 0.0 0.0 0.7
#> V9 0.0 0.0 0.7
# factor correlation matrix
mod$Phi
#> F1 F2 F3
#> F1 1.0 0.3 0.3
#> F2 0.3 1.0 0.3
#> F3 0.3 0.3 1.0
The model-implied correlation matrix corresponding to this model is:
mod$Rpop
#> V1 V2 V3 V4 V5 V6 V7 V8 V9
#> V1 1.000 0.250 0.250 0.090 0.090 0.090 0.105 0.105 0.105
#> V2 0.250 1.000 0.250 0.090 0.090 0.090 0.105 0.105 0.105
#> V3 0.250 0.250 1.000 0.090 0.090 0.090 0.105 0.105 0.105
#> V4 0.090 0.090 0.090 1.000 0.360 0.360 0.126 0.126 0.126
#> V5 0.090 0.090 0.090 0.360 1.000 0.360 0.126 0.126 0.126
#> V6 0.090 0.090 0.090 0.360 0.360 1.000 0.126 0.126 0.126
#> V7 0.105 0.105 0.105 0.126 0.126 0.126 1.000 0.490 0.490
#> V8 0.105 0.105 0.105 0.126 0.126 0.126 0.490 1.000 0.490
#> V9 0.105 0.105 0.105 0.126 0.126 0.126 0.490 0.490 1.000
In the TKL model error method, the population correlation matrix and the model-implied correlation matrix differ due to the effects of a large number of minor common factors such that \(\Sigma = \Lambda \Phi \Lambda^\prime + \Psi^2 + \mathbf{WW}^\prime\). Here, \(\mathbf{W}\) denotes a \(p \times q\) matrix of factor loadings for \(p\) items and \(q\) minor common factors. The TKL method uses two user-specified parameters, \(\nu_{\textrm{e}}\) and \(\epsilon\), to determine the distribution of the minor factor loadings. In noisemaker()
, these parameters are denoted by v
and eps
. The v
parameter indicates the proportion of the unique variance that was reapportioned to the minor common factors. The eps
parameter indicates how equally the minor factor variance was distributed among the minor factors; values close to zero indicate that all of the minor common factors accounted for roughly the same amount of variance, whereas values close to one indicate that most of the variance in the minor common factors was accounted for by the first two or three minor factors.
Traditionally, practitioners have selected \(\nu_{\textrm{e}}\) and \(\epsilon\) values based primarily on intuition. For instance, a practitioner might think that minor common factors account for 10% of the unique variance and therefor set \(\nu_{\textrm{e}} = 0.1\). Then, \(\epsilon\) is typically set to a value that gives a “reasonable” root-mean-square error of approximation (RMSEA) value. However, this method involves a lot of trial and error and can impractical when a simulation study involves many factor models. Moreover, there are no published guidelines that give an empirical basis for “reasonable” values of \(\nu_{\textrm{e}}\) and \(\epsilon\). The noisemaker()
function makes it much easier to use the TKL method. In particular, the function allows users to select a target RMSEA value, a target comparative fit index (CFI) value, or both, and uses an optimization procedure to select values of \(\nu_{\textrm{e}}\) and \(\epsilon\) such that the solution has RMSEA and/or CFI values that are close to the target values. In the next sections, I will demonstrate how to use the TKL method with the noisemaker()
function.
In this section, we’ll use the model we specified earlier to generate a population correlation matrix with model error using the noisemaker()
function and the TKL method. First, we’ll try to find a \(\Sigma\) matrix such that the resulting RMSEA value is close to 0.05.
set.seed(42)
TKL_m1 <- noisemaker(mod, method = "TKL", target_rmsea = 0.05)
TKL_m1
#> $Sigma
#> V1 V2 V3 V4 V5 V6 V7
#> V1 1.00000000 0.26322783 0.24433333 0.10942514 0.12264138 0.07724166 0.09837750
#> V2 0.26322783 1.00000000 0.22814855 0.09495953 0.06704508 0.05985994 0.12348914
#> V3 0.24433333 0.22814855 1.00000000 0.03026166 0.08481796 0.05248391 0.08681114
#> V4 0.10942514 0.09495953 0.03026166 1.00000000 0.34629961 0.40535572 0.13463467
#> V5 0.12264138 0.06704508 0.08481796 0.34629961 1.00000000 0.36766792 0.10427625
#> V6 0.07724166 0.05985994 0.05248391 0.40535572 0.36766792 1.00000000 0.09114444
#> V7 0.09837750 0.12348914 0.08681114 0.13463467 0.10427625 0.09114444 1.00000000
#> V8 0.08201345 0.09902769 0.12088329 0.09455277 0.12311562 0.08485998 0.50701447
#> V9 0.07552670 0.14381668 0.06647497 0.12727816 0.13348559 0.12363447 0.49567492
#> V8 V9
#> V1 0.08201345 0.07552670
#> V2 0.09902769 0.14381668
#> V3 0.12088329 0.06647497
#> V4 0.09455277 0.12727816
#> V5 0.12311562 0.13348559
#> V6 0.08485998 0.12363447
#> V7 0.50701447 0.49567492
#> V8 1.00000000 0.50363420
#> V9 0.50363420 1.00000000
#>
#> $rmsea
#> [1] 0.04999997
#>
#> $cfi
#> [1] 0.9776875
#>
#> $fn_value
#> [1] 4.590188e-13
#>
#> $m
#> [1] NA
#>
#> $v
#> [1] 0.1443807
#>
#> $eps
#> [1] 0.07344736
#>
#> $W
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 0.15639903 -0.156733186 0.083442969 -0.06289109 -0.0001961925
#> [2,] -0.10139061 -0.004389662 0.005326135 -0.20353669 0.0564781463
#> [3,] 0.13773584 0.119525197 -0.069285020 0.02459620 0.1577030321
#> [4,] -0.05725022 -0.187821042 0.036831595 -0.04919117 -0.1376999572
#> [5,] 0.04334662 -0.031291826 0.017693985 0.16334352 -0.0699192881
#> [6,] -0.04783388 -0.174923716 -0.022579067 0.10115536 -0.0366716733
#> [7,] -0.02420506 0.116099496 0.150689129 -0.10047269 -0.1065191086
#> [8,] 0.06900881 0.158985229 -0.057429214 0.00989021 -0.0698989674
#> [9,] -0.16346522 0.038857716 -0.050672460 -0.05921567 -0.0718299120
#> [,6] [,7] [,8] [,9] [,10]
#> [1,] 0.018009265 0.09674969 0.11452769 0.096790393 -0.059946847
#> [2,] -0.020405339 0.05086141 0.16600210 0.005621225 -0.028494194
#> [3,] 0.092117269 0.02935291 -0.09146668 0.097523764 -0.024524365
#> [4,] 0.089210515 -0.01869189 0.02787963 -0.087422266 -0.007553526
#> [5,] -0.080170347 0.04258549 0.10993882 0.106106953 -0.016534326
#> [6,] 0.006053840 -0.05555294 -0.01832632 -0.059931052 0.152155614
#> [7,] 0.002911743 -0.01535457 -0.01111499 -0.013048529 -0.060618819
#> [8,] -0.049907504 0.08767078 -0.02257847 -0.076151176 -0.026382467
#> [9,] -0.085508583 0.03506413 0.04394179 0.009116942 0.022027495
#> [,11] [,12] [,13] [,14] [,15]
#> [1,] 0.03737874 -0.052663353 0.0433071400 -0.033499393 -2.951808e-02
#> [2,] -0.04753358 0.030665855 -0.0034379673 0.049672343 6.565931e-03
#> [3,] -0.03063414 0.017244491 -0.0804547141 0.001696896 -6.158519e-02
#> [4,] 0.05419508 0.048938137 -0.0511943220 -0.030319185 3.517818e-02
#> [5,] -0.01827361 -0.098181331 -0.0415464190 -0.003444910 -2.249409e-02
#> [6,] 0.06173156 0.006027953 -0.0337155681 0.044257687 1.038553e-02
#> [7,] -0.01180178 0.050815816 -0.0007454487 -0.013716517 1.523419e-03
#> [8,] -0.09289180 0.039539777 0.0339202496 -0.036190548 -1.045254e-05
#> [9,] -0.04962743 -0.045101423 -0.0218150037 0.007104605 7.796847e-02
#> [,16] [,17] [,18] [,19] [,20]
#> [1,] 0.034599927 0.0031427815 0.008187627 0.022841629 0.001176333
#> [2,] -0.046400945 -0.0560737006 -0.021975817 -0.049235314 0.004319074
#> [3,] -0.001545112 -0.0001975428 0.017668190 -0.020894565 0.014675875
#> [4,] -0.002211522 0.0219526152 -0.021735326 0.015754314 -0.009108404
#> [5,] -0.032640406 0.0015537913 0.081676176 0.001495786 0.041524428
#> [6,] -0.052627473 0.0346530234 -0.005403460 0.014084647 0.017639354
#> [7,] -0.017454612 -0.0037557089 -0.011340424 0.054142587 -0.025345547
#> [8,] 0.023613895 -0.0021583678 -0.005743858 -0.026196139 0.040975740
#> [9,] -0.016622215 0.0178446793 0.029565829 -0.067113481 0.035443062
#> [,21] [,22] [,23] [,24] [,25]
#> [1,] 0.009133955 0.004189558 -0.0282046555 -0.007400307 0.009043810
#> [2,] -0.047071520 0.030568057 0.0447411544 0.027274033 -0.004391320
#> [3,] -0.001701355 -0.030183188 0.0275064381 -0.000570558 -0.015292058
#> [4,] 0.022660622 -0.014561311 -0.0004881465 0.004134439 0.019610439
#> [5,] 0.023883853 0.001267154 0.0177410985 -0.022016192 -0.005882766
#> [6,] -0.006629907 -0.032759488 -0.0289749876 -0.020153887 0.024274948
#> [7,] -0.051023275 -0.006711299 -0.0177839617 0.015003296 -0.016735929
#> [8,] 0.001675385 0.022222092 0.0011571922 0.027509297 -0.009440539
#> [9,] 0.015643478 0.024493306 -0.0280534366 0.027085364 -0.005412638
#> [,26] [,27] [,28] [,29] [,30]
#> [1,] 0.023997697 -0.0097225876 0.001797132 0.002649281 -0.006995614
#> [2,] -0.003767837 -0.0029819487 -0.029822488 -0.004765540 0.004719013
#> [3,] -0.027619033 -0.0239481189 0.006165593 0.004323563 0.004672736
#> [4,] 0.005605040 0.0274296583 0.014614463 -0.014959277 -0.002991254
#> [5,] -0.007050200 0.0020028447 0.035462589 -0.015302636 -0.019752586
#> [6,] -0.012380634 -0.0018490557 -0.028046104 0.020492368 0.012254196
#> [7,] -0.013784498 0.0059263181 -0.012750505 0.004144918 0.005271214
#> [8,] 0.008038735 0.0006505652 -0.011371240 0.008754712 -0.011566946
#> [9,] -0.003240071 -0.0022787329 -0.016848592 0.026884466 -0.021882088
#> [,31] [,32] [,33] [,34] [,35]
#> [1,] -1.936473e-02 -0.003729630 -4.457020e-03 0.0098278413 -0.0009595175
#> [2,] 2.002950e-02 0.006481187 -1.260294e-02 -0.0045359823 0.0104984707
#> [3,] 1.270671e-02 0.019501570 -9.791387e-05 -0.0050628633 -0.0050869423
#> [4,] -1.496401e-03 -0.009128524 -6.818660e-03 0.0055013989 -0.0003837982
#> [5,] -1.984637e-02 0.005769767 -6.273054e-03 -0.0115089678 -0.0008692226
#> [6,] 1.041860e-02 0.001274560 1.791179e-02 -0.0005245429 -0.0106005624
#> [7,] 4.258320e-03 0.007312811 -1.328000e-03 -0.0108765578 -0.0028883429
#> [8,] -8.144823e-05 -0.002728363 -1.179153e-02 0.0118978239 -0.0002781080
#> [9,] 1.925735e-03 0.009856170 1.781513e-03 -0.0027676378 -0.0038784077
#> [,36] [,37] [,38] [,39] [,40]
#> [1,] -1.534294e-02 -9.563940e-03 0.0007752232 0.0072392463 -0.0026594913
#> [2,] -9.915615e-03 1.029615e-03 -0.0001744046 0.0067281563 0.0038806057
#> [3,] 1.801288e-03 -1.388643e-02 0.0009309692 -0.0080071980 0.0102877645
#> [4,] 3.847019e-03 -9.233840e-03 -0.0028244747 0.0099653302 -0.0055485323
#> [5,] -4.609990e-03 1.080702e-03 -0.0040487313 -0.0049607773 -0.0059338980
#> [6,] 6.957988e-07 -1.021765e-02 -0.0157789750 0.0009286727 -0.0092293180
#> [7,] 6.757786e-03 -1.016324e-05 -0.0019753777 -0.0020214051 -0.0064724205
#> [8,] 1.260064e-02 -3.472564e-03 -0.0038515467 -0.0008517040 0.0005158809
#> [9,] -9.526042e-03 -4.937043e-03 0.0201404351 0.0012997944 0.0041801348
#> [,41] [,42] [,43] [,44] [,45]
#> [1,] 0.0004576705 -0.004571982 -0.0032311127 0.0011383825 -0.0030946733
#> [2,] -0.0006684013 -0.002780715 0.0061823784 0.0029873644 0.0058843904
#> [3,] -0.0081837704 0.003688698 0.0019756619 0.0004896380 -0.0021788962
#> [4,] 0.0028324739 0.003294193 0.0041263488 -0.0110191166 0.0022364941
#> [5,] -0.0013869193 0.002744620 0.0050487455 0.0014473995 0.0015154692
#> [6,] -0.0013809148 -0.006201371 0.0046762273 -0.0022072295 -0.0043651662
#> [7,] 0.0038358416 -0.004187879 -0.0036803733 0.0006055371 0.0047728673
#> [8,] 0.0049110710 0.008376242 -0.0004627064 0.0027658334 0.0028317026
#> [9,] 0.0082544257 0.001416997 0.0031739540 0.0066018858 0.0003922633
#> [,46] [,47] [,48] [,49] [,50]
#> [1,] -0.0030070175 0.001506515 0.0040050227 0.0036680140 -0.0014707889
#> [2,] -0.0091148296 -0.002238827 -0.0009938960 0.0068672531 0.0010104494
#> [3,] 0.0001690282 0.001974654 -0.0071558185 -0.0051695053 0.0021825783
#> [4,] 0.0006510757 0.002064078 -0.0004664736 -0.0007008947 0.0009417102
#> [5,] -0.0015748467 0.004183271 0.0045484386 -0.0004625643 -0.0003411601
#> [6,] 0.0039120713 -0.002911246 0.0083953304 0.0026102228 0.0057482932
#> [7,] -0.0020395125 0.001313080 -0.0010371714 -0.0006345759 -0.0001957992
#> [8,] -0.0055840602 -0.006492581 -0.0009013700 -0.0086235803 0.0060711018
#> [9,] 0.0017525368 -0.002943081 -0.0061290688 -0.0078604071 -0.0001871576
Taking a look at the output, the first element is the population correlation matrix with model error \(\Sigma\) that was generated. Next, the output tells us the RMSEA value, which is quite close to the target value of 0.05. The other elements of the output are the CFI value and the values of the two TKL parameters.
In addition to allowing us to optimize the TKL parameters to get a \(\Sigma\) matrix with an RMSEA value close to a target value, the noisemaker()
function also allows us to optimize for target RMSEA and CFI values simultaneously. The only change that is needed is to specify the desired CFI value in the target_cfi
argument.
TKL_m2 <- noisemaker(mod, method = "TKL",
target_rmsea = 0.05,
target_cfi = 0.95)
TKL_m2
#> $Sigma
#> V1 V2 V3 V4 V5 V6 V7
#> V1 1.00000000 0.27575797 0.19822379 0.09510559 0.11918141 0.13648571 0.06593107
#> V2 0.27575797 1.00000000 0.21555228 0.11983550 0.15015489 0.13477260 0.07896463
#> V3 0.19822379 0.21555228 1.00000000 0.09929996 0.05551431 0.05466039 0.13603322
#> V4 0.09510559 0.11983550 0.09929996 1.00000000 0.39291045 0.39490257 0.10923656
#> V5 0.11918141 0.15015489 0.05551431 0.39291045 1.00000000 0.39972347 0.09852409
#> V6 0.13648571 0.13477260 0.05466039 0.39490257 0.39972347 1.00000000 0.08386276
#> V7 0.06593107 0.07896463 0.13603322 0.10923656 0.09852409 0.08386276 1.00000000
#> V8 0.07741947 0.08565074 0.14381509 0.15767918 0.11592692 0.11778973 0.50006199
#> V9 0.13642134 0.10546786 0.06578492 0.09054418 0.12985842 0.13126233 0.47423296
#> V8 V9
#> V1 0.07741947 0.13642134
#> V2 0.08565074 0.10546786
#> V3 0.14381509 0.06578492
#> V4 0.15767918 0.09054418
#> V5 0.11592692 0.12985842
#> V6 0.11778973 0.13126233
#> V7 0.50006199 0.47423296
#> V8 1.00000000 0.46055747
#> V9 0.46055747 1.00000000
#>
#> $rmsea
#> [1] 0.06428585
#>
#> $cfi
#> [1] 0.9629082
#>
#> $fn_value
#> [1] 0.07414146
#>
#> $m
#> [1] NA
#>
#> $v
#> [1] 0.09637677
#>
#> $eps
#> [1] 0.2458103
#>
#> $W
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 0.04880543 0.04958136 0.22194354 -0.074903698 -0.0472175253
#> [2,] 0.21722990 0.02548224 0.09893472 0.108382645 0.0128513399
#> [3,] -0.06954523 0.02443846 -0.21393292 0.026436563 0.0509881265
#> [4,] 0.17714658 0.14635152 -0.07071828 -0.037959179 0.0124732251
#> [5,] 0.23160319 -0.01227951 0.08324507 0.006186048 0.0055485310
#> [6,] 0.12718577 0.14861927 0.14662203 -0.009105048 -0.0005677703
#> [7,] -0.08172069 -0.05470180 -0.14530062 0.014233434 -0.0096632977
#> [8,] 0.02008791 0.07932315 -0.15423271 -0.086942677 0.0919533346
#> [9,] -0.05251526 -0.09433107 0.18059527 -0.042562583 0.0355578539
#> [,6] [,7] [,8] [,9] [,10]
#> [1,] -0.072129957 -0.035238085 -0.0005232212 -1.987970e-02 -0.049869774
#> [2,] 0.024605057 -0.037058762 0.0194871655 -6.041145e-03 -0.013634420
#> [3,] -0.026541884 -0.026849143 -0.1187732177 3.307344e-02 -0.002303978
#> [4,] -0.037526187 0.001265366 -0.0216284889 -1.264110e-02 0.008301717
#> [5,] 0.008728040 -0.019186575 0.0041111952 -1.851498e-02 -0.007910429
#> [6,] -0.010640478 -0.018984656 -0.0066135764 1.325322e-03 0.034230634
#> [7,] 0.070596102 -0.075382641 0.0431021204 -6.261488e-05 -0.066270873
#> [8,] -0.009900022 0.038959236 -0.0290343136 -2.855223e-04 -0.003878093
#> [9,] 0.035083617 0.016115899 0.0121593172 8.461849e-03 -0.002479889
#> [,11] [,12] [,13] [,14] [,15]
#> [1,] -0.005266085 -0.029477884 0.0010957428 -0.0077092898 0.0018022764
#> [2,] -0.004878737 -0.009807642 -0.0019631541 -0.0004840324 0.0053928639
#> [3,] 0.016806177 0.002180758 0.0269009063 -0.0024821844 -0.0079430716
#> [4,] 0.010762323 -0.006409071 0.0012140609 0.0023826680 -0.0005014016
#> [5,] 0.002533416 0.002626712 0.0004646533 -0.0026750066 -0.0016849767
#> [6,] -0.009070860 0.004396394 0.0042576905 -0.0041384467 0.0023619886
#> [7,] 0.032703023 0.003208579 -0.0006673274 0.0064299412 -0.0020096321
#> [8,] 0.012525107 -0.001885392 0.0003436785 -0.0031275167 0.0007179485
#> [9,] 0.001610607 -0.007421699 -0.0043972498 -0.0020410375 0.0008113485
#> [,16] [,17] [,18] [,19] [,20]
#> [1,] 2.514726e-03 -0.0061162748 -0.0027635129 -1.172880e-03 4.485545e-04
#> [2,] -5.031119e-05 -0.0006753950 -0.0026628037 -4.243606e-04 1.209445e-03
#> [3,] -4.928840e-04 0.0008147890 -0.0079242121 1.966433e-03 1.328061e-03
#> [4,] 2.327512e-04 -0.0034473397 0.0007432217 -8.574775e-05 -6.970747e-04
#> [5,] 9.181442e-04 0.0002703336 -0.0003739286 -3.462970e-04 -2.781830e-04
#> [6,] -8.460600e-04 0.0006247976 -0.0003074734 8.172702e-04 -4.735526e-04
#> [7,] -2.385480e-03 0.0046631275 0.0007867109 2.764852e-05 2.187345e-04
#> [8,] -2.617030e-03 0.0003757702 -0.0008026185 -1.189328e-03 -3.863002e-06
#> [9,] -1.683949e-03 0.0002717754 -0.0016081888 1.289533e-03 2.093003e-04
#> [,21] [,22] [,23] [,24] [,25]
#> [1,] -0.0004945175 -9.260440e-04 -1.265844e-03 -1.558895e-04 8.023856e-05
#> [2,] 0.0008805408 -5.400492e-04 -1.061374e-04 -9.811434e-05 5.752448e-07
#> [3,] -0.0005698051 7.167213e-04 1.434635e-04 -5.680431e-04 -6.483359e-04
#> [4,] -0.0003017056 -1.006414e-04 8.207769e-05 -2.547773e-04 1.868907e-04
#> [5,] -0.0003516649 -5.876971e-05 6.725233e-05 7.920359e-05 -5.773960e-05
#> [6,] 0.0001573095 6.243812e-04 -2.724969e-04 -1.655466e-04 1.858360e-04
#> [7,] 0.0017088468 -5.131603e-05 -2.158902e-04 -6.880536e-04 -1.790872e-04
#> [8,] -0.0002627700 -2.989651e-04 -4.233368e-04 -1.608013e-04 -1.373243e-04
#> [9,] 0.0001121746 2.417933e-04 -1.550623e-04 -1.474062e-04 -4.334265e-06
#> [,26] [,27] [,28] [,29] [,30]
#> [1,] 1.778413e-04 2.347520e-04 -1.557311e-04 7.058153e-05 1.115852e-04
#> [2,] 7.659943e-05 6.315539e-06 5.018552e-05 -1.075875e-04 -3.351858e-05
#> [3,] -6.401540e-05 2.021534e-04 2.729236e-04 -2.139276e-04 -9.258990e-05
#> [4,] -1.454917e-04 1.406723e-04 -1.019564e-04 -1.546854e-04 1.985150e-05
#> [5,] 4.748351e-05 1.471606e-05 -2.536207e-05 2.619447e-05 -2.170621e-05
#> [6,] -1.070406e-04 9.484683e-05 -1.941535e-05 1.258115e-05 -1.698304e-05
#> [7,] -3.559294e-04 4.518160e-05 -2.085763e-04 5.638717e-05 7.386220e-05
#> [8,] 1.071473e-04 -2.053315e-04 7.110560e-05 6.526924e-05 -3.341605e-05
#> [9,] -1.290553e-04 1.768690e-06 -3.567789e-05 -1.884846e-06 -6.530356e-05
#> [,31] [,32] [,33] [,34] [,35]
#> [1,] 3.811825e-05 -2.983289e-05 2.969282e-05 -5.625737e-05 -4.566840e-08
#> [2,] -1.652365e-05 2.747420e-05 -1.111240e-05 1.682395e-05 -1.585090e-07
#> [3,] 4.061519e-05 2.391181e-05 -9.796768e-05 -9.575361e-06 4.416032e-06
#> [4,] 1.072871e-05 4.542660e-06 -3.094071e-05 5.281832e-06 5.645408e-06
#> [5,] -4.846542e-06 1.353347e-05 2.499712e-06 7.594368e-06 -7.319305e-07
#> [6,] 1.326696e-05 1.606585e-05 3.604498e-05 1.021559e-05 -2.291663e-06
#> [7,] 3.984786e-05 -3.278515e-05 1.078811e-05 -1.965860e-05 3.598767e-06
#> [8,] -1.013835e-05 1.309916e-05 2.826578e-05 2.948612e-05 -6.165573e-06
#> [9,] 2.994330e-05 -1.718737e-05 1.218524e-05 -1.778427e-05 1.270559e-05
#> [,36] [,37] [,38] [,39] [,40]
#> [1,] 7.898804e-07 -1.749655e-06 8.112162e-06 5.552145e-06 2.451095e-06
#> [2,] -4.052328e-06 -6.544693e-06 4.177074e-07 2.998584e-06 4.167392e-06
#> [3,] -3.807973e-05 -3.278122e-05 -1.955783e-05 2.830773e-06 5.411552e-06
#> [4,] -8.989720e-06 -1.178192e-06 -8.124382e-06 4.555650e-06 -1.437531e-06
#> [5,] 1.777069e-06 3.447941e-06 1.345815e-06 -2.862203e-06 1.153882e-07
#> [6,] -1.015062e-05 9.846090e-06 -2.902428e-07 2.716866e-06 3.096053e-06
#> [7,] 1.774914e-05 3.327470e-08 -5.498419e-06 -1.147088e-05 -8.551173e-06
#> [8,] -1.443799e-05 -6.524016e-07 -1.897317e-06 2.703536e-06 1.126735e-06
#> [9,] -1.206492e-06 4.526724e-06 -2.380331e-06 2.396844e-07 -3.161744e-07
#> [,41] [,42] [,43] [,44] [,45]
#> [1,] 5.842098e-07 -3.273831e-06 -7.303822e-07 -1.884192e-06 -1.306215e-08
#> [2,] -1.468922e-07 -1.035504e-06 1.982907e-06 8.155968e-07 7.570363e-07
#> [3,] -3.771879e-06 1.493417e-06 -1.163451e-07 2.558163e-06 1.582921e-06
#> [4,] 2.364540e-06 -2.488682e-06 1.577194e-06 -3.074966e-07 -1.379445e-09
#> [5,] -1.170213e-06 -1.452335e-06 -2.024973e-07 -5.168662e-07 4.696160e-08
#> [6,] -3.876193e-07 -1.435656e-06 5.839182e-07 -6.400751e-08 -3.953602e-07
#> [7,] -1.436793e-06 -1.083930e-06 5.268732e-07 3.972721e-06 -2.647827e-07
#> [8,] 1.392330e-06 2.444799e-06 4.805783e-06 2.291274e-06 -8.712672e-07
#> [9,] 2.444372e-06 -3.145083e-07 7.962520e-07 -1.122038e-06 -4.757918e-07
#> [,46] [,47] [,48] [,49] [,50]
#> [1,] -1.565497e-07 -1.274493e-06 3.468081e-07 -4.078848e-07 2.972610e-08
#> [2,] -6.387540e-08 -6.021894e-07 -7.767021e-07 -2.394977e-07 -5.723651e-08
#> [3,] -9.404347e-08 -1.446513e-06 1.063658e-07 -1.982664e-08 6.833113e-07
#> [4,] 5.128865e-07 2.433701e-07 -9.425275e-08 2.378659e-07 9.786890e-08
#> [5,] -1.601240e-07 -4.784523e-08 -7.275147e-08 8.382795e-08 2.498779e-07
#> [6,] 2.799474e-07 8.421168e-08 -6.680185e-08 -3.798155e-07 -1.065075e-07
#> [7,] 9.057295e-07 -1.185056e-06 1.804766e-07 -3.028250e-07 2.655671e-07
#> [8,] -7.593228e-07 -2.578932e-07 1.439272e-07 -2.480444e-09 4.333738e-07
#> [9,] 4.499915e-08 1.574189e-07 -4.762097e-08 -2.321293e-07 3.613690e-08
Notice that both the RMSEA and CFI values are slightly off from the target values. Some combinations of RMSEA and CFI are not possible for a particular model. In that case, the function tries its best to find a solution that gives RMSEA and CFI values that are as close as possible to the target values, weighting both indices equally. If we were more concerned about getting an RMSEA value that is close to the target value, we could weight RMSEA more heavily than CFI:
TKL_m3 <- noisemaker(mod, method = "TKL",
target_rmsea = 0.05,
target_cfi = 0.95,
tkl_ctrl = list(weights = c(rmsea = 4, cfi = 1)))
TKL_m3
#> $Sigma
#> V1 V2 V3 V4 V5 V6 V7
#> V1 1.00000000 0.26862122 0.21283413 0.09733115 0.10654562 0.09100907 0.08366247
#> V2 0.26862122 1.00000000 0.25752820 0.06436485 0.07420102 0.08897118 0.04412692
#> V3 0.21283413 0.25752820 1.00000000 0.02318507 0.06619354 0.11130992 0.08515436
#> V4 0.09733115 0.06436485 0.02318507 1.00000000 0.36263633 0.37141847 0.15980380
#> V5 0.10654562 0.07420102 0.06619354 0.36263633 1.00000000 0.31780582 0.13685173
#> V6 0.09100907 0.08897118 0.11130992 0.37141847 0.31780582 1.00000000 0.12827396
#> V7 0.08366247 0.04412692 0.08515436 0.15980380 0.13685173 0.12827396 1.00000000
#> V8 0.14022821 0.12077692 0.06747023 0.15219809 0.13208788 0.10702007 0.46974718
#> V9 0.10844116 0.08428759 0.13028240 0.09432692 0.13009804 0.10196879 0.48822014
#> V8 V9
#> V1 0.14022821 0.10844116
#> V2 0.12077692 0.08428759
#> V3 0.06747023 0.13028240
#> V4 0.15219809 0.09432692
#> V5 0.13208788 0.13009804
#> V6 0.10702007 0.10196879
#> V7 0.46974718 0.48822014
#> V8 1.00000000 0.48005220
#> V9 0.48005220 1.00000000
#>
#> $rmsea
#> [1] 0.05544071
#>
#> $cfi
#> [1] 0.9705813
#>
#> $fn_value
#> [1] 0.04335947
#>
#> $m
#> [1] NA
#>
#> $v
#> [1] 0.1296012
#>
#> $eps
#> [1] 0.09068834
#>
#> $W
#> [,1] [,2] [,3] [,4] [,5] [,6]
#> [1,] -0.23595181 -0.029155007 -0.08674512 -0.03871423 0.11288546 -0.038095844
#> [2,] -0.14039970 0.104730859 0.13027202 -0.02820394 0.08571111 0.110858674
#> [3,] 0.11486134 -0.077179842 0.16369062 0.18112367 0.08009294 0.044521374
#> [4,] -0.04411684 0.008402416 -0.14037857 -0.12828223 -0.13472406 -0.008737743
#> [5,] -0.05820066 0.096457074 -0.13402165 0.08048270 -0.00204900 -0.009727164
#> [6,] -0.01886364 -0.181259227 0.06329557 -0.03055323 -0.03617960 0.060731354
#> [7,] 0.09665133 -0.084241812 -0.10622364 -0.01164678 -0.12641213 -0.018691459
#> [8,] -0.07227898 0.115068684 -0.08415632 -0.06761009 0.07319691 0.006858287
#> [9,] 0.05857065 -0.042131945 -0.04531486 0.10146945 0.10383009 -0.125919418
#> [,7] [,8] [,9] [,10] [,11]
#> [1,] -0.003482851 0.016256508 -0.085239318 -0.044873198 0.04483809
#> [2,] 0.028796411 -0.068769453 0.016326603 -0.015380674 -0.09981646
#> [3,] -0.008958740 -0.002080111 0.001666892 -0.001340965 -0.01380778
#> [4,] 0.038510990 0.106361358 0.065983746 -0.014193196 0.01869868
#> [5,] -0.013567354 -0.083492614 0.019570301 0.064325794 0.10992922
#> [6,] 0.088433549 0.097928582 0.048221272 0.010425047 -0.03078860
#> [7,] 0.012941751 -0.015679939 0.002573587 -0.006042424 0.07888660
#> [8,] 0.057609775 0.112144707 -0.056296013 -0.037693061 -0.02462411
#> [9,] -0.082471960 -0.053327999 0.016659907 -0.067785403 -0.04903484
#> [,12] [,13] [,14] [,15] [,16]
#> [1,] 0.052270347 0.0047652421 0.0172913458 0.010788795 0.020239597
#> [2,] -0.015173485 -0.0262761313 -0.0717450179 0.024137816 0.012902321
#> [3,] 0.001602749 0.0322031402 0.0003137366 -0.010280077 0.036459949
#> [4,] -0.056391068 -0.0444758651 0.0157518388 0.031869800 -0.001498703
#> [5,] -0.019621642 -0.0002593995 0.0554347195 -0.093274884 -0.008415623
#> [6,] 0.080229679 -0.0223533519 -0.0042705173 -0.027544796 0.069690694
#> [7,] -0.019664442 -0.0234853123 0.0624241001 -0.004229122 -0.065715077
#> [8,] -0.060327495 0.0541560164 -0.0120403157 0.006347347 0.013823671
#> [9,] 0.001811795 0.0413780998 -0.0017842727 0.013216860 0.011377649
#> [,17] [,18] [,19] [,20] [,21]
#> [1,] 0.006574365 0.0142513546 -0.015687097 0.004153572 -0.0267560164
#> [2,] 0.013576656 0.0065195926 -0.045470469 0.012075843 -0.0195736988
#> [3,] 0.026955894 0.0410597382 -0.012563655 0.042257113 -0.0121020573
#> [4,] 0.021089254 -0.0180070114 -0.008133418 -0.018890843 0.0105690698
#> [5,] -0.076323753 -0.0350496755 -0.008406716 0.034844980 0.0103866578
#> [6,] 0.048854666 0.0086853028 -0.048182714 0.014274344 0.0002699021
#> [7,] 0.013383474 0.0117646656 0.010714212 -0.034100490 0.0036167020
#> [8,] -0.018340186 -0.0218276283 0.019843725 -0.006698021 -0.0063340830
#> [9,] -0.029967030 0.0008949147 0.017553810 -0.012721574 0.0005556028
#> [,22] [,23] [,24] [,25] [,26]
#> [1,] 0.0032073841 0.025550818 0.006177367 -0.001367755 0.013499145
#> [2,] -0.0324343551 -0.008357889 -0.025952678 -0.001614120 0.020565722
#> [3,] -0.0425800575 -0.003749280 0.016808046 0.002608105 -0.006910275
#> [4,] 0.0091256685 0.013576883 0.005271881 0.016861267 -0.002413011
#> [5,] -0.0195211104 0.011019897 0.015366656 -0.006629253 -0.009160288
#> [6,] 0.0007377195 0.010757180 -0.008698215 -0.010504311 -0.006853833
#> [7,] 0.0324237631 0.043696429 -0.027788578 0.010868877 0.007230498
#> [8,] 0.0069402682 0.003019522 -0.008009728 0.005718466 -0.012285961
#> [9,] -0.0047985308 0.028955210 -0.012532520 0.002963050 -0.002174888
#> [,27] [,28] [,29] [,30] [,31]
#> [1,] 0.003537188 -0.0007890453 0.001685053 -0.0050309638 -0.0008428695
#> [2,] 0.014444936 0.0075454041 0.004263813 -0.0041346853 -0.0192121473
#> [3,] 0.001778350 0.0044941310 0.012428052 -0.0083995696 -0.0105604921
#> [4,] -0.009964094 -0.0008396966 0.002348205 -0.0091145189 -0.0051178256
#> [5,] 0.009746281 -0.0094594537 -0.001390487 0.0087220748 0.0035393640
#> [6,] -0.007962511 0.0112009332 0.023512699 -0.0108237766 -0.0021278339
#> [7,] 0.005980151 0.0094508494 -0.006098991 0.0006228215 -0.0047644099
#> [8,] 0.020797073 -0.0081857971 -0.010308318 -0.0053089752 -0.0071784990
#> [9,] -0.014742547 0.0064889225 -0.004597424 -0.0082689747 0.0010918260
#> [,32] [,33] [,34] [,35] [,36]
#> [1,] -0.008490014 -0.0046871200 1.610778e-03 -0.004047376 3.033316e-04
#> [2,] 0.004724829 0.0117836175 1.609484e-03 -0.005814272 1.542606e-03
#> [3,] -0.004413048 -0.0022454101 2.575943e-03 -0.007005635 3.502420e-04
#> [4,] 0.007859258 -0.0003207657 2.171585e-05 -0.010717622 -1.962025e-03
#> [5,] 0.001999805 0.0005566635 3.864229e-03 0.003798089 -6.720897e-04
#> [6,] -0.005358123 -0.0027685614 2.421547e-03 0.003371046 7.524260e-03
#> [7,] 0.001182795 -0.0163754685 3.255335e-03 -0.001328657 -8.627374e-05
#> [8,] 0.001990046 -0.0021984130 3.168247e-03 -0.004204371 -6.964236e-03
#> [9,] 0.005891474 0.0002430765 8.876326e-03 -0.003944555 -3.729823e-03
#> [,37] [,38] [,39] [,40] [,41]
#> [1,] 0.004111784 -0.0015034383 -0.0025011873 0.001331302 0.0003766385
#> [2,] 0.010389741 0.0030539531 -0.0026386747 -0.003961867 0.0127635317
#> [3,] -0.002255048 -0.0059407806 0.0006276243 0.005817946 0.0028752923
#> [4,] 0.001310923 -0.0037669768 -0.0081718725 -0.003468251 0.0024192257
#> [5,] -0.003965735 -0.0071452496 -0.0032907831 -0.001528843 0.0024511320
#> [6,] 0.003116518 0.0003240906 0.0027884664 0.007382291 -0.0017420727
#> [7,] -0.004733518 -0.0008216778 -0.0010818387 0.001727538 -0.0011102314
#> [8,] -0.004930120 0.0062972215 -0.0011263122 0.003505483 0.0034801278
#> [9,] 0.001159732 -0.0001525715 0.0028871883 0.001138202 0.0028968057
#> [,42] [,43] [,44] [,45] [,46]
#> [1,] 1.057583e-03 -0.001431964 0.0016795152 0.001853313 -1.436966e-03
#> [2,] -6.005699e-05 0.004284837 0.0025802398 0.004482081 2.817188e-03
#> [3,] -9.628237e-03 -0.002763071 0.0003857475 -0.002507337 6.797740e-06
#> [4,] 1.596001e-03 -0.003078368 -0.0015407219 -0.001817679 -1.775488e-03
#> [5,] -1.141601e-03 0.001591523 -0.0017520401 -0.002006257 1.108604e-03
#> [6,] 2.651317e-03 0.004136998 0.0008847882 0.001043647 -3.918477e-03
#> [7,] -1.708714e-03 0.004794055 0.0037937484 0.001711143 -4.602688e-04
#> [8,] -4.880664e-03 0.001446662 0.0042118492 0.002714483 2.271767e-03
#> [9,] 3.108767e-03 0.001633721 -0.0039760657 0.002439156 -5.831713e-04
#> [,47] [,48] [,49] [,50]
#> [1,] 0.0007140320 0.0004296215 0.0010826680 -0.0026113729
#> [2,] -0.0012541313 0.0012474019 -0.0016342849 0.0001255411
#> [3,] 0.0003189359 0.0015240522 -0.0001826089 0.0001470047
#> [4,] -0.0024891632 -0.0011222909 0.0002067831 0.0002093210
#> [5,] 0.0009123700 -0.0004095611 0.0004083105 -0.0021247355
#> [6,] 0.0015813397 -0.0019715153 -0.0009363010 0.0002653162
#> [7,] -0.0014837409 0.0013014645 0.0020721848 0.0002390579
#> [8,] -0.0039650023 0.0005868817 -0.0009389637 0.0017565918
#> [9,] -0.0023634624 0.0012895675 -0.0020716215 0.0006108966
Note that weights are scaled within the function to sum to one, so the size of the weights relative to one another is what matters. We can see that weighting the RMSEA value more than the CFI value caused the RMSEA value to be closer to the target value and the CFI value to be further from the target value. We could have chosen to weight the CFI value instead:
TKL_m4 <- noisemaker(mod, method = "TKL",
target_rmsea = 0.05,
target_cfi = 0.95,
tkl_ctrl = list(weights = c(rmsea = 1, cfi = 4)))
TKL_m4
#> $Sigma
#> V1 V2 V3 V4 V5 V6 V7
#> V1 1.00000000 0.28483335 0.21026877 0.09857145 0.13270816 0.16631035 0.05880126
#> V2 0.28483335 1.00000000 0.26692635 0.10176426 0.11956441 0.09528821 0.08041670
#> V3 0.21026877 0.26692635 1.00000000 0.08556588 0.05908964 0.04239617 0.15354472
#> V4 0.09857145 0.10176426 0.08556588 1.00000000 0.38640608 0.36964432 0.14091721
#> V5 0.13270816 0.11956441 0.05908964 0.38640608 1.00000000 0.35254316 0.10517728
#> V6 0.16631035 0.09528821 0.04239617 0.36964432 0.35254316 1.00000000 0.10769711
#> V7 0.05880126 0.08041670 0.15354472 0.14091721 0.10517728 0.10769711 1.00000000
#> V8 0.09366299 0.12251543 0.09811507 0.12011159 0.18027190 0.12441720 0.47852244
#> V9 0.15477836 0.07630786 0.07651503 0.12123237 0.11557836 0.17774551 0.49243127
#> V8 V9
#> V1 0.09366299 0.15477836
#> V2 0.12251543 0.07630786
#> V3 0.09811507 0.07651503
#> V4 0.12011159 0.12123237
#> V5 0.18027190 0.11557836
#> V6 0.12441720 0.17774551
#> V7 0.47852244 0.49243127
#> V8 1.00000000 0.46019851
#> V9 0.46019851 1.00000000
#>
#> $rmsea
#> [1] 0.07125063
#>
#> $cfi
#> [1] 0.9543326
#>
#> $fn_value
#> [1] 0.04213395
#>
#> $m
#> [1] NA
#>
#> $v
#> [1] 0.2695082
#>
#> $eps
#> [1] 0
#>
#> $W
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] -7.468408e-03 -0.073081584 -0.015751421 -0.02598904 -0.041458551
#> [2,] 2.307966e-05 0.042015281 0.034302801 -0.07965560 0.046176354
#> [3,] -5.349675e-02 0.090277027 0.085768427 -0.14183987 0.070419473
#> [4,] -7.976476e-02 -0.028951643 0.142166894 0.03361089 0.139809554
#> [5,] -2.851223e-02 -0.065481560 0.003234452 -0.02152061 -0.052303740
#> [6,] -4.004740e-02 -0.072639640 -0.047789537 0.09795611 0.004356784
#> [7,] -3.609853e-02 0.041225010 -0.058057743 -0.05975796 0.050093218
#> [8,] -1.223773e-01 0.001675039 -0.029041483 -0.02595667 -0.026657405
#> [9,] -6.718377e-03 -0.085698002 -0.019188355 0.03632128 0.026762016
#> [,6] [,7] [,8] [,9] [,10]
#> [1,] 0.0006668273 -0.05008407 -0.05276296 -0.045571215 0.021934372
#> [2,] 0.0853914684 0.01047982 -0.02625665 -0.034544887 -0.028018410
#> [3,] -0.0563561677 -0.06188905 -0.06988091 0.009334323 -0.094970901
#> [4,] 0.0142440999 -0.01924571 0.04673944 0.153902204 0.007486317
#> [5,] -0.0412978784 -0.04852736 0.05712947 -0.057949522 -0.065323143
#> [6,] -0.0620689072 0.02236864 -0.01852091 -0.122986896 0.036834744
#> [7,] 0.0584065287 -0.04530143 -0.07930698 -0.006444826 0.041369204
#> [8,] -0.0302474193 -0.04483545 0.03157288 -0.044595497 0.016792259
#> [9,] 0.0729190449 -0.04327465 -0.03846018 -0.097736459 -0.046703926
#> [,11] [,12] [,13] [,14] [,15]
#> [1,] 0.065168425 0.088794426 0.070649045 0.055161255 -0.126641795
#> [2,] -0.024851966 -0.068684871 0.058061163 -0.086919369 -0.018249146
#> [3,] -0.008554319 0.091818055 0.020536805 -0.095150350 0.021180384
#> [4,] -0.064469196 -0.005607196 0.024879708 0.002255707 -0.014344437
#> [5,] -0.051720658 -0.099057567 0.075696312 0.018020518 -0.058648379
#> [6,] 0.027913833 0.073699049 0.062849527 0.067639475 -0.006970332
#> [7,] -0.016019854 0.004521427 -0.003292798 -0.002009959 0.071649331
#> [8,] 0.034978138 0.051386581 0.019373462 0.022337571 -0.071647191
#> [9,] 0.037449488 0.087239255 0.076146672 0.058002242 0.063652409
#> [,16] [,17] [,18] [,19] [,20]
#> [1,] 0.093827167 -0.025262206 0.0931081090 0.14094208 0.004905348
#> [2,] 0.004084289 0.034529601 0.0150778564 -0.06911078 0.027052117
#> [3,] -0.053243183 -0.033680641 0.1078260674 -0.04485381 -0.008717821
#> [4,] 0.037299828 0.031493589 -0.0005216164 0.04206910 0.027925923
#> [5,] 0.004157236 0.033755690 -0.0514809856 0.10307933 -0.015299171
#> [6,] 0.204402993 -0.015927511 -0.0028858725 0.06994543 -0.018152985
#> [7,] -0.103411344 -0.002328876 0.0042780506 -0.02503555 -0.013601917
#> [8,] -0.010778049 0.126548198 -0.0828719900 -0.03603963 0.033948996
#> [9,] 0.066751246 0.069644771 -0.0077155658 0.07631988 0.036939122
#> [,21] [,22] [,23] [,24] [,25]
#> [1,] -0.073053282 0.087619200 -0.102574831 0.02673151 -0.08159759
#> [2,] -0.098708246 0.131360329 0.002060492 0.05338683 0.04603773
#> [3,] 0.045696526 -0.062422187 0.122638292 -0.02972751 0.10205390
#> [4,] 0.005618942 0.046941696 0.054697476 -0.01127961 -0.05149705
#> [5,] -0.008284353 0.008141488 -0.011666228 0.04293017 -0.05563369
#> [6,] -0.095571153 0.040008705 0.030411279 -0.01605599 -0.06115649
#> [7,] -0.030484336 0.028193310 0.095545913 -0.05147415 -0.02452357
#> [8,] 0.010213336 -0.001090018 0.010076382 -0.07320513 0.03537094
#> [9,] -0.021879307 0.019716589 -0.025602825 0.12136242 0.03204262
#> [,26] [,27] [,28] [,29] [,30]
#> [1,] 0.06044509 0.085039159 -0.1018074696 -0.009701554 0.037962930
#> [2,] 0.16137234 0.027750842 -0.0669598762 -0.029544687 0.007140742
#> [3,] -0.02066114 0.077341826 0.0321707796 0.062678083 0.042550022
#> [4,] 0.09593036 -0.002943973 0.0012288714 -0.069856018 -0.009033383
#> [5,] -0.01491173 0.093123192 -0.0893102726 -0.164510187 -0.078635282
#> [6,] 0.05265905 -0.004315610 0.0341087162 0.044502610 0.019822715
#> [7,] -0.05294989 0.049125638 0.0420936700 0.002414404 -0.121927799
#> [8,] 0.01464720 -0.018320741 -0.0071540877 -0.005764862 -0.052404868
#> [9,] -0.03435655 -0.048453550 -0.0007372173 -0.017600891 -0.002678721
#> [,31] [,32] [,33] [,34] [,35]
#> [1,] -0.0207957188 0.060450489 -0.12724034 -0.036292412 0.012918968
#> [2,] -0.1655345928 -0.099051508 0.01614864 -0.009545701 0.061921826
#> [3,] 0.0299500508 -0.031623429 0.09584462 -0.062594505 0.063562785
#> [4,] -0.0334045524 0.171291126 0.03627542 0.054332666 0.074447067
#> [5,] -0.0361041612 0.032142750 0.05758509 -0.050043317 0.077799628
#> [6,] 0.0002165226 -0.005180024 -0.03155556 0.019413834 0.016844265
#> [7,] 0.0718646494 0.052391794 0.01597160 0.046592746 0.009194099
#> [8,] 0.0157001393 -0.012955426 0.05879044 -0.062817293 -0.050767170
#> [9,] 0.0378713699 0.027974724 -0.05979745 0.046019241 -0.054455408
#> [,36] [,37] [,38] [,39] [,40]
#> [1,] -0.026197701 -0.016877803 -0.03046911 -0.04022272 0.0004141723
#> [2,] -0.161143612 0.074868804 -0.02143118 -0.07449280 0.0083010087
#> [3,] -0.005894129 0.099402582 0.08534328 -0.03841104 -0.0094910243
#> [4,] 0.045975617 -0.042001374 -0.01681961 -0.06902186 0.0488432840
#> [5,] -0.056301732 0.001291697 -0.03293720 0.03355524 0.0078071051
#> [6,] -0.073130580 -0.018485514 -0.03781774 -0.08850279 -0.0443659208
#> [7,] 0.067220161 0.099423501 0.02393904 -0.05237701 0.0754768753
#> [8,] -0.051258199 0.031391828 -0.01697488 0.00144632 -0.0156177916
#> [9,] 0.040840523 -0.080109075 -0.02446421 -0.07718233 0.0274739790
#> [,41] [,42] [,43] [,44] [,45]
#> [1,] 0.06024646 -0.066328217 0.024563806 -0.037813464 -0.107019865
#> [2,] 0.08375862 -0.019895741 0.034615221 -0.002885300 -0.003211088
#> [3,] -0.08872317 -0.069090735 0.003463784 0.012677320 -0.025035465
#> [4,] 0.05826579 -0.026493843 -0.046283200 -0.034829960 -0.008363300
#> [5,] 0.04896696 0.033165048 -0.003667728 -0.016744834 0.069000335
#> [6,] 0.05370947 0.013709130 -0.054935847 0.061819835 -0.071574521
#> [7,] -0.04864679 0.048087936 0.004999197 -0.009675023 -0.014210927
#> [8,] 0.12800500 0.025929494 -0.018486659 0.013367066 0.135676571
#> [9,] -0.11671339 0.005038408 -0.005323779 0.016625431 -0.066507904
#> [,46] [,47] [,48] [,49] [,50]
#> [1,] 0.0387767538 0.057006047 0.0033162957 -0.0548256286 -0.061486394
#> [2,] -0.0001166266 0.069724631 -0.0162056168 -0.0095966219 -0.004348628
#> [3,] 0.0259415163 -0.044423463 -0.0008379317 -0.0317665226 -0.034129312
#> [4,] -0.0323973451 -0.064725617 0.0251408671 0.0073563687 0.027231135
#> [5,] -0.0604319379 -0.044413616 0.0218237813 -0.1180315507 -0.094935242
#> [6,] 0.0443703387 -0.067044614 -0.0246112470 0.0090405862 0.087765921
#> [7,] 0.0407415950 -0.095344684 0.0615672298 0.0008330454 0.072050241
#> [8,] -0.0921254433 0.016504963 -0.0019412360 -0.0850523546 -0.044787401
#> [9,] 0.0394688353 -0.006528407 -0.0061096052 0.0124158245 -0.030137144
In addition to generating population correlation matrices with particular RMSEA and CFI values, we might also want to ensure that minor factors are clearly distinct from major factors. After all, if minor factors have many moderate or large factor loadings, they can’t justifiably be called minor factors anymore and would likely be of theoretical interest.
The noisemaker()
function allows us to limit the number of factor loadings for each minor factor that exceed a user-specified threshold. For instance, perhaps we consider a factor with more than two factor loadings greater than or equal to .3 (in absolute value) to be of theoretical interest (i.e., not a minor factor). The factor loading threshold can be set using the WmaxLoading
argument in the tkl_ctrl
list. The maximum number of loadings greater (in absolute value) than the threshold for any minor factor can be set using the NWmaxLoading
argument in the tkl_ctrl
list. For example:
TKL_m5 <- noisemaker(mod, method = "TKL",
target_rmsea = 0.05,
target_cfi = 0.95,
tkl_ctrl = list(WmaxLoading = 0.3,
NWmaxLoading = 2))
TKL_m5
#> $Sigma
#> V1 V2 V3 V4 V5 V6 V7
#> V1 1.00000000 0.30198850 0.33811241 0.08988974 0.02688668 0.1308194 0.13262580
#> V2 0.30198850 1.00000000 0.30418246 0.09733466 0.09777602 0.1641290 0.10968412
#> V3 0.33811241 0.30418246 1.00000000 0.13833097 0.05433709 0.1271550 0.10855636
#> V4 0.08988974 0.09733466 0.13833097 1.00000000 0.38319969 0.3307456 0.08924264
#> V5 0.02688668 0.09777602 0.05433709 0.38319969 1.00000000 0.3297888 0.13714186
#> V6 0.13081939 0.16412900 0.12715503 0.33074562 0.32978879 1.0000000 0.13518541
#> V7 0.13262580 0.10968412 0.10855636 0.08924264 0.13714186 0.1351854 1.00000000
#> V8 0.08032391 0.11532716 0.10887450 0.12351578 0.08945259 0.1417993 0.50840262
#> V9 0.12707157 0.11365518 0.14145068 0.11204900 0.11651128 0.1632565 0.51008926
#> V8 V9
#> V1 0.08032391 0.1270716
#> V2 0.11532716 0.1136552
#> V3 0.10887450 0.1414507
#> V4 0.12351578 0.1120490
#> V5 0.08945259 0.1165113
#> V6 0.14179929 0.1632565
#> V7 0.50840262 0.5100893
#> V8 1.00000000 0.5049611
#> V9 0.50496115 1.0000000
#>
#> $rmsea
#> [1] 0.06497509
#>
#> $cfi
#> [1] 0.9650698
#>
#> $fn_value
#> [1] 0.09027057
#>
#> $m
#> [1] NA
#>
#> $v
#> [1] 0.3723792
#>
#> $eps
#> [1] 0
#>
#> $W
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] -0.11290601 -0.034182292 -0.039693904 -0.120121611 -0.018656043
#> [2,] 0.02384837 0.086257809 -0.066049522 0.115908352 0.056263366
#> [3,] -0.03914306 0.021832397 -0.149245536 0.039400309 0.062715203
#> [4,] 0.10548084 -0.002597967 -0.044839161 -0.025981077 0.002376464
#> [5,] 0.02862958 -0.073897614 0.048733483 0.149965658 -0.015961796
#> [6,] -0.07213398 -0.065836986 -0.077555902 -0.002828674 0.018545042
#> [7,] -0.08417027 0.029653726 -0.074608521 0.121882214 -0.102427383
#> [8,] 0.01568066 -0.022698758 -0.029975055 0.001694033 -0.025694969
#> [9,] -0.01916772 0.069059157 0.009934948 0.034551040 0.113158338
#> [,6] [,7] [,8] [,9] [,10]
#> [1,] -0.07659000 0.0545752991 -0.19547839 0.2007129512 0.02289533
#> [2,] 0.06653723 0.0061161689 0.04631253 -0.0190884459 0.09617308
#> [3,] -0.11085387 -0.0276091362 0.01176992 0.0110487480 0.12209909
#> [4,] 0.16063491 0.0006729721 -0.06151636 -0.0149059316 0.03459386
#> [5,] 0.10884996 -0.0637402580 0.09135532 -0.0430645454 -0.04934808
#> [6,] 0.03657360 0.0127866944 -0.08886458 0.0596399868 -0.04102437
#> [7,] -0.08699965 0.0122478915 -0.11440640 -0.0339479430 -0.03934411
#> [8,] 0.02910212 -0.0048993983 -0.04691317 0.0001619108 0.04120578
#> [9,] -0.10383488 -0.0001780358 -0.07393955 -0.0175981357 -0.01471900
#> [,11] [,12] [,13] [,14] [,15]
#> [1,] 0.0656297715 0.04402985 -0.17199211 0.008251593 0.05521498
#> [2,] 0.1314625216 0.12632626 -0.11770208 -0.100909185 0.03032964
#> [3,] 0.0925429501 -0.08561153 -0.10600560 0.005672689 -0.03820858
#> [4,] -0.0995300856 -0.07779835 -0.09199638 -0.047633337 -0.02504917
#> [5,] 0.0318129662 0.07157427 0.13934187 -0.007071042 0.04084166
#> [6,] 0.0008687602 0.06274884 0.07145891 -0.083037572 0.05175146
#> [7,] 0.0056046625 0.05598853 -0.00705331 -0.010576101 0.03067500
#> [8,] -0.0124548334 0.03317514 0.06703282 0.103770188 0.02242027
#> [9,] -0.0790173786 -0.02941097 0.14117874 0.113947340 -0.11120676
#> [,16] [,17] [,18] [,19] [,20]
#> [1,] -0.009856373 -0.04380659 -0.128868380 -0.159829758 0.10268293
#> [2,] -0.054443395 -0.04092618 -0.008049485 -0.001731306 0.08470026
#> [3,] -0.049225674 0.01404259 -0.133052925 0.032927052 0.04604937
#> [4,] -0.022158006 0.03889879 -0.075936351 0.056913262 -0.01246552
#> [5,] -0.059107004 -0.02820776 -0.041509309 0.068482614 0.05774334
#> [6,] -0.006709029 -0.02388680 -0.041300345 0.043293284 -0.04363278
#> [7,] -0.082105429 0.03333717 0.059648563 -0.055311679 -0.05651081
#> [8,] 0.025650572 -0.05937482 -0.004466891 0.060833690 -0.15220188
#> [9,] -0.029294639 -0.01003089 -0.058505060 0.003950322 0.01206567
#> [,21] [,22] [,23] [,24] [,25]
#> [1,] -0.045484985 0.03770115 0.041856515 -0.02855487 -0.05397983
#> [2,] -0.010977786 -0.06532895 0.068150998 -0.02914095 -0.02775441
#> [3,] -0.177791170 0.07648635 -0.059746579 -0.03366000 0.04579652
#> [4,] -0.082049276 0.08114404 0.003066938 -0.04070391 0.02772780
#> [5,] -0.005847888 0.05916551 0.156539271 -0.03753204 -0.08080342
#> [6,] 0.058778352 -0.19477780 -0.032499628 -0.06829400 0.08428764
#> [7,] 0.013648802 0.00925488 0.047644807 -0.03621628 0.08308170
#> [8,] 0.043800737 0.10380040 -0.047693440 -0.02267642 0.10128636
#> [9,] -0.064435355 -0.01069548 0.066512314 0.01208982 -0.07639058
#> [,26] [,27] [,28] [,29] [,30]
#> [1,] 0.058339505 -0.006755446 0.02528340 0.01793088 -0.051454579
#> [2,] 0.049423733 0.063542487 -0.01082899 -0.08383243 -0.090288884
#> [3,] 0.094079578 0.100787584 -0.05476848 0.02284004 0.064358000
#> [4,] 0.120126797 0.107326061 -0.05636511 0.01250465 -0.041585868
#> [5,] 0.098644297 0.024869020 0.03696616 0.01679381 -0.008864592
#> [6,] 0.055540754 -0.015091560 -0.11334796 -0.01955632 0.041292572
#> [7,] -0.002345741 0.029309934 0.04814328 -0.11098242 0.034425926
#> [8,] -0.006234190 -0.017627695 0.03068467 -0.13704789 -0.026867927
#> [9,] -0.025775550 -0.062613785 -0.05431909 -0.08064921 -0.033750922
#> [,31] [,32] [,33] [,34] [,35]
#> [1,] -0.126907724 0.028770732 0.034320217 -0.028851625 -0.007631349
#> [2,] -0.109641610 0.025789882 0.028433243 0.006606924 -0.065746533
#> [3,] -0.133873339 0.039667191 -0.048264153 -0.049507984 -0.101259690
#> [4,] 0.101959256 0.111584002 -0.006037681 0.057868378 -0.086107953
#> [5,] 0.041441164 0.064439193 -0.008955327 -0.114141036 -0.035419387
#> [6,] -0.165391445 0.023814299 0.078781712 0.010829779 -0.031849409
#> [7,] 0.030052311 -0.039313293 0.015393270 0.001677893 0.091340312
#> [8,] 0.004359401 0.024384865 0.019846675 0.072110176 -0.087805577
#> [9,] -0.015998660 0.008834564 0.146313969 -0.014013763 0.023795605
#> [,36] [,37] [,38] [,39] [,40]
#> [1,] -0.014424210 -0.061953272 -0.076120655 -0.025005785 -0.005825526
#> [2,] -0.127264962 0.051302843 -0.049109692 -0.003333468 -0.096599503
#> [3,] 0.040070202 -0.065989946 -0.118150089 -0.044725154 0.085253139
#> [4,] -0.140535500 0.040264185 0.009930278 0.015504887 0.007051443
#> [5,] -0.027829120 -0.014659844 0.100687478 0.006275206 0.098186085
#> [6,] 0.003879238 0.026993936 0.013572248 -0.149163638 0.069692715
#> [7,] -0.045171921 -0.066864773 0.033921085 0.054852575 0.091012240
#> [8,] -0.095875169 -0.064811413 -0.101295555 0.010543009 -0.091235121
#> [9,] -0.024899077 -0.006502899 -0.096094227 -0.060674538 0.036184132
#> [,41] [,42] [,43] [,44] [,45]
#> [1,] 0.023612957 0.053819780 0.03265040 0.029638576 0.022658824
#> [2,] 0.001620586 0.056691081 0.09011917 0.123142631 0.060879565
#> [3,] -0.045614656 0.003659586 -0.03620795 -0.003247166 0.134423893
#> [4,] -0.018778958 0.054969691 -0.03326767 -0.052697193 0.101290772
#> [5,] 0.121016488 0.019167329 -0.01553250 -0.131759417 -0.083828387
#> [6,] -0.006825422 -0.044528475 0.07461254 0.079292670 0.140668699
#> [7,] -0.024740755 0.116107615 -0.03055127 -0.057146003 0.008962221
#> [8,] -0.059987731 -0.127234310 -0.01198647 0.059509469 -0.026407561
#> [9,] -0.030939587 0.052787395 0.04971554 0.007485105 0.115849658
#> [,46] [,47] [,48] [,49] [,50]
#> [1,] 0.06489690 0.065052782 -0.017278922 0.030351422 0.07991724
#> [2,] -0.03881112 -0.129961471 -0.067005181 -0.090891960 0.14758648
#> [3,] 0.01035919 0.013220669 0.090587622 -0.064264383 0.01979246
#> [4,] 0.10429088 -0.013825649 0.001338282 0.136015304 -0.07582920
#> [5,] -0.02229282 -0.043576484 0.050790075 0.047188112 0.03366711
#> [6,] -0.05623319 -0.039453792 -0.026743379 -0.046984624 0.07739137
#> [7,] -0.03528126 0.107831325 0.011257511 -0.045410948 0.12139185
#> [8,] -0.07176411 0.029403355 0.070584461 -0.062880464 0.05540455
#> [9,] 0.01577404 -0.009027972 0.042186295 0.009269373 0.08854274
Nothing in the output is substantially different from the previous examples, but a penalty is added to the objective function to try to enforce solutions such that no minor factor has more than two factor loadings greater than 0.3 in absolute value. These restrictions can make optimization more difficult, particularly when target RMSEA values are relatively high. Moreover, the penalty provides no guarantee that the constraints on the minor factor loadings will be satisfied. In general, the constraints are likely to be violated when only a (relatively large) target RMSEA value is specified and when the input (error-free) population matrix has many factors, many items per factor, and relatively low factor loadings. On the other hand, the default constraints are much less likely to be violated if a reasonably large target CFI value is specified (e.g., CFI \(> .90\)).
v
and eps
By default, the tkl()
function uses a bounded optimization procedure to ensure that the values of v
and eps
fall between 0 and 1. Actually, the default lower boundary for v
is 0.001 so that the optimization procedure produces a solution with at least some model error, but otherwise it is assumed that the user has no a priori knowledge of reasonable values of v
and eps
. However, noisemaker()
allows the user to set custom bounds on v
and eps
in case they do have prior knowledge of reasonable parameter values. For instance, a user might consider it unlikely that the minor common factors would account for more than 20% of the unique variance. In that case, they could set the upper-bound of v
:
TKL_m6 <- noisemaker(mod, method = "TKL",
target_rmsea = 0.05,
target_cfi = 0.95,
tkl_ctrl = list(v_bounds = c(0, .2),
eps_bounds = c(0, 1)))
TKL_m6
#> $Sigma
#> V1 V2 V3 V4 V5 V6 V7
#> V1 1.00000000 0.30475277 0.27216745 0.04274508 0.03410750 0.10987486 0.11181353
#> V2 0.30475277 1.00000000 0.24209300 0.07744705 0.03315241 0.10621574 0.09298799
#> V3 0.27216745 0.24209300 1.00000000 0.12003973 0.08062471 0.11474994 0.14946324
#> V4 0.04274508 0.07744705 0.12003973 1.00000000 0.35019217 0.36139584 0.14584604
#> V5 0.03410750 0.03315241 0.08062471 0.35019217 1.00000000 0.35403121 0.14184262
#> V6 0.10987486 0.10621574 0.11474994 0.36139584 0.35403121 1.00000000 0.16183743
#> V7 0.11181353 0.09298799 0.14946324 0.14584604 0.14184262 0.16183743 1.00000000
#> V8 0.05913435 0.07096606 0.06228696 0.15599582 0.14958265 0.07507202 0.46803141
#> V9 0.06754831 0.04301273 0.13994697 0.13180909 0.17093535 0.11423506 0.50822208
#> V8 V9
#> V1 0.05913435 0.06754831
#> V2 0.07096606 0.04301273
#> V3 0.06228696 0.13994697
#> V4 0.15599582 0.13180909
#> V5 0.14958265 0.17093535
#> V6 0.07507202 0.11423506
#> V7 0.46803141 0.50822208
#> V8 1.00000000 0.49443925
#> V9 0.49443925 1.00000000
#>
#> $rmsea
#> [1] 0.06447525
#>
#> $cfi
#> [1] 0.9628491
#>
#> $fn_value
#> [1] 0.0749263
#>
#> $m
#> [1] NA
#>
#> $v
#> [1] 0.2
#>
#> $eps
#> [1] 0.05415514
#>
#> $W
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] -0.15433660 0.02946464 -0.21477804 0.131844178 0.094133250
#> [2,] -0.06945117 -0.07926110 -0.06521713 0.048589216 0.030529310
#> [3,] -0.05118745 0.06497132 -0.07884902 0.117900197 -0.187610636
#> [4,] -0.01754176 0.08136351 0.03846052 -0.206979551 -0.120028897
#> [5,] 0.16504638 0.02591515 0.18173538 0.059307200 0.029928988
#> [6,] -0.09188649 0.20133325 0.03333598 0.098468145 0.003964936
#> [7,] 0.04933283 0.20917767 -0.03584977 0.042534807 -0.143232106
#> [8,] 0.06779621 -0.08058614 0.07117458 -0.081305608 0.051874952
#> [9,] 0.02671015 0.04190445 0.07570703 -0.004460811 -0.037601100
#> [,6] [,7] [,8] [,9] [,10]
#> [1,] 0.069890102 -0.03080900 -0.01938888 0.01540748 -0.023310233
#> [2,] 0.235670598 -0.06545252 0.03654885 0.06424699 0.010287266
#> [3,] -0.088504956 0.02428374 0.15484070 0.05582622 0.067468600
#> [4,] -0.041553660 -0.05506407 -0.02032930 0.08669555 0.115126586
#> [5,] -0.083101762 0.06184983 -0.00133322 -0.11742779 -0.014074075
#> [6,] 0.133394797 -0.03598911 0.01766448 -0.08383649 -0.023914681
#> [7,] 0.009239604 0.05876027 -0.03866514 -0.07252748 0.012083374
#> [8,] -0.151730445 -0.01440272 -0.18663273 0.02079875 0.063103707
#> [9,] -0.183534752 -0.07731370 0.11295802 -0.09591918 0.007793953
#> [,11] [,12] [,13] [,14] [,15]
#> [1,] -0.008904468 -0.016414408 0.004926935 0.057017876 0.063963652
#> [2,] -0.033978417 0.039541143 -0.041420277 0.125839469 0.033149571
#> [3,] 0.038708238 0.045064686 -0.025570800 0.041791593 0.029500562
#> [4,] 0.018195394 0.013832198 0.049592758 -0.025356033 0.013700491
#> [5,] 0.143751111 0.028092581 0.063090374 -0.014099810 0.001469722
#> [6,] -0.008531096 -0.034129710 0.003308390 -0.073032011 -0.041024064
#> [7,] 0.006131603 0.010017340 0.012064859 0.048255665 0.097979207
#> [8,] -0.049851705 0.029007597 0.010258709 0.001930309 -0.031307589
#> [9,] 0.056154747 -0.006413724 0.010681166 -0.003091859 0.085914322
#> [,16] [,17] [,18] [,19] [,20]
#> [1,] -0.01863674 -0.0252206319 0.103052844 0.032991742 0.002802110
#> [2,] 0.02594079 0.1247810257 -0.065537549 0.066644922 0.008516382
#> [3,] -0.12652043 -0.0002120989 0.012573205 -0.072878567 -0.095706057
#> [4,] -0.10024828 0.0680538781 -0.053597866 0.001907791 -0.015211187
#> [5,] -0.01712478 0.0316164216 0.054930973 -0.021811010 0.011296599
#> [6,] -0.08960218 0.0311414607 -0.075918566 0.001222964 -0.108718071
#> [7,] 0.00472198 0.0202992372 -0.033071407 -0.004546141 0.012248630
#> [8,] 0.01756193 0.0096763890 -0.040749179 -0.037178074 -0.008537261
#> [9,] 0.04235219 -0.0323032220 0.002153668 -0.073199197 0.016964991
#> [,21] [,22] [,23] [,24] [,25]
#> [1,] 0.047015795 -0.073566532 -0.000167080 -0.043003531 0.02937206
#> [2,] 0.086542816 0.013660017 -0.003418471 0.018768978 -0.05086231
#> [3,] 0.029782028 0.005662719 0.013841866 -0.032178857 0.02549747
#> [4,] 0.081882839 -0.029650247 0.021548243 -0.013004174 0.01196659
#> [5,] 0.039201987 -0.021954134 -0.000465492 -0.027174876 -0.03283844
#> [6,] 0.012123275 0.018024915 0.013615853 0.021458822 0.01046088
#> [7,] 0.008001434 -0.010587127 0.022559771 -0.003849316 0.02250807
#> [8,] 0.054615960 -0.006962974 0.017204301 0.011932166 -0.02252696
#> [9,] -0.036712231 0.017387514 0.042464995 0.018932729 0.01507441
#> [,26] [,27] [,28] [,29] [,30]
#> [1,] -0.0563836206 0.0777097499 0.014946115 -0.0009142863 0.0173048197
#> [2,] -0.0349452398 0.0163879471 -0.041719191 -0.0246960205 0.0366921229
#> [3,] -0.0005613224 -0.0001704557 -0.063121875 0.0284486043 0.0148471574
#> [4,] 0.0046227397 -0.0553531796 -0.010110722 -0.0102145590 0.0006534677
#> [5,] -0.0124255039 -0.0058888248 -0.003784531 -0.0019601903 0.0138754044
#> [6,] 0.0329608446 0.0213530185 -0.003669499 -0.0006511610 0.0076486707
#> [7,] -0.0486958381 0.0175475686 -0.029703758 -0.0011496332 -0.0119950311
#> [8,] -0.0217183691 0.0091964437 -0.013013540 0.0100675600 0.0164257130
#> [9,] 0.0440061287 0.0365919906 -0.044651045 0.0209392219 0.0036109512
#> [,31] [,32] [,33] [,34] [,35]
#> [1,] 1.370980e-02 0.028184352 -0.011479300 0.001126885 -0.030623542
#> [2,] 2.298229e-02 0.007439780 0.008100770 -0.010783125 -0.017429557
#> [3,] 6.682096e-03 0.016042785 0.008006946 -0.001517539 0.002426600
#> [4,] -6.761072e-03 0.028433513 0.003569620 0.003188263 0.005087195
#> [5,] -2.572504e-02 0.027719552 -0.017402361 -0.001526889 -0.001041521
#> [6,] -3.550851e-02 -0.009471479 0.007500148 -0.006252863 -0.012910969
#> [7,] 3.629684e-02 -0.006961661 0.006874972 -0.007196133 0.008577102
#> [8,] 6.420916e-05 -0.005042713 -0.004105626 0.000466937 0.017221514
#> [9,] 1.159411e-02 0.021630568 0.010287067 -0.003527634 -0.009987711
#> [,36] [,37] [,38] [,39] [,40]
#> [1,] 0.0294842413 0.0005253239 0.0357324290 -0.0037400342 0.0050067917
#> [2,] -0.0216298896 -0.0188116633 -0.0076875074 0.0119023717 -0.0230699827
#> [3,] 0.0237575634 -0.0077208233 0.0136029006 -0.0016839731 0.0029081617
#> [4,] 0.0144458968 0.0159949693 0.0006018675 -0.0062694386 -0.0016295198
#> [5,] -0.0280521236 -0.0125799696 -0.0020980946 -0.0005932783 0.0002176906
#> [6,] 0.0050485930 -0.0085293093 -0.0051012367 0.0180658674 0.0112674459
#> [7,] 0.0109434599 0.0101201333 -0.0098219994 -0.0106429856 0.0158336833
#> [8,] -0.0097141602 0.0044260630 0.0147268697 -0.0032266805 -0.0024750764
#> [9,] -0.0001677036 -0.0089236660 0.0088043253 -0.0140466464 -0.0075184223
#> [,41] [,42] [,43] [,44] [,45]
#> [1,] 0.017684306 -1.078717e-04 -0.003594698 -0.019887766 0.0028070362
#> [2,] -0.008432719 1.250367e-03 0.014577426 -0.005268823 -0.0119576219
#> [3,] -0.005532296 2.704429e-02 0.014883127 -0.006300272 0.0008766833
#> [4,] -0.005132293 1.825130e-02 -0.014064429 0.013046633 -0.0090966477
#> [5,] 0.001734512 9.966103e-05 0.009021933 0.003918047 0.0031511766
#> [6,] -0.028846556 -3.621923e-03 -0.007977276 -0.005937313 -0.0003595646
#> [7,] -0.004324764 1.801528e-02 0.002052778 0.001994530 0.0119656512
#> [8,] 0.006568925 7.900486e-04 0.008317732 0.001054382 0.0023583112
#> [9,] 0.003711216 4.534519e-03 0.005261654 0.003316788 -0.0038483062
#> [,46] [,47] [,48] [,49] [,50]
#> [1,] -0.0055897788 0.011220938 -0.009714616 -0.0153546599 -0.0013561350
#> [2,] 0.0130526607 -0.007366174 -0.007368385 -0.0181989044 0.0054570244
#> [3,] -0.0006897546 0.015160266 0.003342576 -0.0007316266 -0.0082729044
#> [4,] -0.0069388793 -0.005094186 0.002310457 0.0071996194 0.0282455444
#> [5,] -0.0078554402 0.007456500 -0.014995819 0.0010780666 0.0018038259
#> [6,] 0.0117615791 0.011766855 0.004347669 0.0078415464 -0.0038792050
#> [7,] 0.0059348762 0.009856133 -0.009034391 0.0026710095 -0.0009071442
#> [8,] 0.0104040602 0.008344472 -0.007709444 0.0024489567 0.0030509692
#> [9,] -0.0055823132 -0.002448707 0.013921622 0.0128099208 0.0045731772
In contrast with the TKL method, the CB method is agnostic regarding how model error arises. Whereas the TKL method assumes that model error results from the influence of a large number of minor common factors, the CB method works by finding an error matrix \(\mathbf{E}\) such that \(\Sigma = \Omega(\gamma) + \mathbf{E}\), where \(\Omega(\gamma)\) is a covariance structure model with a parameter vector \(\gamma\) such that \(\Omega = \Omega(\gamma_0)\) for a particular parameter vector \(\gamma_0\). The CB method finds an \(\mathbf{E}\) matrix such that three criteria are satisfied:
The objective function value is directly related to RMSEA by \(\textrm{RMSEA} = \sqrt{F_m / df}\), where \(F_m\) denotes the objective function value and \(df\) denotes the model degrees of freedom. Therefore, the CB method allows the user to generate a \(\Sigma\) matrix with a particular RMSEA value, which has made it popular for use in Monte Carlo simulation studies. In the following example, I will demonstrate how to easily generate \(\Sigma\) matrices using the CB model error method and the noisemaker()
function.
We will use the same model we specified earlier to demonstrate how to use the CB method and the noisemaker()
function to generate a \(\Sigma\) matrix with a specified RMSEA value.
CB_m1 <- noisemaker(mod, method = "CB", target_rmsea = 0.05)
CB_m1
#> $Sigma
#> V1 V2 V3 V4 V5 V6 V7
#> V1 1.00000000 0.24014436 0.26445813 0.08398151 0.03382039 0.12724758 0.09040253
#> V2 0.24014436 1.00000000 0.24539750 0.08460617 0.15368426 0.10707571 0.10328737
#> V3 0.26445813 0.24539750 1.00000000 0.09116845 0.07821993 0.05019601 0.09665439
#> V4 0.08398151 0.08460617 0.09116845 1.00000000 0.36893672 0.35675451 0.11434382
#> V5 0.03382039 0.15368426 0.07821993 0.36893672 1.00000000 0.35430877 0.11374916
#> V6 0.12724758 0.10707571 0.05019601 0.35675451 0.35430877 1.00000000 0.17446914
#> V7 0.09040253 0.10328737 0.09665439 0.11434382 0.11374916 0.17446914 1.00000000
#> V8 0.09456482 0.12770208 0.11782964 0.10294136 0.11014756 0.11280439 0.49198275
#> V9 0.12295933 0.10907719 0.08252264 0.11777167 0.12826406 0.15950884 0.48786634
#> V8 V9
#> V1 0.09456482 0.12295933
#> V2 0.12770208 0.10907719
#> V3 0.11782964 0.08252264
#> V4 0.10294136 0.11777167
#> V5 0.11014756 0.12826406
#> V6 0.11280439 0.15950884
#> V7 0.49198275 0.48786634
#> V8 1.00000000 0.49015091
#> V9 0.49015091 1.00000000
#>
#> $rmsea
#> [1] 0.05000006
#>
#> $cfi
#> [1] 0.977085
#>
#> $fn_value
#> [1] NA
#>
#> $m
#> [1] NA
#>
#> $v
#> [1] NA
#>
#> $eps
#> [1] NA
#>
#> $W
#> [1] NA
It is important to know that not all target RMSEA values will lead to acceptable solutions. If the target RMSEA value is too large, \(\Sigma\) might become indefinite and the noisemaker()
function will give an error:
CB_m1 <- noisemaker(mod, method = "CB", target_rmsea = 0.5)
#> Error: Sigma is indefinite.
#> ℹ The minimum eigenvalue is -0.18
Another notable aspect of the CB method is that it attempts to find solutions such that if the (major factor) model is applied to the generated population correlation matrix with model error (\(\Sigma\)) using maximum likelihood, the vector of population parameters, \(\gamma\), will minimize the objective function.1 In practice, the CB method sometimes produces solution matrices that do not satisfy this requirement, particularly when major common factor loadings are relatively weak and the target RMSEA value is large.
In contrast to the TKL and CB methods, the WB method works by specifying a distribution for the population correlation matrix with model error, \(\Sigma\). In particular, in the WB method \(\Sigma\) follows the inverse-Wishart distribution
\[ (\Sigma | \Omega, m) \sim \textrm{IW}_p(m \Omega, m), \]
where \(m > p - 1\) is a user-specified precision parameter. There is a useful relationship between \(m\) and RMSEA such that \(1/m = \varepsilon^2 + o_p(\varepsilon^2)\) (where \(\varepsilon\) denotes RMSEA). Put another way, \(1/m \approx \varepsilon^2\) when \(m\) is large and \(\varepsilon\) is small. We can take advantage of this by choosing a target RMSEA value and then solving for \(m\). For instance, if our target RMSEA value is 0.05, we get \(m = 0.05^{-2} = 400\). Unfortunately, this approximation does not work particularly well when the target RMSEA value is large, particularly when the number of items (\(p\)) is also large.
The noisemaker()
function uses a somewhat ad hoc solution to this problem; Given a particular model, the get_wb_mod()
function uses the WB method to sample n
correlation matrices from inverse Wishart distributions using \(m\) values corresponding to a reasonable range of target RMSEA values (e.g., 0.02 to 0.1). For each target RMSEA value, the observed RMSEA value is calculated for each simulated correlation matrix and the median observed RMSEA value is calculated. Next, these data are used to fit the regression model
\[ \hat{\varepsilon}_{T} = b_0 + b_1 \varepsilon_{\textrm{obs}} + b_2 \varepsilon_{\textrm{obs}}^2. \] The fitted model can then be used by plugging in the target RMSEA value to find an adjusted value that will lead to solutions with RMSEA values close to the desired level.
To demonstrate how this works, let’s use the model we specified previously to generate a population correlation matrix using the WB method and the noisemaker()
function. First, we’ll use the get_wb_mod()
function to get a fitted model.
wb_mod <- get_wb_mod(
mod, # simFA() model specification
n = 50, # Number of matrices to simulate at each target RMSEA value
values = 10, # Number of target RMSEA values to test
lower = 0.01, # 'lower' and 'upper' are the endpoints of the RMSEA sequence
upper = 0.095
)
summary(wb_mod)
#>
#> Call:
#> stats::lm(formula = rmsea_values ~ poly(rmsea_medians, 2))
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -0.0016987 -0.0010960 0.0002503 0.0008664 0.0018224
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 0.0525000 0.0004389 119.606 7.53e-13 ***
#> poly(rmsea_medians, 2)1 0.0856555 0.0013880 61.709 7.71e-11 ***
#> poly(rmsea_medians, 2)2 -0.0029049 0.0013880 -2.093 0.0747 .
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> Residual standard error: 0.001388 on 7 degrees of freedom
#> Multiple R-squared: 0.9982, Adjusted R-squared: 0.9976
#> F-statistic: 1906 on 2 and 7 DF, p-value: 2.635e-10
Now that we have a wb_mod
, let’s use it to simulate a correlation matrix using the WB method.
noisemaker(mod, method = "WB", target_rmsea = 0.05, wb_mod = wb_mod)
#> $Sigma
#> V1 V2 V3 V4 V5 V6 V7
#> V1 1.0000000 0.25630017 0.27450464 0.12459890 0.10436564 0.12873469 0.1711865
#> V2 0.2563002 1.00000000 0.27950146 0.06011744 0.05387993 0.07943530 0.1104476
#> V3 0.2745046 0.27950146 1.00000000 0.10188466 0.09163268 0.05788158 0.1161640
#> V4 0.1245989 0.06011744 0.10188466 1.00000000 0.36226215 0.34305741 0.1142572
#> V5 0.1043656 0.05387993 0.09163268 0.36226215 1.00000000 0.36798687 0.1395108
#> V6 0.1287347 0.07943530 0.05788158 0.34305741 0.36798687 1.00000000 0.1391329
#> V7 0.1711865 0.11044758 0.11616403 0.11425718 0.13951080 0.13913286 1.0000000
#> V8 0.1302481 0.13658367 0.10804468 0.13196089 0.11684152 0.14117239 0.4823468
#> V9 0.1325976 0.15637306 0.13464741 0.14391781 0.11969401 0.12691267 0.5022176
#> V8 V9
#> V1 0.1302481 0.1325976
#> V2 0.1365837 0.1563731
#> V3 0.1080447 0.1346474
#> V4 0.1319609 0.1439178
#> V5 0.1168415 0.1196940
#> V6 0.1411724 0.1269127
#> V7 0.4823468 0.5022176
#> V8 1.0000000 0.5350151
#> V9 0.5350151 1.0000000
#>
#> $rmsea
#> [1] 0.04716415
#>
#> $cfi
#> [1] 0.9808255
#>
#> $fn_value
#> [1] NA
#>
#> $m
#> 1
#> 1186.501
#>
#> $v
#> [1] NA
#>
#> $eps
#> [1] NA
#>
#> $W
#> [1] NA
The observed RMSEA value isn’t exactly 0.05, but it’s relatively close. An important aspect of the WB method is that we’re only controlling the distribution from which the correlation matrices are sampled and therefore have less fine-grained control of RMSEA compared to the CB or TKL methods.
Another important note about the WB method is that if you don’t provide a wb_mod
model to the noisemaker()
function when the “WB” method is specified, a model will be fitted when the function is called. This is convenient when you want to simulate only one correlation matrix, but will be much slower than providing a wb_mod
if you’re planning to simulate many correlation matrices using the same population factor model.
The same is also true when using ordinary least squares if the CB method is altered somewhat; see Cudeck and Browne (1992) for details.↩︎