mbnma.write {MBNMAdose} | R Documentation |
Write MBNMA dose-response model JAGS code
Description
Writes JAGS code for a Bayesian time-course model for model-based network meta-analysis (MBNMA).
Usage
mbnma.write(
fun = dpoly(degree = 1),
method = "common",
regress.mat = NULL,
regress.effect = "common",
sdscale = FALSE,
cor = FALSE,
cor.prior = "wishart",
omega = NULL,
om = list(rel = 5, abs = 10),
class.effect = list(),
UME = FALSE,
likelihood = "binomial",
link = NULL
)
Arguments
fun |
An object of |
method |
Can take either |
regress.mat |
A Nstudy x Ncovariate design matrix of meta-regression covariates |
regress.effect |
Indicates whether effect modification should be assumed to be
|
sdscale |
Logical object to indicate whether to write a model that specifies a reference SD
for standardising when modelling using Standardised Mean Differences. Specifying |
cor |
A boolean object that indicates whether correlation should be modelled
between relative effect dose-response parameters. This is
automatically set to |
cor.prior |
NOT CURRENTLY IN USE - indicates the prior distribution to use for the correlation/covariance
between relative effects. Must be kept as |
omega |
A scale matrix for the inverse-Wishart prior for the covariance matrix used
to model the correlation between dose-response parameters (see Details for dose-response functions). |
om |
a list with two elements that report the maximum relative ( |
class.effect |
A list of named strings that determines which dose-response
parameters to model with a class effect and what that effect should be
( |
UME |
A boolean object to indicate whether to fit an Unrelated Mean Effects model that does not assume consistency and so can be used to test if the consistency assumption is valid. |
likelihood |
A string indicating the likelihood to use in the model. Can take either |
link |
A string indicating the link function to use in the model. Can take any link function
defined within JAGS (e.g. |
Details
When relative effects are modelled on more than one dose-response parameter and
cor = TRUE
, correlation between the dose-response parameters is automatically
estimated using a vague Wishart prior. This prior can be made slightly more informative
by specifying the relative scale of variances between the dose-response parameters using
omega
. cor
will automatically be set to FALSE
if class effects are modelled.
Value
A single long character string containing the JAGS model generated based on the arguments passed to the function.
Examples
# Write model code for a model with an exponential dose-response function,
# with random treatment effects
model <- mbnma.write(fun=dexp(),
method="random",
likelihood="binomial",
link="logit"
)
names(model) <- NULL
print(model)
# Write model code for a model with an Emax dose-response function,
# relative effects modelled on Emax with a random effects model,
# a single parameter estimated for ED50 with a common effects model
model <- mbnma.write(fun=demax(emax="rel", ed50="common"),
likelihood="normal",
link="identity"
)
names(model) <- NULL
print(model)
# Write model code for a model with an Emax dose-response function,
# relative effects modelled on Emax and ED50.
# Class effects modelled on ED50 with common effects
model <- mbnma.write(fun=demax(),
likelihood="normal",
link="identity",
class.effect=list("ed50"="common")
)
names(model) <- NULL
print(model)
# Write model code for a model with an Emax dose-response function,
# relative effects modelled on Emax and ED50 with a
# random effects model that automatically models a correlation between
# both parameters.
model <- mbnma.write(fun=demax(),
method="random",
likelihood="normal",
link="identity",
)
names(model) <- NULL
print(model)