R version 3.1.0 (2014-04-10) -- "Spring Dance" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. [Previously saved workspace restored] > ## library(metaSEM) > > ## ## Clear all objects > ## rm(list=ls()) > > ## my.df <- wvs94a[, 2:6] > > ## ## Run a random effects model with two effect sizes > ## metaSEM.fit <- meta(y=cbind(lifesat, lifecon), v=cbind(lifesat_var, inter_cov, lifecon_var), > ## data=my.df, intervals.type="LB") > > ## ## Get the OpenMx model > ## metaSEM.model <- metaSEM.fit$mx.model > ## save(metaSEM.fit, metaSEM.model, my.df, file="test4b.txt") > > ## Version ‘2.0.0.3575’ > library(OpenMx) Loading required package: digest Loading required package: MASS > > sessionInfo() R version 3.1.0 (2014-04-10) Platform: i686-pc-linux-gnu (32-bit) locale: [1] LC_CTYPE=en_SG.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_SG.UTF-8 LC_COLLATE=en_SG.UTF-8 [5] LC_MONETARY=en_SG.UTF-8 LC_MESSAGES=en_SG.UTF-8 [7] LC_PAPER=en_SG.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_SG.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] OpenMx_2.0.0-3575 MASS_7.3-33 digest_0.6.4 > > ## Clear all objects > rm(list=ls()) > > ## Load the workspace > load("test4b.txt") > > ## Fit the same model by using OpenMx syntax > Tau <- mxMatrix(type="Symm", nrow=2, ncol=2, + free=c(TRUE,TRUE,TRUE), + values=c(0.1,0,0.1), + labels=c("Tau2_1_1","Tau2_2_1","Tau2_2_2"), name="Tau") > V <- mxMatrix(type="Symm", nrow=2, ncol=2, + free=FALSE, + values=0, + labels=c("data.lifesat_var","data.inter_cov","data.lifecon_var"), name="V") > Inter <- mxMatrix(type="Full", nrow=1, ncol=2, + free=TRUE, + values=0, + labels=c("Intercept1","Intercept2"), name="Inter") > F <- mxMatrix("Iden", nrow=2, ncol=2, name="F") > S <- mxAlgebra(Tau+V, name="S") > > my.model <- mxModel("Test", mxData(observed=my.df, type="raw"), + Tau, V, Inter, S, F, + mxExpectationNormal(covariance="S", means="Inter", dimnames=c("lifesat","lifecon")), + mxFitFunctionML(), mxCI(c("Tau","Inter"))) > > ###### Use CSOLNP > mxOption(NULL, "Default optimizer", "CSOLNP") > > ## It seems fine. > metaSEM.fit <- mxRun(metaSEM.model, intervals=TRUE) Running Meta analysis with ML > summary(metaSEM.fit) compute plan: MxComputeSequence 'compute' $freeSet : '.' steps[[ 1 ]] : MxComputeGradientDescent 'compute' $freeSet : '.' $engine : 'CSOLNP' $fitfunction : 'Meta analysis with ML.fitfunction' $verbose : 0 steps[[ 2 ]] : MxComputeConfidenceInterval 'compute' $freeSet : '.' $fitfunction : 'Meta analysis with ML.fitfunction' $engine : 'CSOLNP' $verbose : 0 steps[[ 3 ]] : MxComputeNumericDeriv 'compute' $freeSet : '.' $fitfunction : 'Meta analysis with ML.fitfunction' $parallel : TRUE $stepSize : 1e-04 $iterations : 4 $verbose : 0 steps[[ 4 ]] : MxComputeStandardError 'compute' $freeSet : '.' steps[[ 5 ]] : MxComputeReportDeriv 'compute' $freeSet : '.' data: $`Meta analysis with ML.data` y1 y2 v1_1 Min. :-0.240771 Min. :-0.202496 Min. :0.0009759 1st Qu.:-0.051236 1st Qu.:-0.002484 1st Qu.:0.0026742 Median : 0.005547 Median : 0.062590 Median :0.0039066 Mean :-0.003229 Mean : 0.070275 Mean :0.0036440 3rd Qu.: 0.055480 3rd Qu.: 0.157132 3rd Qu.:0.0040524 Max. : 0.172248 Max. : 0.313889 Max. :0.0134946 v2_1 v2_2 Min. :-9.750e-06 Min. :0.001000 1st Qu.: 9.443e-04 1st Qu.:0.002694 Median : 1.186e-03 Median :0.003924 Mean : 1.255e-03 Mean :0.003706 3rd Qu.: 1.537e-03 3rd Qu.:0.004157 Max. : 4.563e-03 Max. :0.013636 free parameters: name matrix row col Estimate Std.Error lbound ubound 1 Intercept1 Inter 1 1 0.001350474 NA 2 Intercept2 Inter 2 1 0.068825949 NA 3 Tau2_1_1 Tau 1 1 0.004727034 NA 1e-10 4 Tau2_2_1 Tau 1 2 0.003934128 NA 5 Tau2_2_2 Tau 2 2 0.008413367 NA 1e-10 confidence intervals: lbound estimate ubound Tau2_1_1 0.003992985 0.004727034 0.004719428 Tau2_2_1 0.001193059 0.003934128 0.005295336 Tau2_2_2 0.004601985 0.008413367 0.008409501 Intercept1 -0.026791135 0.001350474 0.028866220 Intercept2 0.035016079 0.068825949 0.102484191 Meta analysis with ML.I2_values[1,1] 0.412685501 0.612864977 0.760773746 Meta analysis with ML.I2_values[2,1] 0.601942842 0.734520807 0.833685702 observed statistics: 84 estimated parameters: 5 degrees of freedom: 79 -2 log likelihood: -161.9216 saturated -2 log likelihood: NA number of observations: 42 chi-square (degrees of freedom): NA ( df = NA ) p: NA Information Criteria: df Penalty Parameters Penalty Sample-Size Adjusted AIC: -319.9216 -151.9216 NA BIC: -457.1975 -143.2332 -158.8909 CFI: NA TLI: NA RMSEA: NA timestamp: 2014-06-18 21:02:00 frontend time: 0.1132936 secs backend time: 0.5718133 secs independent submodels time: 7.581711e-05 secs wall clock time: 0.6851828 secs cpu time: 0.6851828 secs OpenMx version number: 2.0.0.3575 > > ## It seems fine. > my.fit <- mxRun(my.model, intervals=T) Running Test > summary(my.fit) compute plan: MxComputeSequence 'compute' $freeSet : '.' steps[[ 1 ]] : MxComputeGradientDescent 'compute' $freeSet : '.' $engine : 'CSOLNP' $fitfunction : 'Test.fitfunction' $verbose : 0 steps[[ 2 ]] : MxComputeConfidenceInterval 'compute' $freeSet : '.' $fitfunction : 'Test.fitfunction' $engine : 'CSOLNP' $verbose : 0 steps[[ 3 ]] : MxComputeNumericDeriv 'compute' $freeSet : '.' $fitfunction : 'Test.fitfunction' $parallel : TRUE $stepSize : 1e-04 $iterations : 4 $verbose : 0 steps[[ 4 ]] : MxComputeStandardError 'compute' $freeSet : '.' steps[[ 5 ]] : MxComputeReportDeriv 'compute' $freeSet : '.' data: $Test.data lifesat lifecon lifesat_var Min. :-0.240771 Min. :-0.202496 Min. :0.0009759 1st Qu.:-0.051236 1st Qu.:-0.002484 1st Qu.:0.0026742 Median : 0.005547 Median : 0.062590 Median :0.0039066 Mean :-0.003229 Mean : 0.070275 Mean :0.0036440 3rd Qu.: 0.055480 3rd Qu.: 0.157132 3rd Qu.:0.0040524 Max. : 0.172248 Max. : 0.313889 Max. :0.0134946 inter_cov lifecon_var Min. :-9.750e-06 Min. :0.001000 1st Qu.: 9.443e-04 1st Qu.:0.002694 Median : 1.186e-03 Median :0.003924 Mean : 1.255e-03 Mean :0.003706 3rd Qu.: 1.537e-03 3rd Qu.:0.004157 Max. : 4.563e-03 Max. :0.013636 free parameters: name matrix row col Estimate Std.Error lbound ubound 1 Tau2_1_1 Tau 1 1 0.004727072 0.001761483 2 Tau2_2_1 Tau 1 2 0.003934104 0.001686961 3 Tau2_2_2 Tau 2 2 0.008413343 0.002537157 4 Intercept1 Inter 1 lifesat 0.001350137 0.013856120 5 Intercept2 Inter 1 lifecon 0.068825954 0.016819429 confidence intervals: lbound estimate ubound Tau2_1_1 0.002101851 0.004727072 0.009489468 Tau2_2_1 0.001193122 0.003934104 0.007206854 Tau2_2_2 0.004601967 0.008413343 0.015237175 Intercept1 -0.026791123 0.001350137 0.028866216 Intercept2 0.035016082 0.068825954 0.102484186 observed statistics: 84 estimated parameters: 5 degrees of freedom: 79 -2 log likelihood: -161.9216 saturated -2 log likelihood: NA number of observations: 42 chi-square (degrees of freedom): NA ( df = NA ) p: NA Information Criteria: df Penalty Parameters Penalty Sample-Size Adjusted AIC: -319.9216 -151.9216 NA BIC: -457.1975 -143.2332 -158.8909 CFI: NA TLI: NA RMSEA: NA timestamp: 2014-06-18 21:02:01 frontend time: 0.03511882 secs backend time: 0.4441009 secs independent submodels time: 2.551079e-05 secs wall clock time: 0.4792452 secs cpu time: 0.4792452 secs OpenMx version number: 2.0.0.3575 > > > > ###### Use NPSOL > mxOption(NULL, "Default optimizer", "NPSOL") > > ## It seems fine. > my.fit <- mxRun(my.model, intervals=T) Running Test > summary(my.fit) compute plan: MxComputeSequence 'compute' $freeSet : '.' steps[[ 1 ]] : MxComputeGradientDescent 'compute' $freeSet : '.' $engine : 'NPSOL' $fitfunction : 'Test.fitfunction' $verbose : 0 steps[[ 2 ]] : MxComputeConfidenceInterval 'compute' $freeSet : '.' $fitfunction : 'Test.fitfunction' $engine : 'NPSOL' $verbose : 0 steps[[ 3 ]] : MxComputeNumericDeriv 'compute' $freeSet : '.' $fitfunction : 'Test.fitfunction' $parallel : TRUE $stepSize : 1e-04 $iterations : 4 $verbose : 0 steps[[ 4 ]] : MxComputeStandardError 'compute' $freeSet : '.' steps[[ 5 ]] : MxComputeReportDeriv 'compute' $freeSet : '.' data: $Test.data lifesat lifecon lifesat_var Min. :-0.240771 Min. :-0.202496 Min. :0.0009759 1st Qu.:-0.051236 1st Qu.:-0.002484 1st Qu.:0.0026742 Median : 0.005547 Median : 0.062590 Median :0.0039066 Mean :-0.003229 Mean : 0.070275 Mean :0.0036440 3rd Qu.: 0.055480 3rd Qu.: 0.157132 3rd Qu.:0.0040524 Max. : 0.172248 Max. : 0.313889 Max. :0.0134946 inter_cov lifecon_var Min. :-9.750e-06 Min. :0.001000 1st Qu.: 9.443e-04 1st Qu.:0.002694 Median : 1.186e-03 Median :0.003924 Mean : 1.255e-03 Mean :0.003706 3rd Qu.: 1.537e-03 3rd Qu.:0.004157 Max. : 4.563e-03 Max. :0.013636 free parameters: name matrix row col Estimate Std.Error lbound ubound 1 Tau2_1_1 Tau 1 1 0.004727256 0.001761564 2 Tau2_2_1 Tau 1 2 0.003934366 0.001687060 3 Tau2_2_2 Tau 2 2 0.008413606 0.002537273 4 Intercept1 Inter 1 lifesat 0.001349849 0.013856283 5 Intercept2 Inter 1 lifecon 0.068825745 0.016819620 confidence intervals: lbound estimate ubound Tau2_1_1 0.002101886 0.004727256 0.009489518 Tau2_2_1 0.001193098 0.003934366 0.008349170 Tau2_2_2 0.004602016 0.008413606 0.015237216 Intercept1 -0.026791086 0.001349849 0.028866270 Intercept2 0.035020264 0.068825745 0.102484250 observed statistics: 84 estimated parameters: 5 degrees of freedom: 79 -2 log likelihood: -161.9216 saturated -2 log likelihood: NA number of observations: 42 chi-square (degrees of freedom): NA ( df = NA ) p: NA Information Criteria: df Penalty Parameters Penalty Sample-Size Adjusted AIC: -319.9216 -151.9216 NA BIC: -457.1975 -143.2332 -158.8909 CFI: NA TLI: NA RMSEA: NA timestamp: 2014-06-18 21:02:02 frontend time: 0.03487968 secs backend time: 0.4247324 secs independent submodels time: 2.241135e-05 secs wall clock time: 0.4596345 secs cpu time: 0.4596345 secs OpenMx version number: 2.0.0.3575 > > ## No CI reported. > metaSEM.fit <- mxRun(metaSEM.model, intervals=TRUE) Running Meta analysis with ML > summary(metaSEM.fit) compute plan: MxComputeSequence 'compute' $freeSet : '.' steps[[ 1 ]] : MxComputeGradientDescent 'compute' $freeSet : '.' $engine : 'NPSOL' $fitfunction : 'Meta analysis with ML.fitfunction' $verbose : 0 steps[[ 2 ]] : MxComputeConfidenceInterval 'compute' $freeSet : '.' $fitfunction : 'Meta analysis with ML.fitfunction' $engine : 'NPSOL' $verbose : 0 steps[[ 3 ]] : MxComputeNumericDeriv 'compute' $freeSet : '.' $fitfunction : 'Meta analysis with ML.fitfunction' $parallel : TRUE $stepSize : 1e-04 $iterations : 4 $verbose : 0 steps[[ 4 ]] : MxComputeStandardError 'compute' $freeSet : '.' steps[[ 5 ]] : MxComputeReportDeriv 'compute' $freeSet : '.' data: $`Meta analysis with ML.data` y1 y2 v1_1 Min. :-0.240771 Min. :-0.202496 Min. :0.0009759 1st Qu.:-0.051236 1st Qu.:-0.002484 1st Qu.:0.0026742 Median : 0.005547 Median : 0.062590 Median :0.0039066 Mean :-0.003229 Mean : 0.070275 Mean :0.0036440 3rd Qu.: 0.055480 3rd Qu.: 0.157132 3rd Qu.:0.0040524 Max. : 0.172248 Max. : 0.313889 Max. :0.0134946 v2_1 v2_2 Min. :-9.750e-06 Min. :0.001000 1st Qu.: 9.443e-04 1st Qu.:0.002694 Median : 1.186e-03 Median :0.003924 Mean : 1.255e-03 Mean :0.003706 3rd Qu.: 1.537e-03 3rd Qu.:0.004157 Max. : 4.563e-03 Max. :0.013636 free parameters: name matrix row col Estimate Std.Error lbound ubound 1 Intercept1 Inter 1 1 0.001349849 0.013856283 2 Intercept2 Inter 2 1 0.068825745 0.016819619 3 Tau2_1_1 Tau 1 1 0.004727256 0.001761563 1e-10 4 Tau2_2_1 Tau 1 2 0.003934366 0.001687059 5 Tau2_2_2 Tau 2 2 0.008413606 0.002537273 1e-10 confidence intervals: lbound estimate ubound Tau2_1_1 NA 0.004727256 NA Tau2_2_1 NA 0.003934366 NA Tau2_2_2 NA 0.008413606 NA Intercept1 NA 0.001349849 NA Intercept2 NA 0.068825745 NA Meta analysis with ML.I2_values[1,1] NA 0.612876083 NA Meta analysis with ML.I2_values[2,1] NA 0.734526329 NA observed statistics: 84 estimated parameters: 5 degrees of freedom: 79 -2 log likelihood: -161.9216 saturated -2 log likelihood: NA number of observations: 42 chi-square (degrees of freedom): NA ( df = NA ) p: NA Information Criteria: df Penalty Parameters Penalty Sample-Size Adjusted AIC: -319.9216 -151.9216 NA BIC: -457.1975 -143.2332 -158.8909 CFI: NA TLI: NA RMSEA: NA timestamp: 2014-06-18 21:02:02 frontend time: 0.04845333 secs backend time: 0.02232218 secs independent submodels time: 2.622604e-05 secs wall clock time: 0.07080173 secs cpu time: 0.07080173 secs OpenMx version number: 2.0.0.3575 > > ## Throw an error when rerun the model > metaSEM.fit <- mxRun(metaSEM.fit, intervals=TRUE) Running Meta analysis with ML Error: The job for model 'Meta analysis with ML' exited abnormally with the error message: MxComputeGradientDescent: fitfunction Meta analysis with ML.fitfunction evaluated to nan (Expected covariance matrix is not positive-definite in data row 36) Execution halted