# Set up newly-diagnosed multiple myeloma network
head(ndmm_ipd)
head(ndmm_agd)
ndmm_net <- combine_network(
set_ipd(ndmm_ipd,
study, trt,
Surv = Surv(eventtime / 12, status)),
set_agd_surv(ndmm_agd,
study, trt,
Surv = Surv(eventtime / 12, status),
covariates = ndmm_agd_covs))
# The default knot locations
make_knots(ndmm_net, type = "quantile")
# Increasing the number of knots
make_knots(ndmm_net, n_knots = 10)
# Comparing alternative knot positioning algorithms
# Visualise these with a quick function
plot_knots <- function(network, knots) {
ggplot2::ggplot() +
geom_km(network) +
ggplot2::geom_vline(ggplot2::aes(xintercept = .data$knot),
data = tidyr::pivot_longer(as.data.frame(knots), cols = dplyr::everything(),
names_to = "Study", values_to = "knot"),
linetype = 2, colour = "grey60") +
ggplot2::facet_wrap(~Study) +
theme_multinma()
}
plot_knots(ndmm_net, make_knots(ndmm_net, type = "quantile"))
plot_knots(ndmm_net, make_knots(ndmm_net, type = "quantile_common"))
plot_knots(ndmm_net, make_knots(ndmm_net, type = "quantile_lumped"))
plot_knots(ndmm_net, make_knots(ndmm_net, type = "quantile_longest"))
plot_knots(ndmm_net, make_knots(ndmm_net, type = "equal"))
plot_knots(ndmm_net, make_knots(ndmm_net, type = "equal_common"))
Run the code above in your browser using DataLab