mbnma.emax.hill: Run MBNMA model with an Emax dose-response function (with a...

Description Usage Arguments Value Dose-response parameters References Examples

View source: R/run.functions.R

Description

Fits a Bayesian model-based network meta-analysis (MBNMA) with a defined dose-response function. Follows the methods of \insertCitemawdsley2016;textualMBNMAdose. This function acts as a wrapper for mbnma.run() that uses more clearly defined parameter names.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
mbnma.emax.hill(
  network,
  emax = "rel",
  ed50 = "rel",
  hill = "common",
  method = "common",
  class.effect = list(),
  UME = FALSE,
  cor = TRUE,
  var.scale = NULL,
  parameters.to.save = NULL,
  pd = "pv",
  parallel = FALSE,
  likelihood = NULL,
  link = NULL,
  priors = NULL,
  arg.params = NULL,
  ...
)

Arguments

network

An object of class mbnma.network.

emax

Refers to the Emax parameter of the Emax dose-response function. Can take either "rel", "common", "random", or be assigned a numeric value (see details).

ed50

Refers to the ED50 parameter of the Emax dose-response function. Can take either "rel", "common", "random", or be assigned a numeric value (see details).

hill

Refers to the Hill parameter of the Emax dose-response function. Can take either "rel", "common", "random", or be assigned a numeric value (see details).

method

Can take either "common" or "random" to indicate whether relative effects should be modelled with between-study heterogeneity or not (see details).

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 ("common" or "random"). Element names should match dose-response parameter names (which will therefore depend on whether or not a wrapper function has been used for mbnma.run()). For example: list("beta.2"="fixed", "beta.3"="random") when using mbnma.run() or list("ed50"="fixed", "hill"="random") when using mbnma.emax.hill().

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.

cor

A boolean object that indicates whether correlation should be modelled between relative effect dose-response parameters (TRUE) or not (FALSE). This is automatically set to FALSE if class effects are modelled or if multiple dose-response functions are fitted.

var.scale

A numeric vector indicating the relative scale of variances between correlated dose-response parameters when relative effects are modelled on more than one dose-response parameter and cor=TRUE (see details). Each element of the vector refers to the relative scale of each of the dose-response parameters that is modelled using relative effects.

parameters.to.save

A character vector containing names of parameters to monitor in JAGS

pd

Can take either:

  • pv only pV will be reported (as automatically outputted by R2jags).

  • plugin calculates pD by the plug-in method \insertCitespiegelhalter2002MBNMAdose. It is faster, but may output negative non-sensical values, due to skewed deviances that can arise with non-linear models.

  • pd.kl calculates pD by the Kullback-Leibler divergence \insertCiteplummer2008MBNMAdose. This will require running the model for additional iterations but will always produce a positive result.

  • popt calculates pD using an optimism adjustment which allows for calculation of the penalized expected deviance \insertCiteplummer2008MBNMAdose

parallel

A boolean value that indicates whether JAGS should be run in parallel (TRUE) or not (FALSE). If TRUE then the number of cores to use is automatically calculated.

likelihood

A string indicating the likelihood to use in the model. Can take either "binomial", "normal" or "poisson". If left as NULL the likelihood will be inferred from the data.

link

A string indicating the link function to use in the model. Can take any link function defined within JAGS (e.g. "logit", "log", "probit", "cloglog") or be assigned the value "identity" for and identity link function. If left as NULL the link function will be automatically assigned based on the likelihood.

priors

A named list of parameter values (without indices) and replacement prior distribution values given as strings using distributions as specified in JAGS syntax (see examples).

arg.params

Contains a list of arguments sent to mbnma.run() by dose-response specific wrapper functions

...

Arguments to be sent to R2jags.

Value

An object of S3 class(c("mbnma", "rjags")) containing parameter results from the model. Can be summarized by print() and can check traceplots using R2jags::traceplot() or various functions from the package mcmcplots.

Nodes that are automatically monitored (if present in the model) have the following interpretation. These will have an additional suffix that relates to the name/number of the dose-response parameter to which they correspond (e.g. d.ed50 or d.1):

If there are errors in the JAGS model code then the object will be a list consisting of two elements - an error message from JAGS that can help with debugging and model.arg, a list of arguments provided to mbnma.run() which includes jagscode, the JAGS code for the model that can help users identify the source of the error.

Dose-response parameters

References

\insertAllCited

Examples

 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Using the triptans data
network <- mbnma.network(HF2PPITT)

# Fit an Emax (with Hill parameter) dose-response MBNMA with random treatment
#effects on Emax, ED50 and Hill
emax.hill <- mbnma.emax.hill(network, emax="rel", ed50="rel", hill="rel",
                 method="random")

# Fit an Emax (with Hill parameter) dose-response MBNMA with common treatment
#effects on Emax, a single random parameter estimated for ED50
#and a single common parameter estimated for Hill
emax.hill <- mbnma.emax.hill(network, emax="rel", ed50="random", hill="common",
                 method="common")

# Assign a specific numerical value for Hill parameter
emax.hill <- mbnma.emax.hill(network, emax="rel", ed50="rel", hill=5)


########## Class effects ##########

# Generate a dataset with one class for active treatments and one for placebo
class.df <- HF2PPITT
class.df$class <- ifelse(class.df$agent=="placebo", "placebo", "active")
netclass <- mbnma.network(class.df)

# Fit an Emax (with Hill parameter) function with common relative effects on
#all parameters and common class effects on ED50 and Hill.
emax.hill <- mbnma.emax.hill(netclass,
                 emax="rel", ed50="rel", hill="rel", method="common",
                 class.effect=list(ed50="common", hill="common"))


####### Priors #######

# Obtain priors from an Emax (with Hill parameter) function with
#relative effects on Emax and ED50 and a single common parameter for Hill
emax.hill <- mbnma.emax.hill(network,
                 emax="rel", ed50="rel", hill="common", method="common")
print(emax.hill$model.arg$priors)

# Set new more informative prior distributions
newpriors <- list(beta.hill = "dnorm(0,0.5) T(,0)")

emax.hill <- mbnma.emax.hill(network,
                 emax="rel", ed50="rel", hill="common", method="common",
                 priors=newpriors)


########## Sampler options ##########

# Change the number of MCMC iterations, the number of chains, and the thin
emax.hill <- mbnma.emax.hill(network, emax="rel", ed50="rel", hill=2,
                 n.iter=5000, n.thin=5, n.chains=4)

# Calculate effective number of parameters via plugin method
emax.hill <- mbnma.emax.hill(network, emax="rel", ed50="rel", hill=2,
                 pd="plugin")

# Calculate effective number of parameters via Kullback-Leibler method
emax.hill <- mbnma.emax.hill(network, emax="rel", ed50="rel", hill=2,
                 pd="pd.kl")


####### Examine MCMC diagnostics (using mcmcplots package) #######

# Density plots
mcmcplots::denplot(emax.hill)

# Traceplots
mcmcplots::traplot(emax.hill)

# Caterpillar plots
mcmcplots::caterplot(emax.hill, "d.emax")


########## Output ###########

# Print R2jags output and summary
print(emax.hill)
summary(emax.hill)

# Plot forest plot of results
plot(emax.hill)

MBNMAdose documentation built on Sept. 13, 2020, 5:08 p.m.