dmphillippo / multinma

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

Including Three-Arm Study in Contrast-Level NMA #38

Closed tristancurteis closed 3 months ago

tristancurteis commented 3 months ago

Hi @dmphillippo, hope you are well!

It's unclear if there is actually an issue with the package or if I'm not understanding how to run this correctly. Essentially I'm trying to interpret the following guidance within the package for conducting an NMA with a three-arm study. Input data are mean differences versus placebo.

If a study has three or more arms (so two or more relative effects), set the standard error se for the reference arm data row equal to the standard error of the mean outcome on the reference arm (this determines the covariance of the relative effects, when expressed as differences in mean outcomes between arms).

Data format is as follows (there are more studies in the actual data):

y se trt study -1 0.3 TrtA StudyA -0.5 0.2 TrtB StudyA NA NA Pbo StudyA -0.4 0.2 TrtA StudyB NA NA Pbo StudyB

No issues when data are two-arm as per StudyB. I have attempted replacing the NA in column se for StudyA with a value (e.g. 0.05) but I get the following error in R when calling set_agd_contrast:

Error: ! Multiple baseline arms (where y = NA) in a study or studies.

Any advice on how to correctly prepare the format of the data so that I can use multinma for an NMA for studies where one of which is more than two arms, would be appreciated.

Thank you very much!

dmphillippo commented 3 months ago

Hi @tristancurteis

I would check your data: it looks like you have a study with more than one y=NA. You will need to input the se of the reference arm when you have more than two arms, so that the correlations can be accounted for. The correct format looks something like

y se trt study
-1 0.3 TrtA StudyA
-0.5 0.2 TrtB StudyA
NA 0.05 Pbo StudyA
-0.4 0.2 TrtA StudyB
NA NA Pbo StudyB

From your error message I suspect you have another study somewhere that looks like

y se trt study
-1 0.3 TrtA StudyC
NA 0.2 TrtB StudyC
NA 0.05 Pbo StudyC

i.e. more than one y is NA.

If you're still getting errors, can you share a reproducible example?

Thanks!

tristancurteis commented 3 months ago

Hi @dmphillippo, thanks so much. I accidently had repeated rows for the same study within the dataset. Should have spotted that one. The function now works with the three-arm study. Thanks very much for your help!

dmphillippo commented 3 months ago

Excellent, glad we got to the bottom of it!