relative.effect.table: Table of relative effects

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

relative.effect.tableR Documentation

Table of relative effects

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

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

model <- mtc.model(smoking)
# To save computation time we load the samples instead of running the model
## Not run: results <- mtc.run(model)
results <- readRDS(system.file("extdata/luades-smoking-samples.rds", 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

gemtc documentation built on July 9, 2023, 5:33 p.m.