# \donttest{
# Using the triptans data
network <- mbnma.network(triptans)
# Run an Emax dose-response MBNMA
emax <- mbnma.run(network, fun=demax(), 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)
# 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)
# }
Run the code above in your browser using DataLab