dmphillippo / multinma

Network meta-analysis of individual and aggregate data in Stan
https://dmphillippo.github.io/multinma
33 stars 15 forks source link

Common class interactions without specified treatment classes #9

Open ndunnewind opened 2 years ago

ndunnewind commented 2 years ago

Hi @dmphillippo. According to Dias 2018[^1] (page 239-240), in a meta-regression model with a common interaction "there is a single interaction term b that applies to relative effects of all the treatments relative to treatment 1". However, when trying to fit such a model, multinma requires treatment classes to be specified in the network.

net <- set_agd_arm(atrial_fibrillation, study = studyc, trt = trtc, r = r,  n = n)
fit <- nma(net, regression = ~ .trt:stroke, class_interactions = "common")
Error: Setting `class_interactions` requires treatment classes to be specified in the network.
See set_*() argument `trt_class`.

A solution would be to manually define the treatment classes "placebo" and "treatment".

atrial_fibrillation <- dplyr::mutate(atrial_fibrillation, trt_class = ifelse(trtc == "Placebo/Standard care", "placebo", "treatment"))
net <- set_agd_arm(atrial_fibrillation, study = studyc, trt = trtc, r = r,  n = n, trt_class = trt_class)
fit <- nma(net, regression = ~ .trt:stroke, class_interactions = "common")

Would you accept a PR that allows class_interactions = "common" without specified treatment classes in the network? nma() would then simply assume there are two classes: one for the reference treatment, and one for all others. Maybe this should only work if the user explicitly set a trt_ref in the network and/or with a regression formula without an interaction with the treatment (class), i.e. ~ stroke.

[^1]: Dias, S., Ades, A. E., Welton, N. J., Jansen, J. P., & Sutton, A. J. (2018). Network meta-analysis for decision-making. John Wiley & Sons.

dmphillippo commented 9 months ago

Hi @ndunnewind, sorry for the very slow response - I've been away from work for much of the last couple of years.

My intention with forcing the user to specify trt_class even to fit the single common interaction model was that this model makes some fairly strong assumptions, and requiring trt_class makes the user explicitly specify them.

I can see that this is a bit fiddly from a user perspective, however.

Perhaps we should allow the user to specify class_interactions = "common" without classes in the network, and give a warning like: warn("Using a single common interaction parameter for all treatments against the reference treatment. Specify treatment classes in the network to change this. See set_*() argument `trt_class`.")

This could maybe be demoted to a note with inform() if the user has explicitly set trt_ref.

What do you think? Happy to review a PR (if you're still interested 2 years later!)