Commit 03a3081f authored by Corson N. Areshenkoff's avatar Corson N. Areshenkoff

Initial commit

parent 532d69f6
# 2018_karr_cfaReanalysis
Code for replicating the analyses reported in Karr, et al. 2018.
\ No newline at end of file
Code for replicating the analyses reported in:
Karr, J. E., Areshenkoff, C. N., Rast, P., Hofer, S. M., Iverson, G. L., & Garcia-Barrera, M. A. (2018). The unity and diversity of executive functions: A systematic review and re-analysis of latent variable studies. Psychological bulletin.
The file run_simulation.R will replicate the reanalysis. Running the simulation requires the the following packages:
- lavaan
- semTools
- MASS
- plyr
Slight changes have been made to compared to the version used in the article to accommodate the variety of environments used by readers. In particular, the simulation described in the article was run heavily parallelized on a Linux machine, with some of the data organization offloaded to bash. In order to make the code useable for all readers (particularly users of Windows), the code has serialized and ported entirely to R, at the cost of substantial speed. The full 5000 simulations of each model for each study can be expected to take several days, unparallelized.
The number of bootstrap samples is given by the “samples” variable, which is set to 10 for demonstration purposes, though 5000 were used in the publication.
The directory structure is as follows:
- “paper_data” contains the means and covariance matrices for each study
- “papers” contains model scripts for each study
- “sim_code” contains scripts for importing the covariance matrices and fitting the models to each study
- “simulation_data” contains the simulation results. Separate files are output for each study, for each model. Each file contains one row per bootstrap sample, each containing the omega statistic for each factor, various summary statistics, the correlations between distinct factors.
Variable names in output files are as follows:
- Omega coefficients for each factor + general, denoted by factor names (shift, update, ..., general)
- p.value
- cfi
- aic
- bic
- bic2
- Correlations between factors, if allowed in model. Denoted "Fac1..Fac2" (e.g. update..shift)
- Loadings of variables on factors. Denoted "Fac.Var" (e.g. update.x1)
3.75 4.42 4.39 0.71 13.79 8.47 47.4 0.86 26.37 0.36
0.72 1.03 1.37 0.18 6.35 4.81 16.26 0.11 20.81 0.17
1
0.45 1
0.36 0.37 1
0.22 0.26 0.32 1
0.22 0.12 0.24 0.28 1
0.34 0.1 0.2 0.35 0.35 1
0.51 0.35 0.38 0.37 0.35 0.38 1
0.22 0.17 0.2 0.24 0.12 0.2 0.32 1
0.4 0.23 0.31 0.24 0.21 0.19 0.56 0.23 1
0.32 0.27 0.47 0.32 0.29 0.2 0.47 0.19 0.36 1
999 999 999 999 999 999 999 999 999
999 999 999 999 999 999 999 999 999
1
0.69 1
0.73 0.62 1
0.44 0.28 0.37 1
0.58 0.47 0.51 0.62 1
0.65 0.57 0.57 0.27 0.41 1
0.64 0.53 0.56 0.35 0.49 0.57 1
0.65 0.54 0.56 0.29 0.41 0.59 0.66 1
0.4 0.32 0.38 0.28 0.35 0.32 0.31 0.33 1
999 999 999 999 999 999 999 999 999
999 999 999 999 999 999 999 999 999
1
0.69 1
0.73 0.62 1
0.44 0.28 0.37 1
0.58 0.47 0.51 0.62 1
0.65 0.57 0.57 0.27 0.41 1
.64 .53 .56 .35 .49 .57 1
0.65 0.54 0.56 0.29 0.41 0.59 .66 1
0.4 0.32 0.38 0.28 0.35 0.32 .31 0.33 1
999 999 999 999 999 999 999 999 999 999 999 999 999
999 999 999 999 999 999 999 999 999 999 999 999 999
1
0.03 1
0.13 0.06 1
0.32 -.03 0.17 1
0.26 0.13 0.07 0.36 1
0.14 0.03 0.06 0.36 0.22 1
0.23 0.05 0.13 0.38 0.2 0.17 1
0.39 0.02 0.18 0.4 0.31 0.29 0.22 1
0.29 -.01 0.2 0.4 0.28 0.13 0.28 0.26 1
0.29 0.03 0.19 0.48 0.31 0.24 0.41 0.38 0.43 1
0.37 -.04 0.18 0.45 0.32 0.32 0.39 0.41 0.42 0.59 1
0.28 -.10 0.12 0.45 0.25 0.63 0.31 0.4 0.3 0.4 0.52 1
0.28 -.10 0.14 0.56 0.35 0.52 0.32 0.48 0.36 0.45 0.52 0.79 1
980.544 995.69 7 20.75 568.45 593.05 49.33
374.76 280.52 7.2 17.77 338.9 517.62 7.24
1
0.748 1
0.202 -0.146 1
0.243 0.032 0.359 1
0.647 0.525 0.216 0.343 1
0.377 0.304 -0.064 0.141 0.481 1
-0.548 -0.393 -0.343 -0.302 -0.337 -0.203 1
980.544 995.69 7 20.75 568.45 593.05 49.33
374.76 280.52 7.2 17.77 338.9 517.62 7.24
1
0.748 1
0.202 -146 1
0.243 0.032 0.359 1
0.647 0.525 0.216 0.343 1
0.377 0.304 -0.064 0.141 0.481 1
-0.548 -0.393 -0.343 -0.302 -0.337 -0.203 1
0.71 250 132 0.79 0.9 0.96 259 217 146
0.2 38 69 0.15 0.24 0.14 180 180 115
1
0.09 1
0.17 0.11 1
0.05 0.08 0.02 1
0.29 0.06 0.15 0.38 1
0.24 0 0.08 0.2 0.31 1
0.18 0.05 0.08 0.02 0.03 0.07 1
0.18 -.04 0.08 0.05 0.05 -.01 0.37 1
0.18 0.15 0.08 0.08 0.08 0.06 0.39 0.4 1
1.04 282 214 0.94 1.09 1.17 331 331 333 102
0.2 63 90 0.18 0.25 0.17 183 189 181 11
1
0.26 1
0.16 0.14 1
0.18 0.23 0.21 1
0.25 0.16 0.25 0.46 1
0.21 0.24 0.12 0.27 0.26 1
0.14 0.26 0.23 0.13 0.19 0.15 1
0.16 0.22 0.27 0.14 0.14 0.12 0.41 1
0.21 0.28 0.25 0.17 0.16 0.19 0.48 0.43 1
0.23 0.22 0.26 0.54 0.43 0.3 0.05 0.09 0.17 1
0.62 8.11 41.98 3.46 8.31 12.27 0.73 0.12 10.76 13.23 14.99 5.11 6.35 0.57 4.07 26.99 11.05 8.12 0.79 0.27 0.67 0.65
0.4 3.96 18.74 2.14 2.58 1.66 0.16 0.1 3.91 3.93 4.06 1.64 1.59 0.24 1.72 5.09 2.83 2.04 0.16 0.27 0.22 0.24
1
0.23 1
0.16 0.28 1
0.09 0.16 0.23 1
0.22 0.28 0.32 0.35 1
0.19 0.28 0.26 0.27 0.18 1
0.2 0.13 0.2 0.17 0.14 0.22 1
0.06 -0.07 0.21 -0.06 0.07 0.15 0.15 1
0.15 0.21 0.21 0.34 0.23 0.27 0.14 0.05 1
0.1 0.2 0.16 0.22 0.08 0.02 0.14 0.03 0.42 1
0.17 0.01 0.07 0.28 0.23 0.19 0.17 0.11 0.35 0.35 1
0.23 0.31 0.22 0.31 0.16 0.25 0.22 0.06 0.26 0.26 0.29 1
0.23 0.21 0.21 0.22 0.1 0.21 0.12 0.04 0.15 0.15 0.24 0.73 1
0.18 0.27 0.08 0.21 0.09 0.22 0.02 -0.1 0.11 0.12 0.31 0.47 0.49 1
0.22 0.25 0.11 0.22 0.09 0.28 0.09 -0.07 0.08 0.1 0.26 0.48 0.42 0.76 1
0.28 0.09 0.25 0.27 0.12 0.31 0.41 0.21 0.2 0.11 0.28 0.32 0.32 0.19 0.17 1
0.12 0.04 0.16 0.14 0.1 0.25 0.25 0.2 0.14 0.08 0.15 0.16 0.32 0.13 0.05 0.46 1
0.24 0.12 0.15 0.04 0.16 0.18 0.08 0.03 0.09 0 0.02 0.19 0.22 0.18 0.16 0.24 0.23 1
0.18 0.22 0.2 0.26 0.26 0.27 0.04 -0.12 0.22 0.23 0.31 0.36 0.33 0.43 0.35 0.15 0.14 0.14 1
-0.28 -0.13 -0.06 -0.16 -0.25 -0.1 -0.14 0.01 -0.16 -0.38 -0.23 -0.25 -0.16 -0.08 -0.12 -0.01 -0.04 -0.09 -0.46 1
0.27 0.12 0.22 0.18 0.32 0.24 0.2 0 0.29 0.27 0.38 0.35 0.36 0.14 0.19 0.11 0.08 0.19 0.65 -0.93 1
-0.1 -0.15 0.06 -0.03 -0.02 0.06 0.02 0.22 -0.1 -0.28 -0.05 0 0.08 -0.04 -0.06 0.12 0.16 -0.03 -0.24 0.56 -0.29 1
202.22 217.12 41.02 6.55 11.28 13.7 24.11 243.68 63.22 0.28 87.67 6.56 0.04 52.28 21.7 60.24
167.2 166.05 10.07 5.67 8.41 9.37 12.82 102.69 60.91 0.15 24.48 4.66 0.02 7.87 2.85 5.58
1
0.49 1
0.07 -0.1 1
-0.22 -0.1 0.45 1
-0.14 0.06 0.30 0.42 1
-0.18 0.05 0.06 0.4 0.45 1
-0.05 -0.05 0.17 0.4 0.21 0.4 1
-0.14 -0.11 0.24 0.24 0.16 0.2 -0.03 1
-0.01 0.02 0.05 -0.06 0.19 0.16 -0.12 0.27 1
0.16 0.26 0.02 0.18 0.15 0.26 -0.22 0.13 0.09 1
-0.34 -0.05 -0.03 0.43 0.25 0.45 0.22 0.2 0.02 -0.01 1
-0.19 0.06 -0.01 0.36 0.36 0.39 0.19 0.3 0 0.24 0.43 1
-0.29 -0.25 0.09 0.32 0.58 0.33 -0.01 0.14 0.03 0.53 0.01 0.47 1
-0.04 -0.15 -0.27 -0.51 -0.42 -0.56 -0.35 -0.13 0.03 -0.22 -0.2 -0.37 -0.32 1
-0.07 -0.05 -0.23 -0.62 -0.52 -0.29 -0.15 -0.31 -0.11 -0.22 -0.34 -0.29 -0.32 0.36 1
-0.02 0.08 0.22 0.01 0.05 -0.02 -0.24 0.1 0.14 0.53 -0.18 0.04 0.37 -0.28 0 1
202.22 217.12 41.02 6.55 11.28 13.7 24.11 243.68 63.22 0.28 87.67 6.56 0.04 52.28 21.7 60.24
167.2 166.05 10.07 5.67 8.41 9.37 12.82 102.69 60.91 0.15 24.48 4.66 0.02 7.87 2.85 5.58
1
0.49 1
0.07 -0.1 1
-0.22 -0.1 0.45 1
-0.14 . 06 . 30 0.42 1
-0.18 . 05 0.06 0.4 0.45 1
-0.05 -0.05 0.17 0.4 0.21 0.4 1
-0.14 -0.11 0.24 .24 0.16 0.2 -0.03 1
-0.01 0.02 0.05 -0.06 0.19 0.16 -0.12 0.27 1
0.16 0.26 0.02 0.18 0.15 0.26 -0.22 0.13 0.09 1
-0.34 -0.05 -0.03 0.43 0.25 0.45 0.22 0.2 0.02 -0.01 1
-0.19 0.06 -0.01 0.36 0.36 0.39 0.19 0.3 0 0.24 0.43 1
-0.29 -0.25 0.09 0.32 0.58 0.33 -0.01 0.14 0.03 0.53 0.01 0.47 1
-0.04 -0.15 -0.27 -0.51 -0.42 -0.56 -0.35 -0.13 0.03 -0.22 -0.2 -0.37 -0.32 1
-0.07 -0.05 -0.23 -0.62 -0.52 -0.29 -0.15 -0.31 -0.11 -0.22 -0.34 -0.29 -0.32 0.36 1
-0.02 0.08 0.22 0.01 0.05 -0.02 -0.24 0.1 0.14 0.53 -0.18 0.04 0.37 -0.28 0 1
61.98 247 141 73.32 75.12 80.73 243 241 156
14.36 32 70 8.6 13.49 6.8 156 160 119
1
0.16 1
0.18 0.09 1
0.19 0.03 0.17 1
0.32 0.02 0.3 0.37 1
0.39 0.04 0.14 0.31 0.38 1
0.18 0.11 0.23 0.07 0.12 0.11 1
0.07 0 0.12 0.02 0.06 0.06 0.37 1
0.25 0.1 0.16 0.08 0.12 0.11 0.5 0.41 1
626 226 121 1.15 0.87 3.66 4.16
439 166 92 0.16 0.23 0.75 1.63
1
0.18 1
0.05 0.31 1
0.12 0.12 0.13 1
0.1 -0.04 0.17 0.26 1
0.03 0.08 0.05 0.21 0.27 1
-0.02 -0.02 0.05 0.11 -0.06 0.24 1
172 232 134 83 135 58 29 9.87 9.54 11.75
108 123 94 40 1163 28 22 1.48 1.41 1.62
1
0.15 1
0.3 0.09 1
0 0.17 0.21 1
0.07 0.05 0.15 0.23 1
-0.16 0 -0.05 0.05 0.3 1
-0.01 0.12 0.12 0.25 0.17 0.21 1
-0.09 -0.12 -0.02 0.26 -0.1 0.04 0.13 1
-0.16 0.01 -0.06 0.22 -0.05 0.13 0.17 0.65 1
-0.04 0.01 0.04 0.22 -0.02 0.13 0.18 0.59 0.51 1
23 48.7 27.4 20.8 3.8 46.4 43.4 53.3 25.1 6 35.3 35.7 8 14.3
8.7 21.2 11.9 11.6 3.7 9.6 9.9 14 3.4 1.3 15.7 3.6 1.8 7.8
1
0.41 1
0.64 0.52 1
0.14 -0.11 0.13 1
-0.09 0.1 0.04 -0.51 1
-0.08 -0.05 0.07 0.06 -0.02 1
-0.05 -0.14 -0.02 0.13 -0.15 0.65 1
-0.12 -0.34 -0.27 0.22 -0.31 0.14 0.26 1
0.04 -0.2 -0.06 0.33 -0.36 0.25 0.36 0.25 1
-0.08 -0.22 -0.18 0.06 -0.06 0.18 0.2 0.25 0.31 1
0.08 0.18 0.13 -0.34 0.34 -0.24 -0.28 -0.27 -0.43 -0.36 1
0.05 0.17 0.13 -0.16 0.11 -0.13 -0.05 -0.23 -0.13 -0.16 0.61 1
-0.15 -0.26 -0.13 0.38 -0.37 0.08 0.2 0.27 0.29 0.16 -0.28 -0.11 1
0.18 0.36 0.22 -0.4 0.33 -0.09 -0.22 -0.39 -0.31 -0.24 0.31 0.12 -0.85 1
0.81 1.14 0.73 7.8 6.24 0.79 15.86 0.07 2.39 0.75 0.74 0.79 12.15 67.87
1.14 1.25 0.13 6.39 7.67 0.18 3.46 0.04 2.03 0.22 0.2 0.2 4.15 18.24
1
0.78 1
0.23 0.24 1
0.38 0.5 0.19 1
0.2 0.26 0.09 0.28 1
0.29 0.35 0.13 0.58 0.9 1
0.12 0.26 0.19 0.15 0.24 0.24 1
0.18 0.18 0.15 0.2 0.3 0.35 0.09 1
0.13 0.15 0.15 0.24 0.39 0.42 0.31 0.17 1
0.23 0.31 0.15 0.37 0.23 0.33 0.2 0.19 0.43 1
0.3 0.41 0.12 0.48 0.34 0.47 0.28 0.17 0.18 0.22 1
0.18 0.22 0.1 0.29 0.17 0.27 0.16 0.28 0.14 0.27 0.25 1
0.45 0.59 0.19 0.44 0.09 0.22 0.19 0.13 0.19 0.4 0.4 0.26 1
0.46 0.48 0.18 0.29 0.35 0.39 0.22 0.29 0.3 0.36 0.33 0.26 0.53 1
This diff is collapsed.
TITLE: Miyake Replication
DATA: File IS miyake2000.txt;
TYPE IS CORRELATION MEANS STDEVIATIONS;
NOBSERVATIONS IS 137;
VARIABLE: Names are
PlusMin NumLet LocGlo KeepTrk
ToneMon LetMem Antisac
StopSig Stroop WCST TOH RNG1 RNG2
OpSpan DualTask;
USEVAR are PlusMin NumLet LocGlo KeepTrk
ToneMon LetMem Antisac
StopSig Stroop;
MODEL: Shift BY PlusMin NumLet LocGlo;
Update BY KeepTrk ToneMon LetMem;
Inhib BY Antisac StopSig Stroop;
ANALYSIS:
OUTPUT: STANDARDIZED;
RESIDUAL;
MOD;
\ No newline at end of file
15.5 546 210 0.63 0.7 0.99 1.16 0.78 166 32 46 0 0 43 0.89
10.8 250 160 0.14 0.26 0.13 0.16 0.29 60 12 12 1 1 6 0.13
1
0.32 1
0.23 0.32 1
0.23 0.08 0.12 1
0.22 0.19 0 0.15 1
0.24 0.11 0.21 0.34 0.27 1
0.15 0.17 0.11 0.12 0.26 0.22 1
0.11 0.13 0.06 0.1 0.09 0.04 0.19 1
0.07 0.09 -0.05 0.11 0.16 0.18 0.2 0.18 1
0.26 0.13 0.18 0.09 0.19 0.14 0.15 -0.01 0.1 1
0.08 0.1 -0.09 0.13 0.18 0.14 0.21 0.08 0.17 -0.02 1
0.2 0.13 0.01 0.03 0.11 0.19 0.24 0.12 0.11 0.13 0.1 1
0.2 -0.07 0.07 0.29 0.06 0.19 0.02 0.18 0.01 -0.08 0.12 0.02 1
0.09 0.08 -0.04 0.41 0.28 0.34 0.16 0.13 0.2 0.16 0.04 0.17 0.13 1
-0.03 -0.02 0.05 -0.09 -0.03 0.12 -0.08 -0.16 0.06 0.06 -0.18 -0.05 -0.09 -0.14 1
\ No newline at end of file
999 999 999 999 999 999 999 999 999 999
999 999 999 999 999 999 999 999 999 999
1
0.3 1
0.19 0.31 1
0.39 0.13 0.21 1
0.22 0.1 0.21 0.24 1
0.4 0.23 0.23 0.37 0.39 1
0.17 0.01 0.35 0.17 0.1 0.16 1
0.19 0.22 0.36 0.13 0.2 0.1 0.26 1
0.23 0.19 0.31 0.22 0.28 0.25 0.04 0.3 1
0.22 0.06 0.18 0.11 0.17 0.1 0.01 0.17 0.36 1
0.55 22.98 4.63 2.04 27.91 0.86 17.68
0.23 4.35 2.71 0.59 6.49 0.25 3.39
1
0.252 1
0.182 0.158 1
0.146 0.327 0.245 1
-0.02 0.046 0.154 0.156 1
0.156 0.134 0.07 0.371 0.112 1
0.023 0.136 0.27 0.173 -0.029 0.095 1
10 10 10 10.1 10 10 10 10 10 10 10 10.1 10 10 10
3.1 2.9 3 3.1 3 3 3.1 3.1 3.1 3 3 3.1 3.1 3 3.1
1
0.49 1
0.45 0.48 1
0.54 0.51 0.47 1
0.45 0.74 0.5 0.51 1
0.5 0.54 0.6 0.52 0.57 1
0.41 0.35 0.4 0.39 0.34 0.37 1
0.64 0.44 0.4 0.53 0.42 0.48 0.38 1
0.44 0.64 0.43 0.49 0.73 0.57 0.34 0.43 1
0.4 0.41 0.45 0.45 0.41 0.43 0.65 0.37 0.34 1
0.42 0.45 0.69 0.45 0.48 0.56 0.37 0.41 0.43 0.38 1
0.56 0.53 0.5 0.57 0.53 0.61 0.34 0.58 0.51 0.36 0.48 1
0.44 0.71 0.48 0.49 0.74 0.55 0.32 0.43 0.66 0.39 0.47 0.53 1
0.34 0.23 0.34 0.26 0.24 0.31 0.46 0.32 0.22 0.42 0.3 0.29 0.21 1
0.49 0.44 0.39 0.42 0.39 0.37 0.41 0.48 0.41 0.38 0.37 0.41 0.4 0.33 1
10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
1
0.68 1
0.65 0.71 1
0.59 0.6 0.56 1
0.46 0.47 0.47 0.38 1
0.48 0.51 0.48 0.4 0.6 1
0.45 0.45 0.45 0.39 0.47 0.47 1
0.46 0.49 0.48 0.38 0.47 0.5 0.47 1
0.39 0.42 0.4 0.35 0.34 0.39 0.35 0.33 1
0.54 0.53 0.55 0.46 0.46 0.46 0.45 0.5 0.37 1
0.47 0.46 0.46 0.42 0.42 0.42 0.44 0.43 0.34 0.55 1
0.39 0.38 0.36 0.36 0.35 0.36 0.38 0.35 0.3 0.43 0.51 1
0.48 0.49 0.47 0.43 0.38 0.39 0.43 0.4 0.33 0.54 0.65 0.49 1
0.23 0.21 0.2 0.24 0.31 0.2 0.24 0.19 0.19 0.31 0.28 0.25 0.29 1
0.28 0.25 0.29 0.26 0.34 0.28 0.29 0.23 0.23 0.32 0.32 0.27 0.28 0.58 1
0.11 0.1 0.13 0.14 0.19 0.13 0.13 0.11 0.11 0.15 0.11 0.09 0.11 0.3 0.33 1
91.12 66.3 80.9 58.42 309.48 722.03 591.55
6.36 13.83 10.21 18.06 185.82 284.28 284.37
1
0.3 1
0.15 0.36 1
0.17 0.21 0.14 1
0.19 0.24 0.2 0.14 1
0.25 0.29 0.23 0.19 0.19 1
0.14 0.11 0.15 0.23 0.04 0.11 1
93.41 71.22 86.66 69.37 230.29 608.42 543.05
4.69 13.77 9.81 17.85 115.01 236.76 289.69
1
0.32 1
0.24 0.3 1
0.34 0.27 0.16 1
0.2 0.16 0.2 0.25 1
0.02 0.18 0.15 0.28 0.33 1
0.18 0.22 0.17 0.25 0.1 0.21 1
86.21 58.64 69.99 50.21 415.47 782.88 611.46
10.58 13.68 12.36 15.62 190.62 307.07 328.82
1
0.36 1
0.19 0.27 1
0.16 0.25 0.28 1
0.12 0.06 0.15 0.13 1
0.1 0.2 0.26 0.24 0.14 1
0.21 0.28 0.32 0.21 0.12 0.18 1
5.9 1.46 5.35 109.67 3.63 4.09
1.13 0.48 1.79 19.48 0.99 1.51
1
0.07 1
-0.15 0.09 1
0.19 0.12 0.07 1
0.06 0.22 0.04 0.19 1
0.06 0.14 0.11 0.29 0.52 1
5.8 1.18 4.93 94.16 2.9 3.12
1.26 0.62 2.18 27 0.94 1.13
1
0.04 1
0.18 0.05 1
0.06 0.07 0.24 1
0.19 0.14 0.18 0.21 1
0.07 0.12 0.15 0.18 0.49 1
# Location
folder = 'Agostino 2010'
file = 'Agostino2010'
# Paper data
N = 155
vars = c(4:10) # Which rows/columns of cor. matrix to import
Sigma = importCorMatrix(paste(folder, '/', file, '.txt', sep = ''),
vars = vars)
# Bootstrap correlation matrices
sigmaBoot = bootstrapCor(Sigma, N, samples)
# Specify Models
unimodel <- '
General =~ x4 + x5 + x6 + x7 + x8 + x9 + x10
'
multimodel <- '
inhibit =~ x4 + x5 + x6
update =~ x7 + x8
shift =~ x9 + x10
'
shiupdmerge <- '
inhibit =~ x4 + x5 + x6
shiupd =~ x7 + x8 + x9 + x10
'
inhupdmerge <- '
shift =~ x9 + x10
inhupd =~ x4 + x5 + x6 + x7 + x8
'
inhshimerge <- '
update =~ x7 + x8
inhshi =~ x4 + x5 + x6 + x9 + x10
'
bifactor <- '
general =~ x4 + x5 + x6 + x7 + x8 + x9 + x10
inhibit =~ x4 + x5 + x6
update =~ v1*x7 + v1*x8
shift =~ v2*x9 + v2*x10
general ~~ 0*shift
general ~~ 0*update
general ~~ 0*inhibit
shift ~~ 0*update
shift ~~ 0*inhibit
update ~~ 0*inhibit
'
binoinh <- '
general =~ x4 + x5 + x6 + x7 + x8 + x9 + x10
update =~ v1*x7 + v1*x8
shift =~ v2*x9 + v2*x10
general ~~ 0*shift
general ~~ 0*update
shift ~~ 0*update
'
# (1) Fit unidimensional model
runAndSave(sigmaBoot, N, model = unimodel, file = file,
modelName = 'unimodel')
# (2) Fit three factor model
runAndSave(sigmaBoot, N, model = multimodel, file = file,
modelName = 'multimodel')
# (3) Fit shift-update merged model
runAndSave(sigmaBoot, N, model = shiupdmerge, file = file,
modelName = 'shiupdmerge')
# (4) Fit inhibition-update merged model
runAndSave(sigmaBoot, N, model = inhupdmerge, file = file,
modelName = 'inhupdmerge')
# (5) Fit inhibition-shift merged model
runAndSave(sigmaBoot, N, model = inhshimerge, file = file,
modelName = 'inhshimerge')
# (6) Fit bifactor model
runAndSave(sigmaBoot, N, model = bifactor, file = file,
modelName = 'bifactor')
# (7) Fit bifactor model with no inhibition
runAndSave(sigmaBoot, N, model = binoinh, file = file,
modelName = 'binoinh')
\ No newline at end of file
# Location
folder = 'AranFilippetti 2013'
file = 'AranFilippetti2013'
# Paper data
N = 248
vars = c(1:9) # Which rows/columns of cor. matrix to import
Sigma = importCorMatrix(paste(folder, '/', file, '.txt', sep = ''),
vars = vars)
# Bootstrap correlation matrices
sigmaBoot = bootstrapCor(Sigma, N, samples)
# Specify Models
unimodel <- '
General =~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9
'
multimodel <- '
update =~ x1 + x2 + x3
shift =~ x4 + x5 + x6
inhibit =~ x7 + x8 + x9
'
shiupdmerge <- '
shiupd =~ x1 + x2 + x3 + x4 + x5 + x6
inhibit =~ x7 + x8 + x9
'
inhupdmerge <- '
shift =~ x4 + x5 + x6
inhupd =~ x1 + x2 + x3 + x7 + x8 + x9
'
inhshimerge <- '
update =~ x1 + x2 + x3
inhshi =~ x4 + x5 + x6 + x7 + x8 + x9
'
bifactor <- '
general =~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9
update =~ x1 + x2 + x3
shift =~ x4 + x5 + x6
inhibit =~ x7 + x8 + x9
general ~~ 0*shift
general ~~ 0*update
general ~~ 0*inhibit
shift ~~ 0*update
shift ~~ 0*inhibit
update ~~ 0*inhibit
'
binoinh <- '
general =~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9
update =~ x1 + x2 + x3
shift =~ x4 + x5 + x6
general ~~ 0*shift
general ~~ 0*update
shift ~~ 0*update
'
# (1) Fit unidimensional model
runAndSave(sigmaBoot, N, model = unimodel, file = file,
modelName = 'unimodel')
# (2) Fit three factor model
runAndSave(sigmaBoot, N, model = multimodel, file = file,
modelName = 'multimodel')
# (3) Fit shift-update merged model
runAndSave(sigmaBoot, N, model = shiupdmerge, file = file,
modelName = 'shiupdmerge')
# (4) Fit inhibition-update merged model
runAndSave(sigmaBoot, N, model = inhupdmerge, file = file,
modelName = 'inhupdmerge')
# (5) Fit inhibition-shift merged model
runAndSave(sigmaBoot, N, model = inhshimerge, file = file,
modelName = 'inhshimerge')
# (6) Fit bifactor model
runAndSave(sigmaBoot, N, model = bifactor, file = file,
modelName = 'bifactor')
# (7) Fit bifactor model with no inhibition
runAndSave(sigmaBoot, N, model = binoinh, file = file,
modelName = 'binoinh')
\ No newline at end of file
# Location
folder = 'Brydges 2012'
file = 'Brydges2012'
# Paper data
N = 215
vars = c(1:9) # Which rows/columns of cor. matrix to import
Sigma = importCorMatrix(paste(folder, '/', file, '.txt', sep = ''),
vars = vars)
# Bootstrap correlation matrices
sigmaBoot = bootstrapCor(Sigma, N, samples)
# Specify Models
uniModel <- '
General =~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9
'
multimodel <- '
inhibit =~ x1 + x2 + x3
update =~ x4 + x5 + x6
shift =~ x7 + x8 + x9
'
shiupdmerge <- '
inhibit =~ x1 + x2 + x3
shiupd =~ x4 + x5 + x6 + x7 + x8 + x9
'
inhupdmerge <- '
inhupd =~ x1 + x2 + x3 + x4 + x5 + x6
shift =~ x7 + x8 + x9
'
inhshimerge <- '
inhshi =~ x1 + x2 + x3 + x7 + x8 + x9
update =~ x4 + x5 + x6
'
bifactor <- '
general =~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9
inhibit =~ x1 + x2 + x3
update =~ x4 + x5 + x6
shift =~ x7 + x8 + x9
general ~~ 0*shift
general ~~ 0*update
general ~~ 0*inhibit
shift ~~ 0*update
shift ~~ 0*inhibit
update ~~ 0*inhibit
'
binoinh <- '
general =~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9
update =~ x4 + x5 + x6
shift =~ x7 + x8 + x9
general ~~ 0*shift
general ~~ 0*update
shift ~~ 0*update
'
# (1) Fit unidimensional model
runAndSave(sigmaBoot, N, model = unimodel, file = file,
modelName = 'unimodel')
# (2) Fit three factor model
runAndSave(sigmaBoot, N, model = multimodel, file = file,
modelName = 'multimodel')
# (3) Fit shift-update merged model
runAndSave(sigmaBoot, N, model = shiupdmerge, file = file,
modelName = 'shiupdmerge')
# (4) Fit inhibition-update merged model
runAndSave(sigmaBoot, N, model = inhupdmerge, file = file,
modelName = 'inhupdmerge')
# (5) Fit inhibition-shift merged model
runAndSave(sigmaBoot, N, model = inhshimerge, file = file,
modelName = 'inhshimerge')
# (6) Fit bifactor model
runAndSave(sigmaBoot, N, model = bifactor, file = file,
modelName = 'bifactor')
# (7) Fit bifactor model with no inhibition
runAndSave(sigmaBoot, N, model = binoinh, file = file,
modelName = 'binoinh')
\ No newline at end of file
# Location
folder = 'Duan 2010'
file = 'Duan2010'
# Paper data
N = 61