treatments <- list(c('id' = 'A', 'description' = 'Treatment A'),
c('id' = 'B', 'description' = 'Treatment B'),
c('id' = 'C', 'description' = 'Treatment C'))
data <- list(
c('study' = '01', 'treatment' = 'A', 'responders' = 2, 'sampleSize' = 100),
c('study' = '01', 'treatment' = 'B', 'responders' = 5, 'sampleSize' = 100),
c('study' = '02', 'treatment' = 'B', 'responders' = 6, 'sampleSize' = 110),
c('study' = '02', 'treatment' = 'C', 'responders' = 1, 'sampleSize' = 110),
c('study' = '03', 'treatment' = 'A', 'responders' = 3, 'sampleSize' = 60),
c('study' = '03', 'treatment' = 'C', 'responders' = 4, 'sampleSize' = 80),
c('study' = '03', 'treatment' = 'B', 'responders' = 7, 'sampleSize' = 80))
network <- mtc.network(data, description="Example", treatments=treatments)
plot(network)
data <- read.table(textConnection('
study treatment mean std.dev sampleSize
01 A -1.12 0.6 15
01 B -1.55 0.5 16
02 A -0.8 0.7 33
02 B -1.1 0.5 31'), header=TRUE)
network <- mtc.network(data)
print(network)
Run the code above in your browser using DataLab