Solving error 'invalid subscript type 'list' in mtc.network function

Hello, I am carrying out a network meta-analysis and am starting by creating the network using the mtc.network function.

I have created the data frame 'TherapyFormats' as shown, and inputted into the 'mtc.network' function, but I keep getting this error: Error in studies[ma] : invalid subscript type 'list'

study <- c('Tuleasca, 2018', 'Cho, 2015', 'Horisawa, 2023', 'Raju, 2017', 'Niranjan, 2017', 'Young, 2000', 'Khattab, 2007', 'Middlebrooks, 2023')
diff <- c(2.42, 0.40, 2.04, 2.46, 2.23, 2.85, 3.68, 0.61)
std.err <- c(0.45, 0.54, 0.34, 0.33, 0.21, 0.16, 0.40, 0.28)
treatment <- c('GK', 'GK', 'GK', 'GK', 'GK', 'GK', 'LINAC', 'LINAC')
TherapyFormats <- data.frame(study, diff, std.err, treatment)
id <- c('GK', 'LINAC')
description <- c('Gamma Knife', 'Linear Accelerator')
TherapyFormats_treat <- data.frame(id, description)

network <- mtc.network(data.re = TherapyFormats, treatments = TherapyFormats$treatment, description = "Network", studies = TherapyFormats$study)

I have tried using the 'data.frame' funciton to convert each column into a separate dataframe, but then I get an error saying I am selecting undefined columns.

Any help on this matter would be much appreciated. Thanks in advance.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.