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. > ## 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="test4a.txt") > > ## Version "1.4-3532" > library(OpenMx) > > 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_1.4-3532 > > ## Clear all objects > rm(list=ls()) > > ## Load the workspace > load("test4a.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","Tau_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, + mxMLObjective(covariance="S", means="Inter", dimnames=c("lifesat","lifecon")), + mxCI(c("Tau","Inter"))) > > metaSEM.fit <- mxRun(metaSEM.model, intervals=TRUE) Running Meta analysis with ML > summary(metaSEM.fit) 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 Meta analysis with ML.Tau[1,1] 1.000000e-10 0.004727256 1.000000e-10 Meta analysis with ML.Tau[1,2] 3.934366e-03 0.003934366 3.934366e-03 Meta analysis with ML.Tau[2,1] 3.934366e-03 0.003934366 3.934366e-03 Meta analysis with ML.Tau[2,2] 1.000000e-10 0.008413606 1.000000e-10 Meta analysis with ML.Inter[1,1] 1.349849e-03 0.001349849 1.349849e-03 Meta analysis with ML.Inter[2,1] 6.882574e-02 0.068825745 6.882574e-02 Meta analysis with ML.I2_values[1,1] 3.348988e-08 0.612876083 3.348988e-08 Meta analysis with ML.I2_values[2,1] 3.288545e-08 0.734526329 3.288545e-08 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: 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 20:41:02 frontend time: 2.747911 secs backend time: 0.2282765 secs independent submodels time: 6.556511e-05 secs wall clock time: 2.976253 secs cpu time: 2.976253 secs openmx version number: 1.4-3532 > > my.fit <- mxRun(my.model, intervals=T) Running Test > summary(my.fit) 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 Tau_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 Test.Tau[1,1] 0.002101886 0.004727256 0.009489518 Test.Tau[1,2] 0.001193098 0.003934366 0.008349170 Test.Tau[2,1] 0.001193098 0.003934366 0.008349170 Test.Tau[2,2] 0.004602016 0.008413606 0.015237216 Test.Inter[1,1] -0.026791086 0.001349849 0.028866270 Test.Inter[1,2] 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: 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 20:41:03 frontend time: 0.04135919 secs backend time: 0.3537242 secs independent submodels time: 4.410744e-05 secs wall clock time: 0.3951275 secs cpu time: 0.3951275 secs openmx version number: 1.4-3532 > > proc.time() user system elapsed 2.432 0.044 5.123