The metaSEM Package

Table of Contents

1 Introduction

The metaSEM package provides functions to conducting univariate and multivariate meta-analysis using a structural equation modeling approach via the OpenMx package. It also implemented the two-stage structural equation modeling (TSSEM) approach to conducting fixed- and random-effects meta-analytic structural equation modeling (MASEM) on correlation/covariance matrices.

It is based on the following papers:

  • Cheung, M.W.L. (2008). A model for integrating fixed-, random-, and mixed-effects meta-analyses into structural equation modeling. Psychological Methods, 13, 182-202.
  • Cheung, M.W.L. (2009). Constructing approximate confidence intervals for parameters with structural equation models. Structural Equation Modeling, 16, 267–294.
  • Cheung, M.W.L. (2010). Fixed-effects meta-analyses as multiple-group structural equation models. Structural Equation Modeling, 17, 481-509.
  • Cheung, M.W.L. (2012). metaSEM: An R package for meta-analysis using structural equation modeling. Manuscript submitted for publication.
  • Cheung, M.W.L. (2013). Implementing restricted maximum likelihood estimation in structural equation models. Structural Equation Modeling, 20, 157-167.
  • Cheung, M.W.L. (in press). Fixed- and random-effects meta-analytic structural equation modeling: Examples and analyses in R. Behavior Research Methods.
  • Cheung, M.W.L. (in press). Multivariate meta-analysis as structural equation models. Structural Equation Modeling.
  • Cheung, M.W.L. (in press). Modeling dependent effect sizes with three-level meta-analyses: A structural equation modeling approach. Psychological Methods.
  • Cheung, M.W.L., & Chan, W. (2004). Testing dependent correlation coefficients via structural equation modeling. Organizational Research Methods, 7, 206–223.
  • Cheung, M.W.L., & Chan, W. (2005). Meta-analytic structural equation modeling: A two-stage approach. Psychological Methods, 10, 40-64.
  • Cheung, M.W.L., & Chan, W. (2009). A two-stage approach to synthesizing covariance matrices in meta-analytic structural equation modeling. Structural Equation Modeling, 6, 28-53.

2 Examples

Univariate random-effects model

## Load the library
library(metaSEM)

## Show the first few studies of the data set
head(Becker83)

## Random-effects meta-analysis with ML
summary( meta(y=di, v=vi, data=Becker83, model.name="Univariate random effects model") )
Loading required package: OpenMx
  study    di   vi percentage items
1     1 -0.33 0.03         25     2
2     2  0.07 0.03         25     2
3     3 -0.30 0.02         50     2
4     4  0.35 0.02        100    38
5     5  0.69 0.07        100    30
6     6  0.81 0.22        100    45
Running Univariate random effects model 

Call:
meta(y = di, v = vi, data = Becker83, model.name = "Univariate random effects model")

95% confidence intervals: z statistic approximation
Coefficients:
            Estimate Std.Error    lbound    ubound z value Pr(>|z|)
Intercept1  0.174734  0.113378 -0.047482  0.396950  1.5412   0.1233
Tau2_1_1    0.077376  0.054108 -0.028674  0.183426  1.4300   0.1527

Q statistic on homogeneity of effect sizes: 30.64949
Degrees of freedom of the Q statistic: 9
P value of the Q statistic: 0.0003399239
Heterogeneity indices (based on the estimated Tau2):
                             Estimate
Intercept1: I2 (Q statistic)   0.6718

Number of studies (or clusters): 10
Number of observed statistics: 10
Number of estimated parameters: 2
Degrees of freedom: 8
-2 log likelihood: 7.928307 
OpenMx status1: 0 ("0" and "1": considered fine; other values indicate problems)

Univariate mixed-effects model

## Mixed-effects meta-analysis with "log(items)" as the predictor
summary( meta(y=di, v=vi, x=log(items), data=Becker83, model.name="Univariate mixed effects model") )
Running Univariate mixed effects model 

Call:
meta(y = di, v = vi, x = log(items), data = Becker83, model.name = "Univariate mixed effects model")

95% confidence intervals: z statistic approximation
Coefficients:
              Estimate   Std.Error      lbound      ubound z value  Pr(>|z|)
Intercept1 -3.2015e-01  1.0981e-01 -5.3539e-01 -1.0492e-01 -2.9154  0.003552
Slope1_1    2.1088e-01  4.5084e-02  1.2251e-01  2.9924e-01  4.6774 2.905e-06
Tau2_1_1    1.0000e-10  2.0095e-02 -3.9386e-02  3.9386e-02  0.0000  1.000000
              
Intercept1 ** 
Slope1_1   ***
Tau2_1_1      
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Q statistic on homogeneity of effect sizes: 30.64949
Degrees of freedom of the Q statistic: 9
P value of the Q statistic: 0.0003399239
Explained variances (R2):
                           y1
Tau2 (no predictor)    0.0774
Tau2 (with predictors) 0.0000
R2                     1.0000

Number of studies (or clusters): 10
Number of observed statistics: 10
Number of estimated parameters: 3
Degrees of freedom: 7
-2 log likelihood: -4.208024 
OpenMx status1: 0 ("0" and "1": considered fine; other values indicate problems)

Multivariate random-effects model

## Show the data set
Berkey98

## Multivariate meta-analysis with a random-effects model
summary( mult1 <- meta(y=cbind(PD, AL), v=cbind(var_PD, cov_PD_AL, var_AL), 
                       data=Berkey98, model.name="Multivariate random effects model") )
  trial pub_year no_of_patients   PD    AL var_PD cov_PD_AL var_AL
1     1     1983             14 0.47 -0.32 0.0075    0.0030 0.0077
2     2     1982             15 0.20 -0.60 0.0057    0.0009 0.0008
3     3     1979             78 0.40 -0.12 0.0021    0.0007 0.0014
4     4     1987             89 0.26 -0.31 0.0029    0.0009 0.0015
5     5     1988             16 0.56 -0.39 0.0148    0.0072 0.0304
 Running Multivariate random effects model 

Call:
meta(y = cbind(PD, AL), v = cbind(var_PD, cov_PD_AL, var_AL), 
    data = Berkey98, model.name = "Multivariate random effects model")

95% confidence intervals: z statistic approximation
Coefficients:
             Estimate  Std.Error     lbound     ubound z value  Pr(>|z|)    
Intercept1  0.3448390  0.0536312  0.2397238  0.4499542  6.4298 1.278e-10 ***
Intercept2 -0.3379383  0.0812479 -0.4971813 -0.1786953 -4.1593 3.192e-05 ***
Tau2_1_1    0.0070020  0.0090497 -0.0107351  0.0247391  0.7737    0.4391    
Tau2_2_1    0.0094607  0.0099698 -0.0100797  0.0290010  0.9489    0.3427    
Tau2_2_2    0.0261445  0.0177409 -0.0086270  0.0609161  1.4737    0.1406    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Q statistic on homogeneity of effect sizes: 128.2267
Degrees of freedom of the Q statistic: 8
P value of the Q statistic: 0
Heterogeneity indices (based on the estimated Tau2):
                             Estimate
Intercept1: I2 (Q statistic)   0.6021
Intercept2: I2 (Q statistic)   0.9250

Number of studies (or clusters): 5
Number of observed statistics: 10
Number of estimated parameters: 5
Degrees of freedom: 5
-2 log likelihood: -11.68131 
OpenMx status1: 0 ("0" and "1": considered fine; other values indicate problems)
## Plot the effect sizes
plot(mult1)

mult1.png

Multivariate mixed-effects model

## Multivariate meta-analysis with "publication year-1979" as a predictor 
summary( meta(y=cbind(PD, AL), v=cbind(var_PD, cov_PD_AL, var_AL), data=Berkey98,
              x=scale(pub_year, center=1979), model.name="Multivariate mixed effects model") )
 Running Multivariate mixed effects model 

Call:
meta(y = cbind(PD, AL), v = cbind(var_PD, cov_PD_AL, var_AL), 
    x = scale(pub_year, center = 1979), data = Berkey98, model.name = "Multivariate mixed effects model")

95% confidence intervals: z statistic approximation
Coefficients:
             Estimate  Std.Error     lbound     ubound z value  Pr(>|z|)    
Intercept1  0.3440001  0.0857659  0.1759021  0.5120982  4.0109 6.048e-05 ***
Intercept2 -0.2918175  0.1312796 -0.5491208 -0.0345141 -2.2229   0.02622 *  
Slope1_1    0.0063540  0.1078235 -0.2049761  0.2176842  0.0589   0.95301    
Slope2_1   -0.0705888  0.1620965 -0.3882921  0.2471146 -0.4355   0.66322    
Tau2_1_1    0.0080405  0.0101206 -0.0117955  0.0278766  0.7945   0.42692    
Tau2_2_1    0.0093413  0.0105515 -0.0113392  0.0300218  0.8853   0.37599    
Tau2_2_2    0.0250135  0.0170788 -0.0084603  0.0584873  1.4646   0.14303    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Q statistic on homogeneity of effect sizes: 128.2267
Degrees of freedom of the Q statistic: 8
P value of the Q statistic: 0
Explained variances (R2):
                              y1     y2
Tau2 (no predictor)    0.0070020 0.0261
Tau2 (with predictors) 0.0080405 0.0250
R2                     0.0000000 0.0433

Number of studies (or clusters): 5
Number of observed statistics: 10
Number of estimated parameters: 7
Degrees of freedom: 3
-2 log likelihood: -12.00859 
OpenMx status1: 0 ("0" and "1": considered fine; other values indicate problems)

Three-level mixed-effects model

## Show the data set
head(Cooper03)

## No predictor
summary( meta3(y=y, v=v, cluster=District, data=Cooper03, model.name="Three level random effects model") )
  District Study     y     v Year
1       11     1 -0.18 0.118 1976
2       11     2 -0.22 0.118 1976
3       11     3  0.23 0.144 1976
4       11     4 -0.30 0.144 1976
5       12     5  0.13 0.014 1989
6       12     6 -0.26 0.014 1989
Running Three level random effects model 

Call:
meta3(y = y, v = v, cluster = District, data = Cooper03, model.name = "Three level random effects model")

95% confidence intervals: z statistic approximation
Coefficients:
            Estimate  Std.Error     lbound     ubound z value Pr(>|z|)   
Intercept  0.1844554  0.0805411  0.0265977  0.3423130  2.2902 0.022010 * 
Tau2_2     0.0328648  0.0111397  0.0110314  0.0546982  2.9502 0.003175 **
Tau2_3     0.0577384  0.0307423 -0.0025154  0.1179921  1.8781 0.060362 . 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Q statistic on homogeneity of effect sizes: 578.864
Degrees of freedom of the Q statistic: 55
P value of the Q statistic: 0
Heterogeneity indices (based on the estimated Tau2):
                              Estimate
I2_2 (Typical v: Q statistic)   0.3440
I2_3 (Typical v: Q statistic)   0.6043

Number of studies (or clusters): 11
Number of observed statistics: 56
Number of estimated parameters: 3
Degrees of freedom: 53
-2 log likelihood: 16.78987 
OpenMx status1: 0 ("0" and "1": considered fine; other values indicate problems)
## Year as a predictor
summary( meta3(y=y, v=v, cluster=District, x=scale(Year, scale=FALSE), data=Cooper03, 
               model.name="Three level mixed effects model") )
 Running Three level mixed effects model 

Call:
meta3(y = y, v = v, cluster = District, x = scale(Year, scale = FALSE), 
    data = Cooper03, model.name = "Three level mixed effects model")

95% confidence intervals: z statistic approximation
Coefficients:
            Estimate  Std.Error     lbound     ubound z value Pr(>|z|)   
Intercept  0.1780268  0.0805219  0.0202067  0.3358469  2.2109 0.027042 * 
Slope_1    0.0050737  0.0085266 -0.0116382  0.0217856  0.5950 0.551814   
Tau2_2     0.0329390  0.0111620  0.0110618  0.0548162  2.9510 0.003168 **
Tau2_3     0.0564628  0.0300330 -0.0024007  0.1153264  1.8800 0.060104 . 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Q statistic on homogeneity of effect sizes: 578.864
Degrees of freedom of the Q statistic: 55
P value of the Q statistic: 0
Explained variances (R2):
                        Level 2 Level 3
Tau2 (no predictor)    0.032865  0.0577
Tau2 (with predictors) 0.032939  0.0565
R2                     0.000000  0.0221

Number of studies (or clusters): 11
Number of observed statistics: 56
Number of estimated parameters: 4
Degrees of freedom: 52
-2 log likelihood: 16.43629 
OpenMx status1: 0 ("0" and "1": considered fine; other values indicate problems)

Fixed-effects MASEM

## Show the first 2 studies in Digman97
head(Digman97$data, n=2)

## Show the first 2 sample sizes in Digman97
head(Digman97$n, n=2)

## Stage 1 analysis 
fixed1 <- tssem1(Digman97$data, Digman97$n, method="FEM", model.name="Fixed effects model Stage 1 analysis")
summary(fixed1)
$`Digman 1 (1994)`
       A     C   ES     E    I
A   1.00  0.62 0.41 -0.48 0.00
C   0.62  1.00 0.59 -0.10 0.35
ES  0.41  0.59 1.00  0.27 0.41
E  -0.48 -0.10 0.27  1.00 0.37
I   0.00  0.35 0.41  0.37 1.00

$`Digman 2 (1994)`
       A    C   ES     E     I
A   1.00 0.39 0.53 -0.30 -0.05
C   0.39 1.00 0.59  0.07  0.44
ES  0.53 0.59 1.00  0.09  0.22
E  -0.30 0.07 0.09  1.00  0.45
I  -0.05 0.44 0.22  0.45  1.00
[1] 102 149
Running Fixed effects model Stage 1 analysis

Call:
tssem1FEM(my.df = my.df, n = n, cor.analysis = cor.analysis, 
    model.name = model.name, cluster = cluster, suppressWarnings = suppressWarnings)

Coefficients:
       Estimate Std.Error z value  Pr(>|z|)    
S[1,2] 0.363116  0.013391 27.1171 < 2.2e-16 ***
S[1,3] 0.390176  0.012903 30.2388 < 2.2e-16 ***
S[1,4] 0.103751  0.015070  6.8846 5.796e-12 ***
S[1,5] 0.092246  0.015071  6.1207 9.318e-10 ***
S[2,3] 0.415999  0.012540 33.1741 < 2.2e-16 ***
S[2,4] 0.135208  0.014799  9.1363 < 2.2e-16 ***
S[2,5] 0.141213  0.014891  9.4834 < 2.2e-16 ***
S[3,4] 0.244505  0.014175 17.2488 < 2.2e-16 ***
S[3,5] 0.138167  0.014858  9.2992 < 2.2e-16 ***
S[4,5] 0.424514  0.012396 34.2468 < 2.2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Goodness-of-fit indices:
                                     Value
Sample size                      4496.0000
Chi-square of target model       1499.7340
DF of target model                130.0000
p value of target model             0.0000
Chi-square of independence model 4454.5995
DF of independence model          140.0000
RMSEA                               0.1812
SRMR                                0.1750
TLI                                 0.6581
CFI                                 0.6825
AIC                              1239.7340
BIC                               406.3114
OpenMx status: 0 ("0" and "1": considered fine; other values indicate problems)
## Model specification is based on the RAM formulation 
## S matrix
Phi <- matrix(c(1,"0.3*cor","0.3*cor",1), ncol=2, nrow=2)
S1 <- bdiagMat(list(Diag(c("0.2*e1","0.2*e2","0.2*e3","0.2*e4","0.2*e5")), Phi))
(S1 <- as.mxMatrix(S1))

## A matrix
Lambda <- matrix(c(0,".3*f1_x2",".3*f1_x3",".3*f1_x4",0,".3*f2_x1",0,0,0,".3*f2_x5"),
                 ncol=2, nrow=5)
A1 <- rbind( cbind(matrix(0,ncol=5,nrow=5), Lambda),
             matrix(0, ncol=7, nrow=2) )
(A1 <- as.mxMatrix(A1))

(F1 <- create.Fmatrix(c(1,1,1,1,1,0,0), name="F1"))
FullMatrix 'S1' 

@labels
     [,1] [,2] [,3] [,4] [,5] [,6]  [,7] 
[1,] "e1" NA   NA   NA   NA   NA    NA   
[2,] NA   "e2" NA   NA   NA   NA    NA   
[3,] NA   NA   "e3" NA   NA   NA    NA   
[4,] NA   NA   NA   "e4" NA   NA    NA   
[5,] NA   NA   NA   NA   "e5" NA    NA   
[6,] NA   NA   NA   NA   NA   NA    "cor"
[7,] NA   NA   NA   NA   NA   "cor" NA   

@values
     [,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,]  0.2  0.0  0.0  0.0  0.0  0.0  0.0
[2,]  0.0  0.2  0.0  0.0  0.0  0.0  0.0
[3,]  0.0  0.0  0.2  0.0  0.0  0.0  0.0
[4,]  0.0  0.0  0.0  0.2  0.0  0.0  0.0
[5,]  0.0  0.0  0.0  0.0  0.2  0.0  0.0
[6,]  0.0  0.0  0.0  0.0  0.0  1.0  0.3
[7,]  0.0  0.0  0.0  0.0  0.0  0.3  1.0

@free
      [,1]  [,2]  [,3]  [,4]  [,5]  [,6]  [,7]
[1,]  TRUE FALSE FALSE FALSE FALSE FALSE FALSE
[2,] FALSE  TRUE FALSE FALSE FALSE FALSE FALSE
[3,] FALSE FALSE  TRUE FALSE FALSE FALSE FALSE
[4,] FALSE FALSE FALSE  TRUE FALSE FALSE FALSE
[5,] FALSE FALSE FALSE FALSE  TRUE FALSE FALSE
[6,] FALSE FALSE FALSE FALSE FALSE FALSE  TRUE
[7,] FALSE FALSE FALSE FALSE FALSE  TRUE FALSE

@lbound: No lower bounds assigned.

@ubound: No upper bounds assigned.
FullMatrix 'A1' 

@labels
     [,1] [,2] [,3] [,4] [,5] [,6]    [,7]   
[1,] NA   NA   NA   NA   NA   NA      "f2_x1"
[2,] NA   NA   NA   NA   NA   "f1_x2" NA     
[3,] NA   NA   NA   NA   NA   "f1_x3" NA     
[4,] NA   NA   NA   NA   NA   "f1_x4" NA     
[5,] NA   NA   NA   NA   NA   NA      "f2_x5"
[6,] NA   NA   NA   NA   NA   NA      NA     
[7,] NA   NA   NA   NA   NA   NA      NA     

@values
     [,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,]    0    0    0    0    0  0.0  0.3
[2,]    0    0    0    0    0  0.3  0.0
[3,]    0    0    0    0    0  0.3  0.0
[4,]    0    0    0    0    0  0.3  0.0
[5,]    0    0    0    0    0  0.0  0.3
[6,]    0    0    0    0    0  0.0  0.0
[7,]    0    0    0    0    0  0.0  0.0

@free
      [,1]  [,2]  [,3]  [,4]  [,5]  [,6]  [,7]
[1,] FALSE FALSE FALSE FALSE FALSE FALSE  TRUE
[2,] FALSE FALSE FALSE FALSE FALSE  TRUE FALSE
[3,] FALSE FALSE FALSE FALSE FALSE  TRUE FALSE
[4,] FALSE FALSE FALSE FALSE FALSE  TRUE FALSE
[5,] FALSE FALSE FALSE FALSE FALSE FALSE  TRUE
[6,] FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[7,] FALSE FALSE FALSE FALSE FALSE FALSE FALSE

@lbound: No lower bounds assigned.

@ubound: No upper bounds assigned.
FullMatrix 'F1' 

@labels: No labels assigned.

@values
     [,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,]    1    0    0    0    0    0    0
[2,]    0    1    0    0    0    0    0
[3,]    0    0    1    0    0    0    0
[4,]    0    0    0    1    0    0    0
[5,]    0    0    0    0    1    0    0

@free: No free parameters.

@lbound: No lower bounds assigned.

@ubound: No upper bounds assigned.
## Stage 2 analysis
fixed2 <- tssem2(fixed1, Amatrix=A1, Smatrix=S1, Fmatrix=F1, diag.constraints=TRUE, intervals.type="LB",
                 model.name="Fixed effects model Stage 2 analysis")
summary(fixed2)
 Running Fixed effects model Stage 2 analysis

Call:
wls(Cov = tssem1.obj$pooledS, asyCov = tssem1.obj$acovS, n = tssem1.obj$total.n, 
    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)

95% confidence intervals: Likelihood-based statistic
Coefficients:
             Estimate Std.Error  lbound  ubound z value Pr(>|z|)
Amatrix[1,7]  0.48342        NA 0.44872 0.51787      NA       NA
Amatrix[2,6]  0.56418        NA 0.53680 0.59150      NA       NA
Amatrix[3,6]  0.66160        NA 0.63533 0.68791      NA       NA
Amatrix[4,6]  0.57257        NA 0.54256 0.60243      NA       NA
Amatrix[5,7]  0.47160        NA 0.43552 0.50736      NA       NA
Smatrix[1,1]  0.76630        NA 0.73181 0.79865      NA       NA
Smatrix[2,2]  0.68171        NA 0.65012 0.71184      NA       NA
Smatrix[3,3]  0.56229        NA 0.52677 0.59636      NA       NA
Smatrix[4,4]  0.67216        NA 0.63707 0.70563      NA       NA
Smatrix[5,5]  0.77759        NA 0.74258 0.81032      NA       NA
Smatrix[7,6]  1.08188        NA 1.02603 1.14539      NA       NA

Goodness-of-fit indices:
                                               Value
Sample size                                4496.0000
Chi-square of target model                  680.5811
DF of target model                            4.0000
p value of target model                       0.0000
Number of constraints imposed on "Smatrix"    5.0000
DF manually adjusted                          0.0000
Chi-square of independence model           3100.6516
DF of independence model                     10.0000
RMSEA                                         0.1940
SRMR                                          0.1404
TLI                                           0.4527
CFI                                           0.7811
AIC                                         672.5811
BIC                                         646.9373
OpenMx status1: 0 ("0" and "1": considered fine; other values indicate problems)

Random-effects MASEM

## Stage 1 analysis
random1 <- tssem1(Digman97$data, Digman97$n, method="REM", RE.type="Diag", 
                  model.name="Random effects model Stage 1 analysis")
summary(random1)
 Running Random effects model Stage 1 analysis

Call:
meta(y = ES, v = acovR, RE.constraints = Diag(x = paste(RE.startvalues, 
    "*Tau2_", 1:no.es, "_", 1:no.es, sep = "")), RE.lbound = RE.lbound, 
    I2 = I2, model.name = model.name)

95% confidence intervals: z statistic approximation
Coefficients:
               Estimate   Std.Error      lbound      ubound z value  Pr(>|z|)
Intercept1   3.9465e-01  5.4223e-02  2.8837e-01  5.0092e-01  7.2782 3.384e-13
Intercept10  4.4413e-01  3.2547e-02  3.8034e-01  5.0792e-01 13.6460 < 2.2e-16
Intercept2   4.4009e-01  4.1258e-02  3.5923e-01  5.2096e-01 10.6668 < 2.2e-16
Intercept3   5.4542e-02  6.1716e-02 -6.6418e-02  1.7550e-01  0.8838  0.376821
Intercept4   9.8668e-02  4.6219e-02  8.0812e-03  1.8926e-01  2.1348  0.032776
Intercept5   4.2966e-01  4.0156e-02  3.5096e-01  5.0837e-01 10.6999 < 2.2e-16
Intercept6   1.2851e-01  4.0816e-02  4.8514e-02  2.0851e-01  3.1486  0.001641
Intercept7   2.0526e-01  4.9591e-02  1.0806e-01  3.0245e-01  4.1390 3.488e-05
Intercept8   2.3994e-01  3.1924e-02  1.7737e-01  3.0251e-01  7.5159 5.662e-14
Intercept9   1.8910e-01  4.3014e-02  1.0480e-01  2.7341e-01  4.3963 1.101e-05
Tau2_10_10   1.1151e-02  5.0467e-03  1.2591e-03  2.1042e-02  2.2095  0.027143
Tau2_1_1     3.7207e-02  1.5000e-02  7.8079e-03  6.6607e-02  2.4805  0.013120
Tau2_2_2     2.0305e-02  8.4348e-03  3.7735e-03  3.6837e-02  2.4073  0.016069
Tau2_3_3     4.8220e-02  1.9723e-02  9.5631e-03  8.6876e-02  2.4448  0.014492
Tau2_4_4     2.4610e-02  1.0624e-02  3.7872e-03  4.5434e-02  2.3164  0.020535
Tau2_5_5     1.8725e-02  8.2474e-03  2.5602e-03  3.4889e-02  2.2704  0.023184
Tau2_6_6     1.8256e-02  8.7889e-03  1.0302e-03  3.5482e-02  2.0772  0.037785
Tau2_7_7     2.9424e-02  1.2263e-02  5.3894e-03  5.3459e-02  2.3995  0.016420
Tau2_8_8     9.6511e-03  4.8824e-03  8.1691e-05  1.9220e-02  1.9767  0.048076
Tau2_9_9     2.0934e-02  9.1280e-03  3.0430e-03  3.8824e-02  2.2933  0.021829
               
Intercept1  ***
Intercept10 ***
Intercept2  ***
Intercept3     
Intercept4  *  
Intercept5  ***
Intercept6  ** 
Intercept7  ***
Intercept8  ***
Intercept9  ***
Tau2_10_10  *  
Tau2_1_1    *  
Tau2_2_2    *  
Tau2_3_3    *  
Tau2_4_4    *  
Tau2_5_5    *  
Tau2_6_6    *  
Tau2_7_7    *  
Tau2_8_8    *  
Tau2_9_9    *  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Q statistic on homogeneity of effect sizes: 2381.004
Degrees of freedom of the Q statistic: 130
P value of the Q statistic: 0
Heterogeneity indices (based on the estimated Tau2):
                              Estimate
Intercept1: I2 (Q statistic)    0.9487
Intercept2: I2 (Q statistic)    0.9082
Intercept3: I2 (Q statistic)    0.9414
Intercept4: I2 (Q statistic)    0.8894
Intercept5: I2 (Q statistic)    0.9005
Intercept6: I2 (Q statistic)    0.8537
Intercept7: I2 (Q statistic)    0.9093
Intercept8: I2 (Q statistic)    0.7714
Intercept9: I2 (Q statistic)    0.8746
Intercept10: I2 (Q statistic)   0.8431

Number of studies (or clusters): 14
Number of observed statistics: 140
Number of estimated parameters: 20
Degrees of freedom: 120
-2 log likelihood: -110.8452 
OpenMx status1: 0 ("0" and "1": considered fine; other values indicate problems)
## Stage 2 analysis
random2 <- tssem2(random1, Amatrix=A1, Smatrix=S1, Fmatrix=F1, diag.constraints=TRUE, intervals.type="LB",
                  model.name="Random effects model Stage 2 analysis")
summary(random2)
 Running Random effects model Stage 2 analysis

Call:
wls(Cov = pooledS, asyCov = asyCov, n = tssem1.obj$total.n, 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)

95% confidence intervals: Likelihood-based statistic
Coefficients:
             Estimate Std.Error  lbound  ubound z value Pr(>|z|)
Amatrix[1,7]  0.36536        NA 0.19503 0.49058      NA       NA
Amatrix[2,6]  0.52490        NA 0.44022 0.61202      NA       NA
Amatrix[3,6]  0.58913        NA 0.50941 0.67414      NA       NA
Amatrix[4,6]  0.48656        NA 0.41528 0.56025      NA       NA
Amatrix[5,7]  0.34785        NA 0.18556 0.46774      NA       NA
Smatrix[1,1]  0.86651        NA 0.75933 0.96185      NA       NA
Smatrix[2,2]  0.72448        NA 0.62542 0.80620      NA       NA
Smatrix[3,3]  0.65292        NA 0.54551 0.74050      NA       NA
Smatrix[4,4]  0.76326        NA 0.68611 0.82754      NA       NA
Smatrix[5,5]  0.87900        NA 0.78123 0.96547      NA       NA
Smatrix[7,6]  1.74738        NA 1.29139 3.41224      NA       NA

Goodness-of-fit indices:
                                               Value
Sample size                                4496.0000
Chi-square of target model                   81.2046
DF of target model                            4.0000
p value of target model                       0.0000
Number of constraints imposed on "Smatrix"    5.0000
DF manually adjusted                          0.0000
Chi-square of independence model            514.5603
DF of independence model                     10.0000
RMSEA                                         0.0655
SRMR                                          0.1305
TLI                                           0.6175
CFI                                           0.8470
AIC                                          73.2046
BIC                                          47.5608
OpenMx status1: 0 ("0" and "1": considered fine; other values indicate problems)
  1. More examples

3 Installation

The current version is 0.8-4:

First of all, you need R to run it. Since metaSEM uses OpenMx as the workhorse, OpenMx has to be installed. To install OpenMx, run the following command inside an R session:

install.packages('OpenMx', repos='http://openmx.psyc.virginia.edu/packages/')

See http://openmx.psyc.virginia.edu/installing-openmx for the details on how to install OpenMx. Moreover, metaSEM also depends on the ellipse and MASS packages that can be installed by the following command inside an R session:

install.packages(c('ellipse','MASS'))

Windows platform

Download the Windows binary of metaSEM. If the file is saved at d:\. Run the following command inside an R session:

install.packages(pkgs="d:/metaSEM_0.8-4.zip", repos=NULL)

Please note that d:\ in Windows is represented by either d:/ or d:\\ in R.

Linux and Mac OS X platform

Download the source package of metaSEM. Run the following command (as Root) inside an R session:

install.packages(pkgs="metaSEM_0.8-4.tar.gz", repos=NULL, type="source")

Author: Mike W.-L. Cheung

Created: 2013-05-21 Tue 23:13

Emacs 24.3.1 (Org mode 8.0.3)

Validate XHTML 1.0