Learn R Programming

pcnetmeta (version 1.0)

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

Description

creat.tab generates a summary table file from the result file given by function nma.ab. In the table file, diagonal elements are estimated event rates; upper and lower triangular elements show the RRs, RDs, or ORs with 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 function nma.ab. We can use 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 be given following the estimated value in the output table file; otherwise, estimated value would be f
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 the treatment names, which are shown in the result table as row and column names. The default is "treat1", "treat2", and so on.
order
logical. If TRUE (the default), lower treatment ID is compared to higher treatment ID for RRs, RDs or ORs in the off-diagonal elements in result table; otherwise, higher treatment ID is compared to lower one for corresponding effect size.
o.path
output path. If not specified, it would be set as the working directory before runing this function.

Value

  • A file containing the summary table, with diagonal elements being estimated 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 and Chu H. "Network meta-analysis of randomized clinical trials: Reporting the proper summaries." Clinical Trials 2013.

Examples

Run this code
## summary RR-RD table for network Ara 2009
data(Ara09)
attach(Ara09)
nma.ab(s.id = Study.ID, t.id = Treatment, event.n = r, total.n = n,
       f.name = "Ara09_", n.iter = 2000, dic = FALSE)
detach(Ara09)
create.tab(summary.stat = read.table("Ara09_Summary.stat", header = TRUE),
           type = "SE", f.name = "Ara09-")

## summary RR-RD table for network Lam 2007
data(Lam07.Summary)
data(Lam07)
create.tab(summary.stat = Lam07.Summary, compare = 3, f.name = "Lam07-",
           trtname = Lam07$trtname, order = FALSE)

Run the code above in your browser using DataLab