{bnma}R Documentation

Run the model using the network object


This is the core function that runs the model in our program. Before running this function, we need to specify data, prior, JAGS code, etc. using

  inits = NULL,
  RNG.inits = NULL,
  n.chains = 3, = 1e+05,
  setsize = 10000, = 50000,
  conv.limit = 1.05, = NULL



Network object created from function


Initial values for the parameters being sampled. If left unspecified, program will generate reasonable initial values.


List of and .RNG.seed that control the JAGS RNGs. Please refer to jags.model function in rjags for more information.


Number of chains to run

Maximum number of iterations that user is willing to run. If the algorithm is not converging, it will run up to iterations before printing a message that it did not converge


Number of iterations that are run between convergence checks. If the algorithm converges fast, user wouldn't need a big setsize. The number that is printed between each convergence checks is the gelman-rubin diagnostics and we would want that to be below the conv.limit the user specifies.

Final number of iterations that the user wants to store. If after the algorithm converges, user wants less number of iterations, we thin the sequence. If the user wants more iterations, we run extra iterations to reach the specified number of runs


Convergence limit for Gelman and Rubin's convergence diagnostic. Point estimate is used (instead of 95 percent C.I.) to test convergence of parameters for study-specific baselines (eta), average treatment effect (d), between-study heterogeneity (log variance (logvar)), and regression parameters when covariates (beta) or baseline risk (b_bl).

Parameters that user wants to save besides the default parameters saved. See code using cat(network$code) to see which parameters can be saved.



Data that is put into rjags function jags.model


Initial values that are either specified by the user or generated as a default


List of and .RNG.seed used for reproducibility

Parameters that are saved. Add more parameters in if other variables are desired


Half of the converged sequence is thrown out as a burnin


If the number of iterations user wants ( is less than the number of converged sequence after burnin, we thin the sequence and store the thinning interval


MCMC samples stored using jags. The returned samples have the form of mcmc.list and can be directly applied to coda functions


Maximum Gelman and Rubin's convergence diagnostic calculated for the final sample

Variables that were tested for convergence using Gelman and Rubin's diagnostic


Contains deviance statistics such as pD (effective number of parameters) and DIC (Deviance Information Criterion)


Rank probability calculated for each treatments. rank.preference parameter in is used to define whether higher or lower value is preferred. The numbers are probabilities that a given treatment has been in certain rank in the sequence.


#parkinson's example (normal)
network <- with(parkinsons,{, Study, Treat, SE = SE, response = "normal")

result <-

[Package bnma version 1.6.0 Index]