Test Scenarios
The following code generates various types of covariance matrices to
demonstrate how the within-study meta-analytic tool calculates pooled
estimates from the data.
## Different covariance matrices to test
# A null covariance matrix (no inter-dependencies of the variables)
null.mx <- matrix(
c(
1.0000000, 0.0000000, 0.0000000, 0.0000000,
0.0000000, 1.0000000, 0.0000000, 0.0000000,
0.0000000, 0.0000000, 1.0000000, 0.0000000,
0.0000000, 0.0000000, 0.0000000, 1.0000000
),
nrow = 4, ncol = 4, byrow = TRUE
)
# A covariance matrix with a mix of inter-dependencies of the variables
cor.matrix <- matrix(
c(
1.0000000, 0.8486251, 0.4047249, 0.2656064,
0.8486251, 1.0000000, 0.5038092, 0.1947458,
0.4047249, 0.5038092, 1.0000000, 0.1061337,
0.2656064, 0.1947458, 0.1061337, 1.0000000
),
nrow = 4, ncol = 4, byrow = TRUE
)
# A covariance matrix where all inter-dependencies of the variables is very low
low.mx <- matrix(
c(
1.0000000, 0.1000100, 0.1000100, 0.1000100,
0.1000100, 1.0000000, 0.1000100, 0.1000100,
0.1000100, 0.1000100, 1.0000000, 0.1000100,
0.1000100, 0.1000100, 0.1000100, 1.0000000
),
nrow = 4, ncol = 4, byrow = TRUE
)
# A covariance matrix where all inter-dependencies of the variables is very high
high.mx <- matrix(
c(
1.0000000, 0.8000100, 0.8000100, 0.8000100,
0.8000100, 1.0000000, 0.8000100, 0.8000100,
0.8000100, 0.8000100, 1.0000000, 0.8000100,
0.8000100, 0.8000100, 0.8000100, 1.0000000
),
nrow = 4, ncol = 4, byrow = TRUE
)
# A covariance matrix where some of the inter-dependencies of the variables are negative
test_neg.mx <- matrix(c(
1.00000000, 0.87654321, 0.54321098, -0.32109876,
0.87654321, 1.00000000, 0.65432109, 0.43210987,
0.54321098, 0.65432109, 1.00000000, 0.76543210,
-0.32109876, 0.43210987, 0.76543210, 1.00000000
), nrow = 4, ncol = 4, byrow = TRUE)
Results of non-independence (within-study) meta-analysis
approach