Description Usage Arguments Value Examples
View source: R/studyCM_matrix.R
To calculate the contribution matrix.
1 | studyCM_matrix(comp.all, nmt)
|
comp.all |
all comparisoin |
nmt |
results from model_netmeta function |
matrix
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | LDT1 <- read.csv(system.file("extdata", "HR_SH_D.csv", package = "net.meta"))
trt1 <- read.table(system.file("extdata", "HR_SH_D.txt", package = "net.meta"),
header=TRUE,quote = '"', stringsAsFactors=FALSE)
trt1$description <- factor(trt1$description, trt1$description)
LDT1$study <- factor(LDT1$study, unique(LDT1$study))
nmt1 <- model_netmeta(long.data = LDT1,
treatment=LDT1$treatment,
id.treatments = trt1,
reference = "A",
outcome = "HR")
name1 <- NULL
for(i in 1:(length(trt1$id)-1)){
name1 <- c(name1, paste0(trt1$id[i], ":", trt1$id[-(1:i)]))
}
study.CM1 <- studyCM_matrix(name1, nmt1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.