Skip to contents

mars_repeated() is an independent general multivariate synthesis function. It does not modify mars(). It builds study covariance blocks from transparent outcome, group/shared-control, and time correlation assumptions.

library(mars)
d <- expand.grid(study = c("S1", "S2", "S3"), group = c("g1", "g2"),
                 outcome = c("pain", "function"), time = c(1, 2), stringsAsFactors = FALSE)
d$control <- "control"; d$yi <- .2 + .1 * (d$group == "g2") + .02 * d$time; d$vi <- .04
fit <- mars_repeated(d, "study", "yi", "vi", outcome_id = "outcome", group_id = "group",
  control_id = "control", time_id = "time", mean_structure = "by_outcome_group_time",
  outcome_correlation = "exchangeable", rho_outcome = .5,
  time_correlation = "ar1", rho_time = .7, rho_shared_control = .4)
fit$coefficients
##                                  term estimate std_error     ci_lower  ci_upper
## mu_function::g1::1 mu_function::g1::1     0.22 0.1112517  0.001950590 0.4380494
## mu_function::g1::2 mu_function::g1::2     0.24 0.1187469  0.007260390 0.4727396
## mu_function::g2::1 mu_function::g2::1     0.32 0.1179537  0.088814903 0.5511851
## mu_function::g2::2 mu_function::g2::2     0.34 0.1333261  0.078685731 0.6013143
## mu_pain::g1::1         mu_pain::g1::1     0.22 0.1333261 -0.041314269 0.4813143
## mu_pain::g1::2         mu_pain::g1::2     0.24 0.1179537  0.008814903 0.4711851
## mu_pain::g2::1         mu_pain::g2::1     0.32 0.1187469  0.087260390 0.5527396
## mu_pain::g2::2         mu_pain::g2::2     0.34 0.1112517  0.121950590 0.5580494
fit$assumptions
## $outcome_correlation
## [1] "exchangeable"
## 
## $time_correlation
## [1] "ar1"
## 
## $rho_outcome
## [1] 0.5
## 
## $rho_time
## [1] 0.7
## 
## $rho_shared_control
## [1] 0.4

The benchmark script inst/benchmarks/mars-repeated-benchmark.R compares the common-effect fit with metafor::rma.mv using the same internally constructed working covariance matrix when metafor is installed.