predict.mbnma: Predict responses for different doses of agents in a given...

Description Usage Arguments Details Value Examples

View source: R/mbnma-class.R

Description

Used to predict responses for different doses of agents or to predict the results of a new study. This is calculated by combining relative treatment effects with a given reference treatment response (specific to the population of interest).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## S3 method for class 'mbnma'
predict(
  object,
  n.doses = 15,
  max.doses = NULL,
  exact.doses = NULL,
  E0 = 0,
  synth = "fixed",
  ...
)

Arguments

object

An S3 object of class "mbnma" generated by running a dose-response MBNMA model

n.doses

A number indicating the number of doses at which to make predictions within each agent. The default is 15.

max.doses

A list of numbers. Each named element in the list corresponds to an agent (either named similarly to agent names given in the data, or named correspondingly to the codes for agents given in mbnma) and each number for that element corresponds to the maximum dose of the given agent, below which several predictions will be calculated at different doses (the number of these is determined by n.doses). Can only take positive values. If left as NULL (the default) results will be predicted based on the maximum dose of each agent given in the data.

exact.doses

A list of numeric vectors. Each named element in the list correponds to an agent (either named similarly to agent names given in the data, or named correspondingly to the codes for agents given in mbnma) and each number within the vector for that element corresponds to a dose of the agent for which to predict responses. Doses can only take positive values.

E0

An object to indicate the value(s) to use for the response at dose = 0 (i.e. placebo) in the prediction. This can take a number of different formats depending on how it will be used/calculated. The default is 0 but this will typically lead to non-sensical predictions.

  • numeric() A single numeric value representing the deterministic response at dose = 0, given on the natural scale - so for binomial data, proportions should be given and for Poisson data, a rate should be given.

  • character() A single string representing a stochastic distribution for the response at dose = 0, given on the natural scale - so for binomial data, proportions should be given and for Poisson data, a rate should be given. This is specified as a random number generator (RNG) given as a string, and can take any RNG distribution for which a function exists in R. For example: "rnorm(n, 7, 0.5)".

  • data.frame() A data frame containing data in the long format (one row per study arm) to be meta-analysed to estimate the dose = 0 (placebo) response. This could be a set of observational studies that are specific to the population on which to make predictions, or it can be a subset of the study arms within the MBNMA dataset that investigate placebo. See ref.synth()

synth

A character object that can take the value "fixed" or "random" to specify the the type of pooling to use for synthesis of E0 if a data frame has been provided for it. Using "random" rather than "fixed" for synth will result in wider 95\% CrI for predictions.

...

Arguments to be sent to R2jags::jags() for synthesis of the network reference treatment effect (using ref.synth())

Details

The range of doses on which to make predictions can be specified in one of two ways:

  1. Use max.dose and n.doses to specify the maximum dose for each agent and the number of doses within that agent for which to predict responses. Doses will be chosen that are equally spaced from zero to the maximum dose for each agent. This is useful for generating plots of predicted responses (using [plot-mbnma.predict]) as it will lead to fitting a smooth dose-response curve (provided n.doses is sufficiently high).

  2. Use exact.doses to specify the exact doses for which to predict responses for each agent. This may be more useful when ranking different predicted responses using [rank-mbnma.predict]

Value

An S3 object of class mbnma.predict that contains the following elements:

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
# Using the triptans data
network <- mbnma.network(HF2PPITT)

# Run an Emax dose-response MBNMA
emax <- mbnma.emax(network, emax="rel", ed50="rel", method="random")


###########################
###### Specifying E0 ######
###########################

#### Predict responses using deterministic value for E0 ####
# Data is binomial so we specify E0 on the natural scale as a probability
pred <- predict(emax, E0 = 0.2)

# Specifying non-sensical values will return an error
#pred <- predict(emax, E0 = -10)
### ERROR ###

#### Predict responses using stochastic value for E0 ####
# Data is binomial so we might want to draw from a beta distribution
pred <- predict(emax, E0 = "rbeta(n, shape1=1, shape2=5)")

# Misspecifying the RNG string will return an error
#pred <- predict(emax, E0 = "rbeta(shape1=1, shape2=5)")
### ERROR ###


#### Predict responses using meta-analysis of dose = 0 studies ####

# E0 is assigned a data frame of studies to synthesis
# Can be taken from placebo arms in triptans dataset
ref.df <- network$data.ab[network$data.ab$agent==1,]

# Synthesis can be fixed/random effects
pred <- predict(emax, E0 = ref.df, synth="random")



######################################################################
#### Specifying which doses/agents for which to predict responses ####
######################################################################

# Change the number of predictions for each agent
pred <- predict(emax, E0 = 0.2, n.doses=20)
pred <- predict(emax, E0 = 0.2, n.doses=3)

# Change the range of predicted doses to be the same for all agents
# But only predict responses for a subset of agents
pred <- predict(emax, E0 = 0.2,
            max.doses=list("Placebo"=0, "eletriptan"=5, "sumatriptan"=5))
plot(pred) # Plot predictions

# Specify several exact combinations of doses and agents to predict
pred <- predict(emax, E0 = 0.2,
            exact.doses=list("eletriptan"=c(0:5), "sumatriptan"=c(1,3,5)))
plot(pred) # Plot predictions

# Print and summarise `mbnma.predict` object
print(pred)
summary(pred)

# Plot `mbnma.predict` object
plot(pred)

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