Description Usage Arguments Details Value Author(s) References See Also Examples
survnma provides interface for Bayesian NMA WinBUGS models
(specifically through R2WinBUGS
). It generates samples
from the posterior distribution and interprets them in terms of survivals and hazards.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
nma_df |
a |
model |
|
type |
a |
prior |
a list of prior values, with elements |
P |
|
inits |
if |
n.chains |
number of chains for WinBUGS to use, default is 3 |
n.iter |
integer specifying how many interations to be ran |
auto_restart |
Boolean to continue running model until convergence or stop after 5 iterations |
connected_check |
logical; if FALSE, does not check if network is connected |
warnings |
logical; if FALSE, warning messages about lack of convergence are skipped |
bugs.directory |
WinBUGS directory path; defaults to |
min_time_change |
numeric; a threshold for merging data points where differences in time are very small (see Details). We suggest a range of 0.01-0.05. Default of 0 does not modify any data. |
... |
additional parameters passed to |
WinBUGS implementation is through R2WinBUGS
package. Additional arguments can be passed via ...
,
including bugs.directory
. We use default of C:/WinBUGS14/
.
WinBUGS models code follows publications of M.J. Ouwens and J.P. Jansen (see References).
Models can be viewed with survnma_model
.
Input data have to follow a particular format, typically obtained from read_km_folder but
data.frame
of inputs can also be specified manually.
Both initial values and priors can be specified by hand. To understand how they are used,
it is recommended to inspect the model with survnma_model
first. The
default generation of initial values (inits = "generate"
) is optimised toward default
vague priors. When using informative priors it is best to set inits = NULL
.
a survnma
class object
Witold Wiecek, Savvas Pafitis
(1) Ouwens, Mario J. N. M., Zoe Philips, and Jeroen P. Jansen. “Network Meta-Analysis of Parametric Survival Curves.” Research Synthesis Methods 1, no. 3–4 (July 2010): 258–71. https://doi.org/10.1002/jrsm.25.
(2) Jansen, Jeroen P. “Network Meta-Analysis of Survival Data with Fractional Polynomials.” BMC Medical Research Methodology 11, no. 1 (May 6, 2011): 61. https://doi.org/10.1186/1471-2288-11-61.
vignette(survivalnma_guide)
for overview,
for working with outputs survival_plot
and hazard_plot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # We read data from some included data files:
nma_df <- data.frame(
stringsAsFactors = FALSE,
"treatment" = c("Suni", "Ifn", "Suni", "Pazo"),
"study" = c("Study 1", "Study 1", "Study 2", "Study 2"),
"baseline" = c("Suni", "Suni", "Suni", "Suni"),
"filepath" = sapply(c("Mota_OS_Suni_KM.txt",
"Mota_OS_Ifn_KM.txt",
"Mot_OS_Suni_KM.txt",
"Mot_OS_Pazo_KM.txt"), function(x)
system.file("extdata", "narrow", x,
package="survivalnma", mustWork=TRUE)))
# example of simple survnma models (fixed effects)
fit_wbl <- survnma(nma_df, "weibull", min_time_change = 0.05)
fit_fp2 <- survnma(nma_df, "fp2", P = c(-1,0), min_time_change = 0.05)
#manually setting a (very informative) prior
#dimension of prior is 2 as Weibull is 2-parameter dist.
fit_wbl <- survnma(nma_df, "weibull",
prior = list("mean" = c(1,1), "prec2" = .1*diag(2)),
min_time_change = 0.05)
#manually setting some WinBUGS options
survnma(nma_df, "weibull", n.iter = 10000, debug = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.