Skip to contents

Performs one effect-value permutation and refits network_meta. The network geometry, study IDs, treatment labels, and sampling variances are held fixed; only the effect-size column is shuffled across rows.

Usage

permutation_network_meta(
  data,
  study_id,
  treatment_1,
  treatment_2,
  effect,
  variance,
  on_error = c("warn", "stop", "keep"),
  ...
)

Arguments

data

A contrast-level network meta-analysis data frame.

study_id

Character string naming the study ID column.

treatment_1

Character string naming the first treatment column.

treatment_2

Character string naming the second treatment column.

effect

Character string naming the effect-size column.

variance

Character string naming the sampling-variance column.

on_error

How fitting errors should be handled. "warn" returns an error object with a warning, "keep" returns the error object silently, and "stop" throws the fitting error.

...

Additional arguments passed to network_meta.

Value

A fitted "nma_mars" object, or an "nma_resample_error" object when fitting fails and errors are retained.

Examples

# \donttest{
nma_dat <- data.frame(
  study = c("S1", "S2", "S3", "S4"),
  treatment_1 = c("A", "A", "B", "A"),
  treatment_2 = c("B", "C", "C", "B"),
  effect = c(0.20, 0.35, 0.10, 0.15),
  variance = c(0.04, 0.05, 0.04, 0.06)
)

perm_fit <- permutation_network_meta(
  data = nma_dat,
  study_id = "study",
  treatment_1 = "treatment_1",
  treatment_2 = "treatment_2",
  effect = "effect",
  variance = "variance",
  model_type = "wls"
)
# }