View source: R/nma.model.shared.R
nma.model.shared | R Documentation |
Creates BUGS code which can be run through nma.run()
. Handles a combination of arm-level
and contrast-level data.
nma.model.shared(
data_arm = NULL,
data_contrast = NULL,
outcome,
differences,
N = NULL,
sd.a = NULL,
se.diffs = NULL,
var.arm1 = NULL,
reference,
type = "consistency",
time = NULL,
family = NULL,
link = NULL,
effects,
prior.mu = "DEFAULT",
prior.d = "DEFAULT",
prior.sigma = "DEFAULT"
)
data_arm |
A |
data_contrast |
A |
outcome |
A string indicating the name of your outcome variable for arm-based studies. |
differences |
A string indicating the name of the differences (outcome) for contrast-based studies |
N |
A string indicating the name of the variable containing the number of participants in each arm for arm-based data |
sd.a |
A string (only required for continuous outcomes with arm-level data) indicating variable name of the standard deviation of the outcome. Standard errors should be converted to standard deviation by multiplying by the square root of the sample size prior to using this function. |
se.diffs |
A string indicating the variable name of the standard errors of the differences in data_contrast. |
var.arm1 |
A string (only required for contrast-based continuous data in networks with multi-arm trials) indicating the variable name of the variance of the treatment in arm 1 in each study |
reference |
A string for the treatment that will be seen as the 'referent' comparator and labeled as treatment 1 in the BUGS code. This is often a placebo or control drug of some kind. |
type |
If type="inconsistency", an inconsistency model will be built. By default, type="consistency" and a consistency model is built. will be built. |
time |
A string (only required for binomial-cloglog or poisson-log models) indicating the name of variable indicating person-time followup (e.g person years) or study followup time. |
family |
A string indicating the family of the distribution of the outcome for arm-based trials. Options are: "binomial", "normal", "poisson" |
link |
The link function for the nma model for arm-based models. Options are "logit" (binomial family), "log" (binomial family), "cloglog" (poisson family), "identity" (normal family). |
effects |
A string indicating the type of treatment effect relative to baseline. Options are "fixed" or "random". |
prior.mu |
A string of BUGS code that defines priors on the baseline treatment effects. By default, independent normal priors are used with mean 0 and standard deviation 15u, where u is the largest maximum likelihood estimator in single trials \insertCite@see @gemtcBUGSnet. |
prior.d |
A string of BUGS code that defines define priors on relative treatment effects. By default, independent normal priors are used with mean 0 and standard deviation 15u, where u is the largest maximum likelihood estimator in single trials \insertCite@see @gemtcBUGSnet. |
prior.sigma |
A string of BUGS code that defines the prior on the variance of relative treatment effects. By default, a uniform distribution with range 0 to u is used, where u is the largest maximum likelihood estimator in single trials \insertCite@see @gemtcBUGSnet. |
nma.model
returns an object of class BUGSnetModel
which is a list containing the following components:
bugs
- A long character string containing BUGS code that will be run in jags
.
data
- The data used in the BUGS code.
scale
- The scale of the outcome, based on the chosen family and link function
examples are "Risk Ratio" (relative risk), "Odds Ratio", "Mean Difference", "Hazard Ratio"
trt.key
- Treatments mapped to integer numbers, used to run BUGS code.
...
gemtcBUGSnet
\insertRefTSD3BUGSnet
data.prep
, nma.run
data(diabetes.sim)
diabetes.slr <- data.prep(arm.data = diabetes.sim,
varname.t = "Treatment",
varname.s = "Study")
#Random effects, consistency model.
#Binomial family, cloglog link. This implies that the scale will be the Hazard Ratio.
diabetes.re.c <- nma.model(
data = diabetes.slr,
outcome = "diabetes",
N = "n",
reference = "Placebo",
family = "binomial",
link = "cloglog",
effects = "random",
type = "consistency",
time = "followup"
)
#Fixed effects, consistency model.
#Binomial family, cloglog link. This implies that the scale will be the Hazard Ratio.
diabetes.fe.c <- nma.model(
data = diabetes.slr,
outcome = "diabetes",
N = "n",
reference = "Placebo",
family = "binomial",
link = "cloglog",
effects = "fixed",
type = "consistency",
time = "followup"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.