
# These two data sets specify the same ordered categorical data for outcomes
# r0 < r1 < r2, but the first uses the "inclusive" format and the second the
# "exclusive" format.
df_inclusive <- tibble::tribble(~r0, ~r1, ~r2,
1, 1, 1,
5, 4, 1,
5, 2, 2,
10, 5, 0,
5, 5, 0,
7, NA, 6, # Achieved r2 or not (no r1)
10, 4, NA) # Achieved r1 or not (no r2)
df_exclusive <- tibble::tribble(~r0, ~r1, ~r2,
0, 0, 1,
1, 3, 1,
3, 0, 2,
5, 5, 0,
0, 5, 0,
1, NA, 6, # Achieved r2 or not (no r1)
6, 4, NA) # Achieved r1 or not (no r2)
(r_inclusive <- with(df_inclusive, multi(r0, r1, r2, inclusive = TRUE)))
(r_exclusive <- with(df_exclusive, multi(r0, r1, r2, inclusive = FALSE)))
# Counts are always stored in exclusive format
stopifnot(isTRUE(all.equal(r_inclusive, r_exclusive)))
## HTA Plaque Psoriasis
library(dplyr)
# Ordered outcomes here are given as "exclusive" counts
head(hta_psoriasis)
# Calculate lowest category count (failure to achieve PASI 50)
pso_dat <- hta_psoriasis %>%
mutate(`PASI<50` = sample_size - rowSums(cbind(PASI50, PASI75, PASI90), na.rm = TRUE))
# Set up network
pso_net <- set_agd_arm(pso_dat,
study = paste(studyc, year),
trt = trtc,
r = multi(`PASI<50`, PASI50, PASI75, PASI90,
inclusive = FALSE,
type = "ordered"))
pso_net
Run the code above in your browser using DataLab