mbnma.comparisons.Rd
Identify unique contrasts within a network that make up all the head-to-head comparisons. Repetitions of the same treatment comparison are grouped together.
mbnma.comparisons(df)
A data frame containing variables studyID
and treatment
(as numeric codes) that
indicate which treatments are used in which studies.
A data frame of unique comparisons in which each row represents a different comparison.
t1
and t2
indicate the treatment codes that make up the comparison. nr
indicates the number
of times the given comparison is made within the network.
If there is only a single follow-up observation for each study within the dataset (i.e. as for standard
network meta-analysis) nr
will represent the number of studies that compare treatments t1
and
t2
.
If there are multiple observations for each study within the dataset (as in time-course MBNMA)
nr
will represent the number of time points in the dataset in which treatments t1
and t2
are
compared.
df <- data.frame(studyID=c(1,1,2,2,3,3,4,4,5,5,5),
treatment=c(1,2,1,3,2,3,3,4,1,2,4)
)
# Identify unique comparisons within the data
mbnma.comparisons(df)
#> # A tibble: 6 × 3
#> # Groups: t1, t2 [6]
#> t1 t2 nr
#> <dbl> <dbl> <int>
#> 1 1 2 2
#> 2 1 3 1
#> 3 1 4 1
#> 4 2 3 1
#> 5 2 4 1
#> 6 3 4 1
# Using the triptans headache dataset
network <- mbnma.network(triptans) # Adds treatment identifiers
#> Values for `agent` with dose = 0 have been recoded to `Placebo`
#> agent is being recoded to enforce sequential numbering
mbnma.comparisons(network$data.ab)
#> # A tibble: 55 × 3
#> # Groups: t1, t2 [55]
#> t1 t2 nr
#> <dbl> <dbl> <int>
#> 1 1 2 4
#> 2 1 3 10
#> 3 1 4 6
#> 4 1 5 2
#> 5 1 6 15
#> 6 1 7 2
#> 7 1 8 17
#> 8 1 9 5
#> 9 1 10 1
#> 10 1 11 1
#> # ℹ 45 more rows