relative.effect.table: Table of relative effects

Description Usage Arguments Value Author(s) See Also Examples

View source: R/relative.effect.table.R

Description

Generates a table of the relative effects of all pairs of treatments. Unlike relative.effect, this method stores summaries only, not raw samples.

Usage

1
2
3
4
5
6
7
8
relative.effect.table(result, covariate=NA)

## S3 method for class 'mtc.relative.effect.table'
print(x, ...)
## S3 method for class 'mtc.relative.effect.table'
forest(x, t1, use.description=FALSE, ...)
## S3 method for class 'mtc.relative.effect.table'
as.data.frame(x, ...)

Arguments

result

An object of S3 class mtc.result to derive the relative effects from.

covariate

(Regression analyses only) Value of the covariate at which to compute relative effects.

x

An object of S3 class mtc.relative.effect.table.

t1

Baseline treatment for the Forest plot.

use.description

Display treatment descriptions instead of treatment IDs.

...

Additional arguments.

Value

Returns an mtc.relative.effect.table object containing the quantiles of the calculated relative effects of all pair-wise comparisons among the treatments.

The result will be pretty printed as an n-by-n table of relative treatment effects. It can also be used to produce Forest plots against any arbitrary baseline. Finally, the as.data.frame generic method makes it possible to export the table for use in Excel or other spreadsheet software, using the core R methods write.csv or write.csv2.

Author(s)

Gert van Valkenhoef

See Also

relative.effect

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
model <- mtc.model(smoking)
# To save computation time we load the samples instead of running the model
## Not run: results <- mtc.run(model)
results <- dget(system.file("extdata/luades-smoking.samples.gz", package="gemtc"))

# Creates a forest plot of the relative effects
tbl <- relative.effect.table(results)

# Print the n*n table
print(tbl)

# Plot effect relative to treatment "C"
forest(tbl, "C")

# Write to CSV (e.g. to import to Excel, then use in a Word table)
## Not run: write.csv(tbl, "smoking-effects.csv")
# Note: use write.csv2 for Western European locales

Example output

Loading required package: coda
Log Odds Ratio (95% CrI)

sh: 1: rm: Permission denied
            A              0.491 (-0.2985, 1.341)    0.8273 (0.3878, 1.353)     1.098 (0.2692, 2.006)  
 -0.491 (-1.341, 0.2985)              B              0.3411 (-0.4809, 1.17)    0.6044 (-0.3083, 1.579) 
-0.8273 (-1.353, -0.3878)  -0.3411 (-1.17, 0.4809)              C              0.2619 (-0.5322, 1.116) 
-1.098 (-2.006, -0.2692)  -0.6044 (-1.579, 0.3083)  -0.2619 (-1.116, 0.5322)              D            

gemtc documentation built on May 15, 2021, 1:07 a.m.