Learn R Programming

pcnetmeta (version 1.3)

create.tab: Generate a summary table file for arm-based method

Description

create.tab generates a concise table file from the summary result given by the function nma.ab, and the table demonstrates mutual relationships between different treatments. In the table file, diagonal elements are population-averaged event rates; upper and lower triangular elements show the risk ratio (RR), risk difference (RD), or odds ratio (OR) with the corresponding credible interval or standard error.

Usage

create.tab(summary.stat, type = "CI", compare = 1, f.name = "", trtname,
           order = TRUE, o.path = getwd())

Arguments

summary.stat
a data frame read from the summary result file generated by the function nma.ab. We can use the function read.table to import the file.
type
a charater string. It should be set as either "CI" (the default) or "SE". If set as "CI", credible interval would follow the estimated value in the generated table file; otherwise, estimated value would be followed b
compare
an integer chosen from 1 (the default), 2, 3, 4, 5, and 6. 1 stands for upper triangular elements in the table being RR and lower being RD; 2 for upper
f.name
a character string indicating the name of generated table file. The default is an empty character.
trtname
a vector of character string indicating treatment names, and they would be used as the row and column names in the generated table. The default is "treat1", "treat2", and so on.
order
logical. If TRUE (the default), lower treatment ID is compared to higher treatment ID for effect sizes (e.g., RR, RD, and OR) in the off-diagonal elements in the generated table; otherwise, higher treatment ID is compared to lower one for co
o.path
output path. If not specified, it would be set as the working directory before runing this function.

Value

  • A file containing a summary table for treatment comparisons, with diagonal elements being population-averaged event rates and off-diagonal elements being RRs, RDs, or ORs with their credible intervals or standard errors.

References

Zhang J, Carlin BP, Neaton JD, Soon GG, Nie L, Kane R, Virnig BA, Chu H (2014). "Network meta-analysis of randomized clinical trials: Reporting the proper summaries." Clin Trials 11(2), 246--262.

Examples

Run this code
## summary RR-RD table for network Middleton 2010
data(Middleton10)
attach(Middleton10)
set.seed(12345)
nma.ab(s.id = sid, t.id = tid, event.n = r, total.n = n,
       f.name = "Middleton10_", n.iter = 500, dic = FALSE)
detach(Middleton10)
create.tab(summary.stat = read.table("Middleton10_Summary.stat", header = TRUE),
           type = "CI", f.name = "Middleton10-")

Run the code above in your browser using DataLab