metaSEM
http://openmx.ssri.psu.edu/taxonomy/term/44/0
enThis forum is about the metaSEM package for meta-analysis
http://openmx.ssri.psu.edu/thread/2946
<div class="field field-name-taxonomy-forums field-type-taxonomy-term-reference field-label-above"><div class="field-label">Forums: </div><div class="field-items"><div class="field-item even"><a href="/forums/third-party-software/metasem">metaSEM</a></div></div></div><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><div class="tex2jax">
<p><a href="http://courses.nus.edu.sg/course/psycwlm/internet">Mike Cheung's</a> metaSEM package is introduced <a href="http://courses.nus.edu.sg/course/psycwlm/Internet/metaSEM">here</a></p>
<p>Post questions to this forum</p>
</div>
</div></div></div>Sat, 26 Apr 2014 21:26:16 +0000tbates2946 at http://openmx.ssri.psu.eduThe Missing Coefficients in metaSEM
http://openmx.ssri.psu.edu/node/4270
<div class="field field-name-taxonomy-forums field-type-taxonomy-term-reference field-label-above"><div class="field-label">Forums: </div><div class="field-items"><div class="field-item even"><a href="/forums/third-party-software/metasem">metaSEM</a></div></div></div><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>Hi Mike,<br />
I am running the metaSEM for a mediation model. The results seem good. But when I tried to extrcat the cofficients, there is a problem. In this model, there are three indepent variables and there should be three correlation coefficients between those three variables as well. But in the summary and coef results, there is only one correlation coefficients, cor = 0.43. I want to report all coefficients in my meta-analysis. So could you please check my code and tell me how to read those three correlation coefficients? </p>
<p>Here is my code.</p>
<p>library(metaSEM)<br />
library(lavaan)</p>
<p>x1 <- matrix(c(<br />
1,0.49,0.5,0.23,0.21,<br />
0.49,1,0.46,0.13,0.17,<br />
0.5,0.46,1,0.29,0.49,<br />
0.23,0.13,0.29,1,0.58,<br />
0.21,0.17,0.49,0.58,1),<br />
nrow = 5, ncol = 5, byrow = TRUE, dimnames = list(c("SOP","OOP","SPP","RUM","DEP"),c("SOP","OOP","SPP","RUM","DEP")))</p>
<p>x2 <- matrix(c(<br />
1,0.49,0.5,0.23,0.24,<br />
0.49,1,0.46,0.13,0.12,<br />
0.5,0.46,1,0.29,0.47,<br />
0.23,0.13,0.29,1,0.55,<br />
0.24,0.12,0.47,0.55,1),<br />
nrow = 5, ncol = 5, byrow = TRUE, dimnames = list(c("SOP","OOP","SPP","RUM","DEP"),c("SOP","OOP","SPP","RUM","DEP")))</p>
<p>x3 <- matrix(c(<br />
1,0.42,0.49,0.23,-0.17,<br />
0.42,1,0.41,0.22,0.05,<br />
0.49,0.41,1,0.27,0.3,<br />
0.23,0.22,0.27,1,0.4,<br />
-0.17,0.05,0.3,0.4,1),<br />
nrow = 5, ncol = 5, byrow = TRUE, dimnames = list(c("SOP","OOP","SPP","RUM","DEP"),c("SOP","OOP","SPP","RUM","DEP")))</p>
<p>x4 <- matrix(c(<br />
1,0.5,0.54,0.21,0.15,<br />
0.5,1,0.36,0.11,0.1,<br />
0.54,0.36,1,0.41,0.39,<br />
0.21,0.11,0.41,1,0.54,<br />
0.15,0.1,0.39,0.54,1),<br />
nrow = 5, ncol = 5, byrow = TRUE, dimnames = list(c("SOP","OOP","SPP","RUM","DEP"),c("SOP","OOP","SPP","RUM","DEP")))</p>
<p>x5 <- matrix(c(<br />
1,0.44,0.47,0.26,0.07,<br />
0.44,1,0.44,0.22,0.06,<br />
0.47,0.44,1,0.38,0.4,<br />
0.26,0.22,0.38,1,0.53,<br />
0.07,0.06,0.4,0.53,1),<br />
nrow = 5, ncol = 5, byrow = TRUE, dimnames = list(c("SOP","OOP","SPP","RUM","DEP"),c("SOP","OOP","SPP","RUM","DEP")))</p>
<p>x6 <- matrix(c(<br />
1,0.31,0.41,0.26,0.17,<br />
0.31,1,0.23,0.03,-0.11,<br />
0.41,0.23,1,0.49,0.47,<br />
0.26,0.03,0.49,1,0.66,<br />
0.17,-0.11,0.47,0.66,1),<br />
nrow = 5, ncol = 5, byrow = TRUE, dimnames = list(c("SOP","OOP","SPP","RUM","DEP"),c("SOP","OOP","SPP","RUM","DEP")))</p>
<p>x7 <- matrix(c(<br />
1,0.46,0.38,0.18,0.03,<br />
0.46,1,0.3,0.06,0.06,<br />
0.38,0.3,1,0.29,0.3,<br />
0.18,0.06,0.29,1,0.56,<br />
0.03,0.06,0.3,0.56,1),<br />
nrow = 5, ncol = 5, byrow = TRUE, dimnames = list(c("SOP","OOP","SPP","RUM","DEP"),c("SOP","OOP","SPP","RUM","DEP")))</p>
<p>x8 <- matrix(c(<br />
1,0.46,0.38,0.17,0.03,<br />
0.46,1,0.3,0.1,0.06,<br />
0.38,0.3,1,0.26,0.3,<br />
0.17,0.1,0.26,1,0.42,<br />
0.03,0.06,0.3,0.42,1),<br />
nrow = 5, ncol = 5, byrow = TRUE, dimnames = list(c("SOP","OOP","SPP","RUM","DEP"),c("SOP","OOP","SPP","RUM","DEP")))</p>
<p>x9 <- matrix(c(<br />
1,0.33,0.48,0.34,0.21,<br />
0.33,1,0.08,0.05,-0.06,<br />
0.48,0.08,1,0.58,0.41,<br />
0.34,0.05,0.58,1,0.37,<br />
0.21,-0.06,0.41,0.37,1),<br />
nrow = 5, ncol = 5, byrow = TRUE, dimnames = list(c("SOP","OOP","SPP","RUM","DEP"),c("SOP","OOP","SPP","RUM","DEP")))</p>
<p>x10 <- matrix(c(<br />
1,0.33,0.48,0.07,0.21,<br />
0.33,1,0.08,0.13,-0.06,<br />
0.48,0.08,1,0.35,0.41,<br />
0.07,0.13,0.35,1,0.76,<br />
0.21,-0.06,0.41,0.76,1),<br />
nrow = 5, ncol = 5, byrow = TRUE, dimnames = list(c("SOP","OOP","SPP","RUM","DEP"),c("SOP","OOP","SPP","RUM","DEP")))</p>
<p>x11 <- matrix(c(<br />
1,0.43,0.47,0.22,0.13,<br />
0.43,1,0.38,0.14,0.09,<br />
0.47,0.38,1,0.36,0.34,<br />
0.22,0.14,0.36,1,0.52,<br />
0.13,0.09,0.34,0.52,1),<br />
nrow = 5, ncol = 5, byrow = TRUE, dimnames = list(c("SOP","OOP","SPP","RUM","DEP"),c("SOP","OOP","SPP","RUM","DEP")))</p>
<p>my.df1<-list("1"=x1,"2"=x2,"3"=x3,"4"=x4,"5"=x5,"6"=x6,"7"=x7,"8"=x8,"9"=x9,"10"=x10,"11"=x11)<br />
my.df1</p>
<p>n <-c(150,150,155,279,224,140,305,305,50,50,213)<br />
n</p>
<p>fixed1 <- tssem1(my.df1, n, method="FEM")<br />
summary(fixed1)</p>
<p>model <- "<br />
RUM~SPP2RUM*SPP + SOP2RUM*SOP + OOP2RUM*OOP<br />
DEP~SPP2DEP*SPP + SOP2DEP*SOP + OOP2DEP*OOP + RUM2DEP*RUM<br />
SOP~~1*SOP<br />
OOP~~1*OOP<br />
SPP~~1*SPP<br />
SOP~~cor*OOP<br />
SOP~~cor*SPP<br />
OOP~~cor*SPP<br />
RUM~~var_RUM*RUM<br />
DEP~~var_DEP*DEP"</p>
<p>RAM <- lavaan2RAM(model, obs.variables=c("SOP","OOP","SPP","RUM","DEP"))<br />
RAM<br />
A1 <- RAM$A<br />
S1 <- RAM$S<br />
fixed2 <- tssem2(fixed1, Amatrix=A1, Smatrix=S1, diag.constraints=TRUE, intervals.type="LB", model.name="perfectionism rum dep")<br />
summary(fixed2)<br />
coef(fixed2)<br />
vcov(fixed2)</p>
<p>Many thanks,<br />
Yu Xie</p>
</div></div></div>Fri, 16 Jun 2017 09:25:09 +0000Xie4270 at http://openmx.ssri.psu.eduOpenMX Status: 5
http://openmx.ssri.psu.edu/node/4267
<div class="field field-name-taxonomy-forums field-type-taxonomy-term-reference field-label-above"><div class="field-label">Forums: </div><div class="field-items"><div class="field-item even"><a href="/forums/third-party-software/metasem">metaSEM</a></div></div></div><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><div class="tex2jax">
<p>Hello all,</p>
<p>I am getting status 5 for some analyses and am not sure why. I am including the code and output below. There are 4 clusters and 9 effects. Any idea what is causing it?</p>
<p>Thanks!</p>
<h6>#### CODE</h6>
<p>clustvar <-c(3.1,3.1,41.1,52.1,52.1,52.1,52.1,56.1,56.1)<br />
effsize <-c(0.0370169,-0.04603249,0.25541281,0.20065009,0.18405043,0.12667322,0.21526454,0.01300073,-0.05304971)<br />
samplvar <-c(0.01020408,0.01020408,0.01298701,0.01538462,0.01538462,0.01538462,0.01538462,0.0078125,0.0078125)<br />
summary( meta3(y=effsize, v=samplvar,cluster=clustvar) )</p>
<h6>### End Code</h6>
<h5>Output below</h5>
<p>Call:<br />
meta3(y = effsize, v = samplvar, cluster = clustvar)</p>
<p>95% confidence intervals: z statistic approximation<br />
Coefficients:<br />
Estimate Std.Error lbound ubound z value Pr(>|z|)<br />
Intercept 8.5684e-02 5.5208e-02 -2.2522e-02 1.9389e-01 1.5520 0.1207<br />
Tau2_2 1.4867e-09 NA NA NA NA NA<br />
Tau2_3 6.3242e-03 6.6531e-03 -6.7157e-03 1.9364e-02 0.9506 0.3418</p>
<p>Q statistic on the homogeneity of effect sizes: 9.921885 Degrees of freedom of the Q statistic: 8 P value of the Q statistic: 0.2705515</p>
<p>Heterogeneity indices (based on the estimated Tau2):<br />
Estimate<br />
I2_2 (Typical v: Q statistic) 0.0000<br />
I2_3 (Typical v: Q statistic) 0.3543</p>
<p>Number of studies (or clusters): 4<br />
Number of observed statistics: 9<br />
Number of estimated parameters: 3<br />
Degrees of freedom: 6<br />
-2 log likelihood: -15.12369<br />
OpenMx status1: 5 ("0" or "1": The optimization is considered fine.<br />
Other values may indicate problems.)</p>
</div>
</div></div></div>Sat, 03 Jun 2017 00:29:16 +0000sorin.valcea4267 at http://openmx.ssri.psu.eduError in Mixed-effects Multivariate Meta-analysis
http://openmx.ssri.psu.edu/node/4261
<div class="field field-name-upload field-type-file field-label-hidden"><div class="field-items"><div class="field-item even"><table class="sticky-enabled">
<thead><tr><th>Attachment</th><th>Size</th> </tr></thead>
<tbody>
<tr class="odd"><td><span class="file"><img class="file-icon" alt="File" title="text/csv" src="/modules/file/icons/text-x-generic.png" /> <a href="http://openmx.ssri.psu.edu/sites/default/files/trialrun2.csv" type="text/csv; length=7095">trialrun2.csv</a></span></td><td>6.93 KB</td> </tr>
</tbody>
</table>
</div></div></div><div class="field field-name-taxonomy-forums field-type-taxonomy-term-reference field-label-above"><div class="field-label">Forums: </div><div class="field-items"><div class="field-item even"><a href="/forums/third-party-software/metasem">metaSEM</a></div></div></div><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>Dear Sir, </p>
<p>I am in the midst of running the multivariate meta-analysis with moderators included. The attached dataset consists of 63 observations, 6 effect sizes and their respective variances and covariances. There are many missing data as most studies do not report all the 6 effect sizes, in fact there is not one study that reported all the 6 effect sizes. I am able to run the random effects multivariate meta-analysis by imposing a diagonal structure on T2 but when I tried running an analysis with P.f as one of the moderators (there are no missing data on this variable-all studies have reported the P.f), the following error occurred: </p>
<p> Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :<br />
0 (non-NA) cases</p>
<p>However, when I ran the multivariate meta-analysis with just the first 3 effect sizes, and the moderator included, the error does not appear. What is exactly causing the error to appear? Is the main problem problem due to the vast number of missing data in the dataset? Is there any other way to solve this issue aside from dropping the number of effect sizes included (which then reduces the number of missing data)? </p>
<p>The following is my syntax, </p>
<p>> m1 <- read.csv(“trialrun2.csv”)</p>
<p>> RE <- Diag(c("0.01*Tau2_1", "0.01*Tau2_2", "0.01*Tau2_3", "0.01*Tau2_4", "0.01*Tau2_5", "0.01*Tau2_6"))</p>
<p>m2 <- meta(y=cbind(z_d, z_a, z_s, z_o, z_f, z_w), v=cbind(Var_d, cov.d.a, cov.d.s, cov.d.o, cov.d.f, cov.d.w, Var_a, cov.a.s, cov.a.o, cov.a.f, cov.a.w, Var_s, cov.s.o, cov.s.f, cov.s.w, Var_o, cov.o.f, cov.o.w, Var_f, cov.f.w, Var_w), x = P.f, data=m1, RE.constraints=RE)</p>
<p>Any help will be appreciated! Thank so much.</p>
<p>Yours sincerely,<br />
GerardCY</p>
</div></div></div>Sat, 13 May 2017 06:26:40 +0000GerardCY4261 at http://openmx.ssri.psu.eduAbout the mixed-effects model in multivariate meta-analysis by using metaSEM
http://openmx.ssri.psu.edu/node/4259
<div class="field field-name-taxonomy-forums field-type-taxonomy-term-reference field-label-above"><div class="field-label">Forums: </div><div class="field-items"><div class="field-item even"><a href="/forums/third-party-software/metasem">metaSEM</a></div></div></div><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><div class="tex2jax">
<p>Hi Mike,</p>
<p>I am trying to conduct a multivariate meta-analysis by using metaSEM. I reviewed your article Cheung, M. W. L. (2014). metaSEM: An R package for meta-analysis using structural equation modeling. Frontiers in Psychology, 5. In the supplementary material, you provided some examples. In terms of the second example in section 3, you used the data set reported by Aloe et al. (2014).</p>
<p>Now, I am a little confused how to examine the mixed-effects model. You replicate the analysis and take Publication_type for example. But I don’t know how to deal with a continuous variable as a moderator such as Years of experience. So could you provide the code for testing Years of experience as a moderator following your script.</p>
<p>Here is the script,</p>
<p>head(Aloe14)<br />
meta1 <- meta(y=cbind(EE,DP,PA),<br />
v=cbind(V_EE, C_EE_PA, C_EE_PA, V_DP, C_DP_PA, V_PA),<br />
data=Aloe14)<br />
summary(meta1)<br />
( coef1 <- coef(meta1, select="random") )<br />
my.cov <- vec2symMat(coef1, byrow=TRUE)<br />
dimnames(my.cov) <- list( c("EE", "DP", "PA"),<br />
c("EE", "DP", "PA") )<br />
my.cov<br />
( cov2cor(my.cov) )<br />
plot(meta1, main="", axis.labels=c("EE", "DP", "PA"))<br />
( journal <- ifelse(Aloe14$Publication_type=="Journal", 1, 0) )<br />
meta2 <- meta(y=cbind(EE,DP,PA),<br />
v=cbind(V_EE, C_EE_PA, C_EE_PA, V_DP, C_DP_PA, V_PA),<br />
x=journal, data=Aloe14)<br />
summary(meta2)<br />
anova(meta2, meta1)</p>
<p>Bets wishes,<br />
Yu Xie</p>
</div>
</div></div></div>Wed, 10 May 2017 08:02:07 +0000Xie4259 at http://openmx.ssri.psu.eduMetaSEM with raw data sets with missing values
http://openmx.ssri.psu.edu/node/4255
<div class="field field-name-upload field-type-file field-label-hidden"><div class="field-items"><div class="field-item even"><table class="sticky-enabled">
<thead><tr><th>Attachment</th><th>Size</th> </tr></thead>
<tbody>
<tr class="odd"><td><span class="file"><img class="file-icon" alt="PDF icon" title="application/pdf" src="/modules/file/icons/application-pdf.png" /> <a href="http://openmx.ssri.psu.edu/sites/default/files/codes.pdf" type="application/pdf; length=99838">codes.pdf</a></span></td><td>97.5 KB</td> </tr>
<tr class="even"><td><span class="file"><img class="file-icon" alt="File" title="text/csv" src="/modules/file/icons/text-x-generic.png" /> <a href="http://openmx.ssri.psu.edu/sites/default/files/H_1.csv" type="text/csv; length=3053">H.csv</a></span></td><td>2.98 KB</td> </tr>
<tr class="odd"><td><span class="file"><img class="file-icon" alt="File" title="text/csv" src="/modules/file/icons/text-x-generic.png" /> <a href="http://openmx.ssri.psu.edu/sites/default/files/R_2.csv" type="text/csv; length=8911">R.csv</a></span></td><td>8.7 KB</td> </tr>
<tr class="even"><td><span class="file"><img class="file-icon" alt="File" title="text/csv" src="/modules/file/icons/text-x-generic.png" /> <a href="http://openmx.ssri.psu.edu/sites/default/files/T_0.csv" type="text/csv; length=8881">T.csv</a></span></td><td>8.67 KB</td> </tr>
<tr class="odd"><td><span class="file"><img class="file-icon" alt="File" title="text/csv" src="/modules/file/icons/text-x-generic.png" /> <a href="http://openmx.ssri.psu.edu/sites/default/files/U_0.csv" type="text/csv; length=3941">U.csv</a></span></td><td>3.85 KB</td> </tr>
</tbody>
</table>
</div></div></div><div class="field field-name-taxonomy-forums field-type-taxonomy-term-reference field-label-above"><div class="field-label">Forums: </div><div class="field-items"><div class="field-item even"><a href="/forums/third-party-software/metasem">metaSEM</a></div></div></div><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><div class="tex2jax">
<p>Dear all,</p>
<p>I am trying to conduct a metaSEM on four data sets which contain missing values. I have the codes I've used to calculate the estimates and their confidence intervals with the full data sets (missing values imputed using ML), and which worked perfectly.<br />
However, when I am repeating the same analysis with the raw data sets with no imputations, I get error messages at the fixed2 stage, and for calculating the confidence intervals, I get NA for the Upper and Lower bounds.</p>
<p>I was also wondering whether it is possible to get the R2 in these analysis.</p>
<p>I have attached the codes I have been using and the four data sets I am using.<br />
Any help is highly appreciated.</p>
<p>Best regards,<br />
Arin</p>
</div>
</div></div></div>Tue, 02 May 2017 14:52:38 +0000Arin A4255 at http://openmx.ssri.psu.eduTSSEM near 0 heterogeneity variances and Hessian matrix error
http://openmx.ssri.psu.edu/node/4244
<div class="field field-name-taxonomy-forums field-type-taxonomy-term-reference field-label-above"><div class="field-label">Forums: </div><div class="field-items"><div class="field-item even"><a href="/forums/third-party-software/metasem">metaSEM</a></div></div></div><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><div class="tex2jax">
<p>Dear Mike and other users,</p>
<p>I am doing random effects TSSEM and had run into problems with openmx status=6 with tssem1(). In earlier communication with Mike, he noted that some of the heterogeneity variances (I2) were near 0 (e.g., .0000, .0001) and said that tssem1() does not handle them well. Thus he suggested fixing the near 0 heterogeneity variances to 0, and letting the larger heterogeneity variance vary with starting value 0.01, then running tssem1() with this user-defined structure:</p>
<h2>Try user-defined structure for the random effects</h2>
<h2>Fix the elements in 1, 2, 3, 4, and 6</h2>
<p>RE <- Diag(c(0,0,0,0, "0.01<em>Tau2_5", 0, "0.01</em>Tau2_7", "0.01<em>Tau2_8", "0.01</em>Tau2_9", "0.01*Tau2_10"))<br />
RE<br />
random1 <- tssem1(vector, n, method="REM", RE.type="User",<br />
RE.constraints = RE)</p>
<p>Openmx status became 0 after doing this. I will need to conduct similar analyses with several other datasets and thus have some follow-up questions about fixing heterogeneity variances in further analyses.</p>
<ol>
<li>
<p>Mike suggested previously that I should fix a heterogeneity variance only if there are "NA in the estimated heterogeneity or the OpenMx status is not 0 or 1," and only if the variance is as small as 1e-8 or 1e-10. But how do I check that the heterogeneity variance for any intercept is <1e-8, since the tssem1() output shows only up to 4 decimal places?</p>
</li>
<li>
<p>For some of my analyses, openmx status is 0 after running/rerunning tssem1() and running tssem2(), but I get the following error message after running tssem2():</p>
</li>
</ol>
<p>hIn .solve(x = objectmx.fit@outputmx.fit@outputcalculatedHessian, parameters = my.name) :<br />
Error in solving the Hessian matrix. Generalized inverse is used. The standard errors may not be trustworthy.</p>
<p>Thus I fixed to 0 the heterogeneity variances between .0000 and .0003 in the tssem1() output, and then reran tssem1() with user-defined structure, which made the error message go away. I can't tell how small the .0000 really is, but the .0003 is >1e-8. So if openmx status=0, is it better to set heterogeneity variances to 0 to avoid the error, or better not to set to 0 if the variances are >1e-8 but get the error?</p>
<p>Does the error really matter for interpretation of findings, since the Std Error is NA in my tssem2() output anyway, and I use the lbound and ubound to interpret whether the coefficients, indirect effect, and direct effect are significant?</p>
<p>Any suggestions or advice would be much appreciated!<br />
Mei Yi</p>
</div>
</div></div></div>Wed, 22 Mar 2017 21:58:19 +0000myng4244 at http://openmx.ssri.psu.eduNA in Indirect Effects for 95% likelihood based CI’s metaSEM
http://openmx.ssri.psu.edu/node/4237
<div class="field field-name-upload field-type-file field-label-hidden"><div class="field-items"><div class="field-item even"><table class="sticky-enabled">
<thead><tr><th>Attachment</th><th>Size</th> </tr></thead>
<tbody>
<tr class="odd"><td><span class="file"><img class="file-icon" alt="Plain text icon" title="text/plain" src="/modules/file/icons/text-plain.png" /> <a href="http://openmx.ssri.psu.edu/sites/default/files/R%20Code.txt" type="text/plain; length=9677" title="R Code.txt">R Code</a></span></td><td>9.45 KB</td> </tr>
<tr class="even"><td><span class="file"><img class="file-icon" alt="Image icon" title="image/png" src="/modules/file/icons/image-x-generic.png" /> <a href="http://openmx.ssri.psu.edu/sites/default/files/Model.png" type="image/png; length=23150">Model.png</a></span></td><td>22.61 KB</td> </tr>
</tbody>
</table>
</div></div></div><div class="field field-name-taxonomy-forums field-type-taxonomy-term-reference field-label-above"><div class="field-label">Forums: </div><div class="field-items"><div class="field-item even"><a href="/forums/third-party-software/metasem">metaSEM</a></div></div></div><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><div class="tex2jax">
<p>Dear Mike and Others,</p>
<p>I am trying to estimate a random effects tssem for my dissertation.I have read your book and related papers. I am following the wonderful resources provided by you and your team. My goal is to perform some moderator analyses using categorical variables, after I successfully run the tssem model.</p>
<p>I am attaching my R script and the structural model image. In this data and model, I found 2 issues, and have 2 clarifications.</p>
<ol>
<li>
<p>Some of the 95% likelihood based CI’s are shown as “NA”. This happens mainly for the indirect effects – for example for my main tssem2 model – the first one in my R code. This issue is more pronounced when I run moderator analyses and estimate two tssem2 models (split based on the categorical moderator )after I perform the moderator analysis. In these cases, the lbound and ubound values of even the direct effects are showing as “NA”. Can you please let me know if I have set up anything wrong with respect to my model specification or data. Please let me know if and how I have to use starting values from the prior estimation?</p>
</li>
<li>
<p>I get the following warning message when I run some of the tssem2 models. For example, in my first moderator analysis with variable “tc”.</p>
</li>
</ol>
<p>Warning message:<br />
In .solve(x = object$mx.fit@output$calculatedHessian, parameters = my.name) :<br />
Error in solving the Hessian matrix. Generalized inverse is used. The standard errors may not be trustworthy.</p>
<p>I assume I can ignore this warning given that I am primarily using 95% likelihood based CI’s, and provided R can estimate these 95% likelihood based CI’s for all my parameters.</p>
<ol start="3">
<li>I tried to not use the intervals="LB" option and see if I atleast get standard errors. Though I was successful in getting the standard errors and the CI for the direct effects, I could not get them for the indirect effects. Moreover, due to the following warning message, I was not sure if I can report them for review to a top journal.</li>
</ol>
<p>Warning message:<br />
In vcov.wls(object, R = R) :<br />
Parametric bootstrap with 50 replications was used to approximate the sampling covariance matrix of the parameter estimates. A better approach is to use likelihood-based confidence interval by including the intervals.type="LB" argument in the analysis.</p>
<p>My question is , can I report these std errors? Or can I increase the replications? How do I obtain the std errors for indirect effects when we do not specify the intervals="LB" option?</p>
<ol start="4">
<li>This is a clarification regarding my setup of the S matrix. In my model (please see the figure attached), since I am not explicitly modeling the link between T to J or vice versa, I wanted to correlate them. Can you please verify if my S matrix makes sense in this regard? Is it okay if I do not correlate them?</li>
</ol>
<p>Your response will greatly help me in completing my manuscript. Thanks in advance for your help.</p>
<p>Regards,<br />
Srikanth Parameswaran</p>
</div>
</div></div></div>Wed, 08 Mar 2017 04:08:49 +0000Srikanth4237 at http://openmx.ssri.psu.eduCode 6 Error in the second stage
http://openmx.ssri.psu.edu/node/4225
<div class="field field-name-upload field-type-file field-label-hidden"><div class="field-items"><div class="field-item even"><table class="sticky-enabled">
<thead><tr><th>Attachment</th><th>Size</th> </tr></thead>
<tbody>
<tr class="odd"><td><span class="file"><img class="file-icon" alt="Binary Data" title="application/octet-stream" src="/modules/file/icons/application-octet-stream.png" /> <a href="http://openmx.ssri.psu.edu/sites/default/files/code_0.R" type="application/octet-stream; length=859">code.R</a></span></td><td>859 bytes</td> </tr>
<tr class="even"><td><span class="file"><img class="file-icon" alt="File" title="text/csv" src="/modules/file/icons/text-x-generic.png" /> <a href="http://openmx.ssri.psu.edu/sites/default/files/Data.csv" type="text/csv; length=1621">Data.csv</a></span></td><td>1.58 KB</td> </tr>
</tbody>
</table>
</div></div></div><div class="field field-name-taxonomy-forums field-type-taxonomy-term-reference field-label-above"><div class="field-label">Forums: </div><div class="field-items"><div class="field-item even"><a href="/forums/third-party-software/metasem">metaSEM</a></div></div></div><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><div class="tex2jax">
<p>Hi all, Hi Mike,</p>
<p>I really appreciate Mike's guidance in TSSEM.</p>
<p>I recently encountered the code 6 error (http://openmx.ssri.psu.edu/wiki/errors) in the last step of my TSSEM analysis.</p>
<p>I think it might be because there are too many missing values in the data: after I deleted rows with two NAs, it worked.</p>
<p>I am just wondering if there are any alternative solutions for code 6 error in TSSEM? I noticed that mxTryHard can be used to get a better result but I am not so sure about it....</p>
<p>Hope to know more about how to deal with Code 6 Error occurred in TSSEM.</p>
<p>Btw,<br />
My data and code are also attached.</p>
</div>
</div></div></div>Tue, 24 Jan 2017 23:03:47 +0000Arant4225 at http://openmx.ssri.psu.edu"Cov" is not positive definite.
http://openmx.ssri.psu.edu/node/4218
<div class="field field-name-upload field-type-file field-label-hidden"><div class="field-items"><div class="field-item even"><table class="sticky-enabled">
<thead><tr><th>Attachment</th><th>Size</th> </tr></thead>
<tbody>
<tr class="odd"><td><span class="file"><img class="file-icon" alt="Binary Data" title="application/octet-stream" src="/modules/file/icons/application-octet-stream.png" /> <a href="http://openmx.ssri.psu.edu/sites/default/files/R%20Script_0.R" type="application/octet-stream; length=1520">R Script.R</a></span></td><td>1.48 KB</td> </tr>
<tr class="even"><td><span class="file"><img class="file-icon" alt="Plain text icon" title="text/plain" src="/modules/file/icons/text-plain.png" /> <a href="http://openmx.ssri.psu.edu/sites/default/files/data_1.txt" type="text/plain; length=5246">data.txt</a></span></td><td>5.12 KB</td> </tr>
<tr class="odd"><td><span class="file"><img class="file-icon" alt="Image icon" title="image/png" src="/modules/file/icons/image-x-generic.png" /> <a href="http://openmx.ssri.psu.edu/sites/default/files/Model_0.png" type="image/png; length=103532">Model.png</a></span></td><td>101.11 KB</td> </tr>
</tbody>
</table>
</div></div></div><div class="field field-name-taxonomy-forums field-type-taxonomy-term-reference field-label-above"><div class="field-label">Forums: </div><div class="field-items"><div class="field-item even"><a href="/forums/third-party-software/metasem">metaSEM</a></div></div></div><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><div class="tex2jax">
<p>Dear Mike and Others,</p>
<p>I am trying to estimate a random effects tssem for my paper.I have read your book and related papers. I am following the wonderful resources provided by you and your team. My goal is to perform some moderator analyses using categorical variables, after I successfully run the tssem model.</p>
<p>I am attaching my data, R script and the structural model. In this data and model, the tssem1 did not execute due to the positive definite problem. So, I followed your suggestions in Cheung and Hafdahl (2016), and hence tried adding the options acov = "weighted" and acov = "unweighted". This helped in successfully running the tssem1 model. But the tssem2 model produced the following error:</p>
<p>Error in wls(Cov = pooledS, asyCov = asyCov, n = tssem1.obj$total.n, Amatrix = Amatrix, :<br />
"Cov" is not positive definite.</p>
<p>Indeed, the matrix was not positive definte when I inspected. How do I work around this error? How can I find a subset of studies in my dataset that is positive definite (without loosing the data points)? Interestingly, the tssem1 worked when I ran the with the first 40 studies in this dataset (even without the acov option).</p>
<p>I find the multivariate metasem to be fascinating. I want to strengthen my paper with this rigorous approach to metasem. So, any help in solving my issue would be great.</p>
<p>Thanks in advance for your help.<br />
Regards,<br />
Srikanth Parameswaran</p>
</div>
</div></div></div>Thu, 29 Dec 2016 22:46:50 +0000Srikanth4218 at http://openmx.ssri.psu.eduA question about latent variables in MASEM
http://openmx.ssri.psu.edu/node/4214
<div class="field field-name-taxonomy-forums field-type-taxonomy-term-reference field-label-above"><div class="field-label">Forums: </div><div class="field-items"><div class="field-item even"><a href="/forums/third-party-software/metasem">metaSEM</a></div></div></div><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><div class="tex2jax">
<p>Hi Mike</p>
<p>As mentioned before, I am trying to exam a structural model with three mediators by using the lavaan syntax. After review a couple of articles, I have a question which makes me feel confused. In MASEM, the variables included in correlation matrices should be observable variables and we could explore latent variables by using the lavaan syntax in the structural model. However, some authors reported latent variables correlation matrices in some articles. So, if there are correlation matrices of observable variables in some articles and correlation matrices of latent variables in other articles, how could I deal with this situation?</p>
<p>Many thanks,</p>
<p>Yu Xie</p>
</div>
</div></div></div>Thu, 15 Dec 2016 03:27:31 +0000Xie4214 at http://openmx.ssri.psu.eduUse MASEM to explore several potential mediators
http://openmx.ssri.psu.edu/node/4211
<div class="field field-name-taxonomy-forums field-type-taxonomy-term-reference field-label-above"><div class="field-label">Forums: </div><div class="field-items"><div class="field-item even"><a href="/forums/third-party-software/metasem">metaSEM</a></div></div></div><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><div class="tex2jax">
<p>Hi Mike,</p>
<p>I have reviewed several MASEM articles as well as the R code. I am excited that it could examine mediation model. However, I found the R code of meta-analytic structural equation modeling which examined only one mediator. Now I want to exam a structural model with three mediators by using MASEM. So, I am just wondering is that possible to use MASEM to explore several potential mediators. If so, please let me how to find the R code.</p>
<p>Thanks a lot,</p>
<p>Yu Xie</p>
</div>
</div></div></div>Fri, 25 Nov 2016 01:34:50 +0000Xie4211 at http://openmx.ssri.psu.eduhow to improve (poor) fit indices
http://openmx.ssri.psu.edu/node/4210
<div class="field field-name-upload field-type-file field-label-hidden"><div class="field-items"><div class="field-item even"><table class="sticky-enabled">
<thead><tr><th>Attachment</th><th>Size</th> </tr></thead>
<tbody>
<tr class="odd"><td><span class="file"><img class="file-icon" alt="PDF icon" title="application/pdf" src="/modules/file/icons/application-pdf.png" /> <a href="http://openmx.ssri.psu.edu/sites/default/files/diagram%20model%201.pdf" type="application/pdf; length=5358" title="diagram model 1.pdf">diagram model 1</a></span></td><td>5.23 KB</td> </tr>
<tr class="even"><td><span class="file"><img class="file-icon" alt="File" title="text/csv" src="/modules/file/icons/text-x-generic.png" /> <a href="http://openmx.ssri.psu.edu/sites/default/files/data_model1.csv" type="text/csv; length=11048" title="data_model1.csv">data model 1</a></span></td><td>10.79 KB</td> </tr>
<tr class="odd"><td><span class="file"><img class="file-icon" alt="Plain text icon" title="text/plain" src="/modules/file/icons/text-plain.png" /> <a href="http://openmx.ssri.psu.edu/sites/default/files/script%20model%201.txt" type="text/plain; length=2851" title="script model 1.txt">script (tssem) model 1</a></span></td><td>2.78 KB</td> </tr>
</tbody>
</table>
</div></div></div><div class="field field-name-taxonomy-forums field-type-taxonomy-term-reference field-label-above"><div class="field-label">Forums: </div><div class="field-items"><div class="field-item even"><a href="/forums/third-party-software/metasem">metaSEM</a></div></div></div><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><div class="tex2jax">
<p>Hi all, Hi Mike,</p>
<p>I want to test five rival conceptualizations of a construct (service quality) through path analysis with the two stage approach meta-analytic structural equation modelling (with the metaSEM in R). I am using a path analysis instead of a factor analysis since the dimensions' construct are discussed to be formative rather than reflective. In all five models, I have three or four exogeneous variables and one endogeneous variable (the endogeneous variable is the same for all models, that is, behavioral intention).</p>
<p>I was able to run all five models. However, the fit indices of the models was very poor. For example, the following fit indices pertain to the model 1 (four exogeneous variables and one endogeneous variable):</p>
<p>Model 1 - Fitting structural equation models (Stage 2)<br />
Sample size 59832<br />
Chi-squared of target model 1196.1572<br />
DF of target model 6<br />
p value of target model 0.000<br />
Root Mean Square Error of Approximation (RMSEA) 0.0576<br />
Standardised Root Mean Square Residual (SRMR) 0.4498<br />
TLI -0.0343<br />
CFI 0.3794<br />
AIC 1184.1572<br />
BIC 1130.1614</p>
<p>I suspect that it happened because I did not let the exogenous variables to covary in the models. However, when I let them to covary, the models became saturated and I do not have the fit indices anymore (and I need them to compare the five models). Attached, it is the diagram from the model 1 (with exogeneous variables not covarying), the data from model 1, and the script.</p>
<p>Do you have any suggestion what I could do to obtain acceptable fit indices? And should I not present results like those from model 1, right?!</p>
<p>Thank you very much for your time.</p>
<p>Best, Rafael.</p>
</div>
</div></div></div>Thu, 24 Nov 2016 17:16:35 +0000rafael.lionello4210 at http://openmx.ssri.psu.eduNA values in base model output and OpenMx status1: 5
http://openmx.ssri.psu.edu/node/4209
<div class="field field-name-taxonomy-forums field-type-taxonomy-term-reference field-label-above"><div class="field-label">Forums: </div><div class="field-items"><div class="field-item even"><a href="/forums/third-party-software/metasem">metaSEM</a></div></div></div><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><div class="tex2jax">
<p>I am currently in the process of running a meta analysis using the metaSEM package in OpenMx. As you can see in the first pass at the base model I am getting NA values for Std.Error, lbound, ubound, z value and Pr(>|z|) for both Tau2_2 and Tau2_3. In addition, the OpenMx status1: 5, which I found meant "5: means that the Hessian at the solution is not convex." However I am unclear how to resolve this as a problem. In addition when I run models with both level-2 and level-3 constraints I no longer see this issue, but I don't think it would be appropriate to do model comparisons to a base model that has so many NA values. Any help on how to resolve this issue would be great.</p>
<p>Here is the first few lines of data:</p>
<p>AUTHOR YEAR EXP yFINAL vFINAL typeFINAL<br />
Greenwood 2009 I -1.346327273 0.228655603 G<br />
Greenwood 2009 I 0.220196364 0.224990678 G<br />
Siette 2014 J 0.8974913 0.2625858 MT<br />
Siette 2014 J 1.2197971 0.2732485 MT<br />
Siette 2014 J 0.1487526 0.2503457 MT</p>
<p>> t(aggregate(yFINAL~EXP, data=META_B, FUN=length))<br />
[,1] [,2] [,3] [,4] [,5] [,6] [,7]<br />
EXP "I" "J" "K" "L" "M" "N" "R"<br />
yFINAL " 2" " 3" " 2" " 1" "12" " 2" " 1"</p>
<p>> ## ## Model 0: Random-effects model<br />
> summary( Model0 <- meta3(y=yFINAL, v=vFINAL, cluster=EXP,<br />
+ data=META_B, model.name="3 level") )</p>
<p>Call:<br />
meta3(y = yFINAL, v = vFINAL, cluster = EXP, data = META_B, model.name = "3 level")</p>
<p>95% confidence intervals: z statistic approximation<br />
Coefficients:<br />
Estimate Std.Error lbound ubound z value<br />
Intercept 2.8690e-01 2.2100e-01 -1.4626e-01 7.2005e-01 1.2982<br />
Tau2_2 1.0000e-10 NA NA NA NA<br />
Tau2_3 2.6152e-01 NA NA NA NA<br />
Pr(>|z|)<br />
Intercept 0.1942<br />
Tau2_2 NA<br />
Tau2_3 NA</p>
<p>Q statistic on the homogeneity of effect sizes: 38.8583<br />
Degrees of freedom of the Q statistic: 22<br />
P value of the Q statistic: 0.01464862</p>
<p>Heterogeneity indices (based on the estimated Tau2):<br />
Estimate<br />
I2_2 (Typical v: Q statistic) 0.0000<br />
I2_3 (Typical v: Q statistic) 0.5675</p>
<p>Number of studies (or clusters): 7<br />
Number of observed statistics: 23<br />
Number of estimated parameters: 3<br />
Degrees of freedom: 20<br />
-2 log likelihood: 40.06405<br />
OpenMx status1: 5 ("0" or "1": The optimization is considered fine.<br />
Other values may indicate problems.)</p>
<p>> ## ## Model 1: Testing tau^2_3 = 0<br />
> Model1 <- meta3(y=yFINAL, v=vFINAL, cluster=EXP,<br />
+ data=META_B,<br />
+ RE3.constraints=0, model.name="2 level")<br />
Call:<br />
meta3(y = yFINAL, v = vFINAL, cluster = EXP, data = META_B, RE3.constraints = 0,<br />
model.name = "2 level")</p>
<p>95% confidence intervals: z statistic approximation<br />
Coefficients:<br />
Estimate Std.Error lbound ubound z value Pr(>|z|)<br />
Intercept 0.055543 0.119228 -0.178139 0.289224 0.4659 0.6413<br />
Tau2_2 0.102482 0.113505 -0.119984 0.324948 0.9029 0.3666</p>
<p>Q statistic on the homogeneity of effect sizes: 38.8583<br />
Degrees of freedom of the Q statistic: 22<br />
P value of the Q statistic: 0.01464862</p>
<p>Heterogeneity indices (based on the estimated Tau2):<br />
Estimate<br />
I2_2 (Typical v: Q statistic) 0.3396<br />
I2_3 (Typical v: Q statistic) 0.0000</p>
<p>Number of studies (or clusters): 7<br />
Number of observed statistics: 23<br />
Number of estimated parameters: 2<br />
Degrees of freedom: 21<br />
-2 log likelihood: 45.00194<br />
OpenMx status1: 0 ("0" or "1": The optimization is considered fine.<br />
Other values may indicate problems.)</p>
<p>> Model2 <- meta3(y=yFINAL, v=vFINAL, cluster=EXP,<br />
+ data=META_B,<br />
+ RE2.constraints=0, model.name="tau2_2 EQ 0")<br />
> summary(Model2)<br />
Call:<br />
meta3(y = yFINAL, v = vFINAL, cluster = EXP, data = META_B, RE2.constraints = 0,<br />
model.name = "tau2_2 EQ 0")</p>
<p>95% confidence intervals: z statistic approximation<br />
Coefficients:<br />
Estimate Std.Error lbound ubound z value Pr(>|z|)<br />
Intercept 0.28690 0.25058 -0.20422 0.77801 1.1449 0.2522<br />
Tau2_3 0.26152 0.24783 -0.22423 0.74726 1.0552 0.2913</p>
<p>Q statistic on the homogeneity of effect sizes: 38.8583<br />
Degrees of freedom of the Q statistic: 22<br />
P value of the Q statistic: 0.01464862</p>
<p>Heterogeneity indices (based on the estimated Tau2):<br />
Estimate<br />
I2_2 (Typical v: Q statistic) 0.0000<br />
I2_3 (Typical v: Q statistic) 0.5675</p>
<p>Number of studies (or clusters): 7<br />
Number of observed statistics: 23<br />
Number of estimated parameters: 2<br />
Degrees of freedom: 21<br />
-2 log likelihood: 40.06405<br />
OpenMx status1: 0 ("0" or "1": The optimization is considered fine.<br />
Other values may indicate problems.)</p>
</div>
</div></div></div>Sun, 20 Nov 2016 20:22:20 +0000Rroquet4209 at http://openmx.ssri.psu.eduHeterogeneity indices and constraints on the between-studies variance-covariance matrix
http://openmx.ssri.psu.edu/node/4208
<div class="field field-name-taxonomy-forums field-type-taxonomy-term-reference field-label-above"><div class="field-label">Forums: </div><div class="field-items"><div class="field-item even"><a href="/forums/third-party-software/metasem">metaSEM</a></div></div></div><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>Hi all, hi Mike,</p>
<p>I am asking a question in reference to this project (<a href="https://osf.io/awz2p/">https://osf.io/awz2p/</a>). I am revising a paper based on the project in response to reviewer comments.</p>
<p>For most analyses in this project, we fit multivariate meta-analytic models, estimating 11 quantities across all studies. Of course, not every study contributes an estimate of each quantity, so the between-studies variance-covariance matrix is constrained such that all variances are equal and all covariances are equal. This ensures that the model is identifiable.</p>
<p>In the first submission, we reported I2 for each meta-analytic quantity as reported by summary.meta(). One of our reviewers asked us to report tau2 as well as an absolute measure of heterogeneity. This seems reasonable.</p>
<p>However, over the course of thinking about heterogeneity, it occurs to me that it might not make sense to report separate heterogeneity indices for each of the 11 estimated meta-analytic quantities -- after all, all the between-studies variances are constrained to be equal.</p>
<p>Does it make sense to report separate heterogeneity indices given that the between-studies variances are constrained to be equal? If not, how would I obtain a single heterogeneity estimate? From Cheung (2008; <a href="https://www.statmodel.com/download/MCheung.pdf">https://www.statmodel.com/download/MCheung.pdf</a>), I'm guessing that I can use these formulas:</p>
<p>H2 = Q/Qdf<br />
I2 = (H2-1)/H2</p>
<p>Assuming that mod is a model fit using meta() in R, I believe this would be:</p>
<p>H2 <- summary(mod)$Q.stat$Q/summary(mod)$Q.stat$Q.df<br />
I2 <- (H2-1)/H2</p>
<p>(P.S.: Mike, your advice on this and other projects over the years has been exceptionally helpful! You'll see that you are acknowledged in the author notes of this project and your work is referenced extensively throughout the paper)</p>
</div></div></div>Mon, 14 Nov 2016 23:42:14 +0000forscher4208 at http://openmx.ssri.psu.edu