# Create an mbnma.network object from the data
network <- mbnma.network(triptans)
# Generate a network plot from the data
plot(network)
# Generate a network plot at the agent level that removes loops indicating comparisons
#within a node
plot(network, level="agent", remove.loops=TRUE)
# Generate a network plot at the treatment level that colours nodes by agent
plot(network, v.color="agent", remove.loops=TRUE)
# Generate a network plot that includes connections via the dose-response function
# For a one parameter dose-response function (e.g. exponential)
plot(network, level="treatment", doselink=1, remove.loops=TRUE)
# For a two parameter dose-response function (e.g. Emax)
plot(network, level="treatment", doselink=2, remove.loops=TRUE)
# Arrange network plot in a star with the reference treatment in the centre
plot(network, layout=igraph::as_star(), label.distance=3)
#### Plot a network with no placebo data included ####
# Make data with no placebo
noplac.df <- network$data.ab[network$data.ab$narm>2 & network$data.ab$agent!=1,]
net.noplac <- mbnma.network(noplac.df)
# Plotting network automatically plots connections to Placebo via dose-response
plot(net.noplac)
# Using the triptans headache dataset
print(triptans)
# Define network
network <- mbnma.network(triptans, description="Example network")
summary(network)
plot(network)
Run the code above in your browser using DataLab