Learn R Programming

gemtc (version 0.1-2)

mtc.network: Create an mtc.network

Description

Creates an object of class mtc.network

Usage

mtc.network(data, description, treatments)

Arguments

description
Optional. Short description of the network.
treatments
Optional. A data frame with columns `id' and `description' defining the treatments or a vector giving the treatment IDs. Alternatively, a list where each element is a labeled vector defining a single treatment.
data
A data frame defining the arms of each study, containing the columns `study' and `treatment', where `treatment' must refer to an existing treatment ID if treatments were specified. To specify a network with dichotomous data, the number of responders shoul

Value

  • A object of the class mtc.network

encoding

utf8

See Also

read.mtc.network

Examples

Run this code
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