Skip to contents

network_meta_repeated() is an independent arm-level continuous-outcome NMA function. It leaves network_meta() unchanged. It internally derives treatment contrasts and their within-study covariance, including shared-arm covariance in multi-arm trials.

library(mars)
arm_data <- data.frame(
  study = rep(c("S1", "S2", "S3"), each = 3),
  treatment = rep(c("A", "B", "C"), 3),
  mean = c(10, 12, 13, 9, 11, 12, 11, 14, 15), sd = 2, n = 30
)
fit <- network_meta_repeated(arm_data, "study", "treatment", "mean", "sd", "n")
fit$coefficients
#>                term estimate std_error ci_lower ci_upper
#> B::common B::common 2.333333 0.2981424 1.748985 2.917682
#> C::common C::common 3.333333 0.2981424 2.748985 3.917682

Outcomes and times

When outcomes or times are repeated within treatment arms, supply their identifiers. The function constructs arm-mean covariance using the selected outcome and time correlation assumptions. These are assumptions, retained in fit$assumptions, not correlations inferred from marginal standard deviations.

repeated_data <- expand.grid(
  study = c("S1", "S2", "S3"), treatment = c("A", "B"),
  outcome = c("pain", "function"), time = c(1, 2), stringsAsFactors = FALSE
)
repeated_data$mean <- with(repeated_data, 10 + 2 * (treatment == "B") + time)
repeated_data$sd <- 2
repeated_data$n <- 25

repeated_fit <- network_meta_repeated(
  repeated_data, "study", "treatment", "mean", "sd", "n",
  outcome = "outcome", time = "time", treatment_effects = "by_outcome_time",
  outcome_correlation = "exchangeable", rho_outcome = .5,
  time_correlation = "ar1", rho_time = .7
)
repeated_fit$coefficients
#>                          term estimate std_error ci_lower ci_upper
#> B::function::1 B::function::1        2 0.3265986 1.359878 2.640122
#> B::function::2 B::function::2        2 0.3265986 1.359878 2.640122
#> B::pain::1         B::pain::1        2 0.3265986 1.359878 2.640122
#> B::pain::2         B::pain::2        2 0.3265986 1.359878 2.640122
repeated_fit$assumptions
#> $outcome_correlation
#> [1] "exchangeable"
#> 
#> $time_correlation
#> [1] "ar1"
#> 
#> $rho_outcome
#> [1] 0.5
#> 
#> $rho_time
#> [1] 0.7
#> 
#> $arms_independent
#> [1] TRUE

Benchmark

For a common-effect mean-difference model, the script inst/benchmarks/network-meta-repeated-benchmark.R compares the MARS coefficients with netmeta when that optional package is installed. The MARS function additionally retains the internally constructed covariance blocks, which are needed for repeated outcomes and times.