Skip to contents

Predict treatment contrasts from a fitted network_meta model

Usage

# S3 method for class 'nma_mars'
predict(
  object,
  newdata,
  se.fit = FALSE,
  interval = c("none", "confidence", "prediction"),
  level = 0.95,
  treatment_1 = "treatment_1",
  treatment_2 = "treatment_2",
  ...
)

Arguments

object

A fitted nma_mars object.

newdata

Data frame containing treatment_1 and treatment_2 columns for contrasts to predict.

se.fit

Logical; if TRUE, returns an approximate prediction standard error.

interval

Type of interval; one of "none", "confidence", or "prediction". Prediction intervals add the fitted model's between-study variance estimate to the contrast variance.

level

Confidence level for intervals.

treatment_1, treatment_2

Column names used in newdata.

...

Unused.

Value

Data frame with predicted contrast estimates and optional uncertainty.

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)
)
nma_fit <- network_meta(
  nma_dat,
  study_id = "study",
  treatment_1 = "treatment_1",
  treatment_2 = "treatment_2",
  effect = "effect",
  variance = "variance",
  model_type = "wls"
)
predict(
  nma_fit,
  data.frame(treatment_1 = "A", treatment_2 = "C"),
  interval = "confidence"
)
#>   treatment_1 treatment_2  estimate se
#> 1           A           C 0.3192982 NA
# }