> setwd("C:/Users/Balazsi Robert/Desktop/Danila Ingrid PhD/MASEM") > data <- read.table(file = "metaSEM4.dat", header = TRUE) > head(data) Study N v1_v2 v1_v3 v1_v4 v1_v5 v1_v6 v2_v3 v2_v4 v2_v5 v2_v6 v3_v4 v3_v5 1 1 174 NA NA NA NA NA NA NA NA NA NA 0.24 2 2 445 NA NA NA NA NA NA 0.58 NA NA NA NA 3 3 32 NA NA NA NA NA NA NA NA NA NA NA 4 4 33 NA NA NA NA NA NA NA NA NA NA NA 5 5 39 NA NA NA NA NA NA NA NA NA NA 0.73 6 6 39 NA NA NA NA NA NA NA NA NA NA 0.59 v3_v6 v4_v5 v4_v6 v5_v6 1 NA NA NA NA 2 NA 0.40 NA NA 3 NA 0.50 NA NA 4 NA 0.04 NA NA 5 NA NA NA NA 6 NA NA NA NA > local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE) + if(nchar(pkg)) library(pkg, character.only=TRUE)}) Loading required package: OpenMx Notice: R GUI cannot display verbose output from the OpenMx backend. If you need detail diagnostics then R CMD BATCH is one option. "SLSQP" is set as the default optimizer in OpenMx. mxOption(NULL, "Gradient algorithm") is set at "central". mxOption(NULL, "Optimality tolerance") is set at "6.3e-14". mxOption(NULL, "Gradient iterations") is set at "2". > local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE) + if(nchar(pkg)) library(pkg, character.only=TRUE)}) > nvar <- 6 > varnames <- c("v1 ","v2","v3","v4","v5","v6") > labels <- list(varnames,varnames) > cordat <- list() > for (i in 1:nrow(data)){ + cordat[[i]] <- vec2symMat(as.matrix(data[i,3:17]), + diag = FALSE) + dimnames(cordat[[i]]) <- labels + } > for (i in 1:length(cordat)){ + for (j in 1:nrow(cordat[[i]])){ + if (sum(is.na(cordat[[i]][j,]))==nvar-1) + {cordat[[i]][j,j] <- NA} + }} > cordat[[23]] v1 v2 v3 v4 v5 v6 v1 NA NA NA NA NA NA v2 NA NA NA NA NA NA v3 NA NA 1.0 NA 0.4 NA v4 NA NA NA NA NA NA v5 NA NA 0.4 NA 1.0 NA v6 NA NA NA NA NA NA > for (i in 1:length(cordat)){ + for (j in 1:nrow(cordat[[i]])){ + for (k in 1:nvar){ + if (is.na(cordat[[i]][j,k])==TRUE + &is.na(cordat[[i]][j,j])!=TRUE + &is.na(cordat[[i]][k,k])!=TRUE){ + if(sum(is.na(cordat[[i]])[j,])>sum(is.na(cordat[[i]])[k,])) + {cordat[[i]][k,k] <- NA} + if(sum(is.na(cordat[[i]])[j,])<=sum(is.na(cordat[[i]])[k,])) + {cordat[[i]][j,j] <- NA} + }}}} > stage1fixed <- tssem1(Cov=cordat, n=data$N, method="REM", RE.type="Zero") > summary(stage1fixed) Call: meta(y = ES, v = acovR, RE.constraints = matrix(0, ncol = no.es, nrow = no.es), I2 = I2, model.name = model.name, suppressWarnings = TRUE, silent = silent, run = run) 95% confidence intervals: z statistic approximation (robust=FALSE) Coefficients: Estimate Std.Error lbound ubound z value Pr(>|z|) Intercept1 0.0323434 0.0381893 -0.0425062 0.1071931 0.8469 0.39704 Intercept2 -0.0327987 0.0404557 -0.1120904 0.0464930 -0.8107 0.41752 Intercept3 0.4909837 0.0460739 0.4006806 0.5812869 10.6564 < 2.2e-16 *** Intercept4 0.1166395 0.0245911 0.0684419 0.1648371 4.7432 2.104e-06 *** Intercept5 0.0495022 0.0339221 -0.0169839 0.1159884 1.4593 0.14449 Intercept6 0.1211936 0.0104124 0.1007856 0.1416016 11.6393 < 2.2e-16 *** Intercept7 0.2374614 0.0170291 0.2040849 0.2708379 13.9444 < 2.2e-16 *** Intercept8 0.2036875 0.0031306 0.1975516 0.2098235 65.0629 < 2.2e-16 *** Intercept9 0.2876152 0.0198609 0.2486886 0.3265419 14.4815 < 2.2e-16 *** Intercept10 0.1384892 0.0265240 0.0865030 0.1904753 5.2213 1.777e-07 *** Intercept11 0.2243523 0.0082240 0.2082335 0.2404711 27.2801 < 2.2e-16 *** Intercept12 0.1590599 0.0434322 0.0739343 0.2441855 3.6623 0.00025 *** Intercept13 0.2552796 0.0104681 0.2347626 0.2757967 24.3865 < 2.2e-16 *** Intercept14 -0.1041630 0.0227442 -0.1487408 -0.0595852 -4.5798 4.655e-06 *** Intercept15 0.3580802 0.0218200 0.3153138 0.4008466 16.4107 < 2.2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Q statistic on the homogeneity of effect sizes: 2673.114 Degrees of freedom of the Q statistic: 423 P value of the Q statistic: 0 Heterogeneity indices (based on the estimated Tau2): Estimate Intercept1: I2 (Q statistic) 0 Intercept2: I2 (Q statistic) 0 Intercept3: I2 (Q statistic) 0 Intercept4: I2 (Q statistic) 0 Intercept5: I2 (Q statistic) 0 Intercept6: I2 (Q statistic) 0 Intercept7: I2 (Q statistic) 0 Intercept8: I2 (Q statistic) 0 Intercept9: I2 (Q statistic) 0 Intercept10: I2 (Q statistic) 0 Intercept11: I2 (Q statistic) 0 Intercept12: I2 (Q statistic) 0 Intercept13: I2 (Q statistic) 0 Intercept14: I2 (Q statistic) 0 Intercept15: I2 (Q statistic) 0 Number of studies (or clusters): 379 Number of observed statistics: 438 Number of estimated parameters: 15 Degrees of freedom: 423 -2 log likelihood: 1179.348 OpenMx status1: 0 ("0" or "1": The optimization is considered fine. Other values may indicate problems.) > stage1random <- tssem1(Cov=cordat, n=data$N, method="REM") > stage1random <- rerun(stage1random, autofixtau2 = TRUE) Begin fit attempt 1 of at maximum 11 tries Lowest minimum so far: -341.750609685034 Not all eigenvalues of Hessian are greater than 0: 401135.766485501, 147491.642292877, 76762.6820590511, 74843.4882543719, 62777.1562244458, 44335.6100819248, 38502.3777684483, 23947.1411742816, 18452.525924871, 5979.86979859875, 4714.61357704728, 3445.7116737119, 3340.70878584407, 3220.63796595462, 3181.01557772709, 2917.40648243572, 1748.07972798757, 1642.69488566568, 1405.89180047284, 942.816247102522, 748.482071525455, 637.042458978782, 610.199375582047, 600.155376686676, 576.220774467432, 225.501157096866, 165.443235217925, 124.685780535435, 69.3735855394394, -20930.3104578966 Begin fit attempt 2 of at maximum 11 tries Lowest minimum so far: -341.750609685235 Not all eigenvalues of Hessian are greater than 0: 401135.756732716, 147491.969067704, 76762.617577403, 74843.6934778577, 62777.0760451199, 44335.6035963334, 38502.3670638203, 23947.0946670854, 18452.5239588507, 5979.92984770164, 4714.61385145563, 3445.71318872455, 3340.71027217188, 3220.62134429139, 3181.00715889477, 2917.36127295264, 1748.07728971588, 1642.69514475724, 1405.88960465813, 942.815624645014, 748.480672673703, 637.044976906126, 610.200829220211, 600.154500183163, 576.220504213389, 225.500903875636, 165.442811046334, 124.686262988419, 69.3735515776133, -20930.4528959668 Begin fit attempt 3 of at maximum 11 tries Lowest minimum so far: -341.750609685235 Not all eigenvalues of Hessian are greater than 0: 401135.754719235, 147491.973856699, 76762.6181284223, 74843.6800255883, 62777.0803373781, 44335.6079398819, 38502.3701876103, 23947.0922552411, 18452.5175647042, 5979.92988525657, 4714.61333513883, 3445.71317324868, 3340.71136048127, 3220.62370178011, 3181.01408779869, 2917.36032294099, 1748.07615272566, 1642.69426039609, 1405.89176574989, 942.816718908979, 748.481138673943, 637.045784617792, 610.200715621848, 600.156598501633, 576.220074194986, 225.499938048627, 165.444305830776, 124.688748869536, 69.3745446197951, -20930.4538087964 Begin fit attempt 4 of at maximum 11 tries Lowest minimum so far: -341.750609685357 Not all eigenvalues of Hessian are greater than 0: 401136.086038172, 147492.08334033, 76762.4671356801, 74843.5888606563, 62777.1568286139, 44335.5835949757, 38502.3983959412, 23947.0921702799, 18452.5261156132, 5979.90795167221, 4714.619757701, 3445.71351086272, 3340.71101185822, 3220.5973132978, 3181.00890046303, 2917.35910152314, 1748.08212463845, 1642.69816191398, 1405.89013676005, 942.816967376605, 748.482677303217, 637.053029911522, 610.206691499388, 600.155431009702, 576.220884396495, 225.502880934348, 165.445750180422, 124.686601190807, 69.3755143323382, -20930.6675777154 Begin fit attempt 5 of at maximum 11 tries Lowest minimum so far: -341.75060968538 Not all eigenvalues of Hessian are greater than 0: 401135.751783187, 147491.980681533, 76762.4509826454, 74843.5050418444, 62777.1389790033, 44335.6335435082, 38502.5194124259, 23947.1280618859, 18452.5278910956, 5979.91362740686, 4714.60595835553, 3445.71206881504, 3340.71129325572, 3220.60355881313, 3181.0141385856, 2917.34303300459, 1748.07617285602, 1642.69249446244, 1405.89045275894, 942.817199795524, 748.478630774194, 637.051491849946, 610.206124451798, 600.153545126075, 576.219749431108, 225.500667901664, 165.441820395684, 124.68507886038, 69.3745582578473, -20930.5801502737 Begin fit attempt 6 of at maximum 11 tries Not all eigenvalues of Hessian are greater than 0: 401135.948126867, 147490.910563995, 76762.4390935607, 74843.5505243882, 62776.9465632033, 44335.5931144805, 38502.3394420317, 23947.1060985887, 18452.530301861, 5979.92514709227, 4714.59571193629, 3445.70629444192, 3340.70854859188, 3220.58967024104, 3181.00876975495, 2917.34445269084, 1748.07536130853, 1642.69727345371, 1405.88984934508, 942.817037961959, 748.480223077957, 637.053565185913, 610.205829148671, 600.154455207143, 576.221209353417, 225.500475339258, 165.443988482314, 124.68808176712, 69.3735980672823, -20930.7014253164 Begin fit attempt 7 of at maximum 11 tries Not all eigenvalues of Hessian are greater than 0: 401134.514136244, 147490.644210928, 76762.5175871949, 74843.839774123, 62777.140811428, 44335.4060769019, 38501.9141661877, 23946.9568258756, 18452.5104875984, 5979.96965727565, 4714.54897514492, 3445.7064139889, 3340.71209147942, 3220.54902238214, 3181.00297464184, 2917.34084036642, 1748.08024237982, 1642.69530676678, 1405.88663954452, 942.821829744656, 748.481603085314, 637.056926745066, 610.262266158843, 600.15237345553, 576.224251131308, 225.501059937777, 165.443238139375, 124.688522705983, 69.3782229272134, -20931.1006886481 Begin fit attempt 8 of at maximum 11 tries Not all eigenvalues of Hessian are greater than 0: 401135.732435894, 147491.987703544, 76762.9404392006, 74843.3893508612, 62777.3143544673, 44335.5470496157, 38502.6240219005, 23947.1197921776, 18452.5246231592, 5979.93488711806, 4714.6081131833, 3445.71040681087, 3340.7071611495, 3220.59372240145, 3181.01162921857, 2917.34077384471, 1748.07771452756, 1642.69568887736, 1405.89135947186, 942.812378384332, 748.477350684427, 637.051230703143, 610.202297101965, 600.155983977258, 576.219374111169, 225.50004611645, 165.443229737488, 124.686138864112, 69.3739454968549, -20930.6421060266 Begin fit attempt 9 of at maximum 11 tries Not all eigenvalues of Hessian are greater than 0: 401135.677926193, 147492.159869093, 76762.4008921927, 74843.5297579623, 62777.1144163583, 44335.6054376889, 38502.4270218287, 23947.1167794855, 18452.5313224534, 5979.92078988594, 4714.62505703229, 3445.71524867822, 3340.71333878088, 3220.62657326068, 3181.01368032723, 2917.35646920826, 1748.07913003944, 1642.69731922739, 1405.89205098157, 942.821128069227, 748.481852333331, 637.052212040096, 610.200501054725, 600.157756323718, 576.224695413342, 225.501984613969, 165.447026777084, 124.687580102905, 69.3746789576363, -20930.4121342282 Begin fit attempt 10 of at maximum 11 tries Not all eigenvalues of Hessian are greater than 0: 401135.763665184, 147483.94995723, 76762.5999335724, 74843.8555567297, 62776.7078121771, 44335.7907329943, 38502.5324977882, 23946.9657234694, 18452.5300243534, 5979.9136572331, 4714.47055996763, 3445.67016061655, 3340.71334029762, 3220.67823743617, 3181.01334432445, 2917.46373425258, 1748.0735970073, 1642.69197199172, 1405.89253133406, 942.802206087301, 748.480540915794, 637.029447447799, 610.206723663887, 600.151632987041, 576.221395029063, 225.502783150368, 165.443210415884, 124.686621777822, 69.3759791079228, -20929.9834003103 Begin fit attempt 11 of at maximum 11 tries Not all eigenvalues of Hessian are greater than 0: 401136.118354956, 147488.859139151, 76762.6698480127, 74843.555374251, 62777.2264392392, 44335.6135222322, 38502.5498937907, 23947.1082925976, 18452.5345058504, 5979.88848597988, 4714.62711700059, 3445.69921472299, 3340.70924507615, 3220.61639158548, 3181.01551654022, 2917.35186483636, 1748.08209485691, 1642.69719386446, 1405.89320203318, 942.803473979261, 748.480832507581, 637.049919938583, 610.206001893859, 600.15780775596, 576.221165902904, 225.50188259463, 165.444350645592, 124.688181522325, 69.3755493830394, -20930.494300112 Retry limit reached Begin fit attempt 1 of at maximum 11 tries Lowest minimum so far: -341.750609718 Solution found > summary(stage1random) Call: meta(y = ES, v = acovR, RE.constraints = Diag(paste0(RE.startvalues, "*Tau2_", 1:no.es, "_", 1:no.es)), RE.lbound = RE.lbound, I2 = I2, model.name = model.name, suppressWarnings = TRUE, silent = silent, run = run) 95% confidence intervals: z statistic approximation (robust=FALSE) Coefficients: Estimate Std.Error lbound ubound z value Pr(>|z|) Intercept1 3.5674e-02 3.8227e-02 -3.9248e-02 1.1060e-01 0.9332 0.350700 Intercept2 1.0534e-01 1.6971e-01 -2.2728e-01 4.3797e-01 0.6207 0.534778 Intercept3 4.9244e-01 5.1627e-02 3.9126e-01 5.9363e-01 9.5385 < 2.2e-16 *** Intercept4 7.9443e-02 5.8848e-02 -3.5898e-02 1.9478e-01 1.3500 0.177029 Intercept5 1.4851e-01 1.0990e-01 -6.6902e-02 3.6391e-01 1.3512 0.176622 Intercept6 1.3393e-01 2.4096e-02 8.6707e-02 1.8116e-01 5.5583 2.724e-08 *** Intercept7 2.2790e-01 3.4890e-02 1.5952e-01 2.9629e-01 6.5320 6.491e-11 *** Intercept8 2.1995e-01 1.0410e-02 1.9954e-01 2.4035e-01 21.1278 < 2.2e-16 *** Intercept9 2.8060e-01 3.7708e-02 2.0669e-01 3.5450e-01 7.4412 9.970e-14 *** Intercept10 1.6877e-01 9.4175e-02 -1.5815e-02 3.5335e-01 1.7920 0.073128 . Intercept11 3.1030e-01 2.5045e-02 2.6122e-01 3.5939e-01 12.3899 < 2.2e-16 *** Intercept12 1.2881e-01 1.2664e-01 -1.1941e-01 3.7702e-01 1.0171 0.309116 Intercept13 2.6362e-01 2.4469e-02 2.1567e-01 3.1158e-01 10.7739 < 2.2e-16 *** Intercept14 -5.7899e-02 5.7696e-02 -1.7098e-01 5.5183e-02 -1.0035 0.315613 Intercept15 3.5509e-01 3.3831e-02 2.8878e-01 4.2139e-01 10.4959 < 2.2e-16 *** Tau2_2_2 5.1881e-02 5.7494e-02 -6.0805e-02 1.6457e-01 0.9024 0.366859 Tau2_3_3 1.0000e-10 5.7266e-03 -1.1224e-02 1.1224e-02 0.0000 1.000000 Tau2_4_4 3.5346e-02 1.8504e-02 -9.2210e-04 7.1614e-02 1.9101 0.056116 . Tau2_5_5 7.2718e-02 4.6164e-02 -1.7762e-02 1.6320e-01 1.5752 0.115209 Tau2_6_6 8.1903e-03 3.7012e-03 9.3598e-04 1.5445e-02 2.2128 0.026908 * Tau2_7_7 1.9862e-02 9.1421e-03 1.9439e-03 3.7780e-02 2.1726 0.029810 * Tau2_8_8 1.7525e-02 2.2351e-03 1.3144e-02 2.1906e-02 7.8408 4.441e-15 *** Tau2_9_9 1.2313e-02 7.2248e-03 -1.8471e-03 2.6474e-02 1.7043 0.088325 . Tau2_10_10 3.0139e-02 2.6186e-02 -2.1185e-02 8.1463e-02 1.1509 0.249754 Tau2_11_11 2.6842e-02 6.8011e-03 1.3512e-02 4.0172e-02 3.9466 7.926e-05 *** Tau2_12_12 8.4209e-02 5.6044e-02 -2.5635e-02 1.9405e-01 1.5026 0.132954 Tau2_13_13 1.5596e-02 5.1774e-03 5.4482e-03 2.5743e-02 3.0123 0.002593 ** Tau2_14_14 4.3752e-02 2.0684e-02 3.2112e-03 8.4293e-02 2.1152 0.034412 * Tau2_15_15 9.6711e-03 5.6447e-03 -1.3923e-03 2.0735e-02 1.7133 0.086657 . --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Q statistic on the homogeneity of effect sizes: 2673.115 Degrees of freedom of the Q statistic: 423 P value of the Q statistic: 0 Heterogeneity indices (based on the estimated Tau2): Estimate Intercept1: I2 (Q statistic) 0.0000 Intercept2: I2 (Q statistic) 0.9474 Intercept3: I2 (Q statistic) 0.0000 Intercept4: I2 (Q statistic) 0.9246 Intercept5: I2 (Q statistic) 0.9619 Intercept6: I2 (Q statistic) 0.7398 Intercept7: I2 (Q statistic) 0.8733 Intercept8: I2 (Q statistic) 0.8643 Intercept9: I2 (Q statistic) 0.8104 Intercept10: I2 (Q statistic) 0.9127 Intercept11: I2 (Q statistic) 0.9032 Intercept12: I2 (Q statistic) 0.9669 Intercept13: I2 (Q statistic) 0.8441 Intercept14: I2 (Q statistic) 0.9382 Intercept15: I2 (Q statistic) 0.7705 Number of studies (or clusters): 379 Number of observed statistics: 438 Number of estimated parameters: 29 Degrees of freedom: 409 -2 log likelihood: -341.7506 OpenMx status1: 0 ("0" or "1": The optimization is considered fine. Other values may indicate problems.) > A<-create.mxMatrix (c(0,0,0,0,0,0 + ,0,0,0,0,0,0, + 0,0,0,0,0,0, + "0.1*b41","0.1*b42",0,0,0,0, + 0,0,"0.1*b53","0.1*b54",0,0, + 0,0,"0.1*b63","0.1*b64",0,0), + type = "Full", + nrow = 6, + ncol = 6, + byrow = TRUE, + name = "A", + dimnames = list(varnames,varnames)) > S <- create.mxMatrix( + c(1, + ".1*p21",1, + ".1*p31",".1*p32",1, + 0,0,0,"1*p44", + 0,0,0,0,"1*p55", + 0,0,0,0,0,"1*p66"), + type="Symm", byrow = TRUE, name="S", + dimnames = list(varnames,varnames)) > stage2 <- tssem2(stage1random, Amatrix=A, Smatrix=S, + diag.constraints=TRUE, intervals="LB") > summary(stage2) Call: wls(Cov = pooledS, aCov = aCov, n = tssem1.obj$total.n, RAM = RAM, Amatrix = Amatrix, Smatrix = Smatrix, Fmatrix = Fmatrix, diag.constraints = diag.constraints, cor.analysis = cor.analysis, intervals.type = intervals.type, mx.algebras = mx.algebras, model.name = model.name, suppressWarnings = suppressWarnings, silent = silent, run = run) 95% confidence intervals: Likelihood-based statistic Coefficients: Estimate Std.Error lbound ubound z value Pr(>|z|) b41 0.545375 NA 0.443231 0.643556 NA NA b42 0.301757 NA 0.229139 0.373566 NA NA b53 0.406601 NA 0.352499 0.465240 NA NA b54 0.364212 NA 0.306955 0.426769 NA NA b63 0.645279 NA 0.505138 0.790274 NA NA b64 0.194000 NA 0.068459 0.311904 NA NA p21 0.036556 NA -0.039313 0.112411 NA NA p31 -0.331147 NA -0.491287 -0.153819 NA NA p32 0.197413 NA 0.152892 0.241686 NA NA p44 0.599476 NA 0.482075 0.702072 NA NA p55 0.737872 NA 0.688453 0.780029 NA NA p66 0.576281 NA 0.374410 0.727654 NA NA Goodness-of-fit indices: Value Sample size 1.3240e+05 Chi-square of target model 8.3600e+01 DF of target model 6.0000e+00 p value of target model 0.0000e+00 Number of constraints imposed on "Smatrix" 3.0000e+00 DF manually adjusted 0.0000e+00 Chi-square of independence model 1.0520e+03 DF of independence model 1.5000e+01 RMSEA 9.9000e-03 RMSEA lower 95% CI 8.1000e-03 RMSEA upper 95% CI 1.1800e-02 SRMR 2.0770e-01 TLI 8.1290e-01 CFI 9.2520e-01 AIC 7.1600e+01 BIC 1.2838e+01 OpenMx status1: 6 ("0" or "1": The optimization is considered fine. Other values indicate problems.) Warning message: In print.summary.wls(x) : OpenMx status1 is neither 0 or 1. You are advised to 'rerun' it again.