fitplot {MBNMAtime} | R Documentation |
Plot fitted values from MBNMA model
Description
Plot fitted values from MBNMA model
Usage
fitplot(
mbnma,
treat.labs = NULL,
disp.obs = TRUE,
n.iter = round(mbnma$BUGSoutput$n.iter/4),
n.thin = mbnma$BUGSoutput$n.thin,
...
)
Arguments
mbnma |
An S3 object of class |
treat.labs |
A character vector of treatment labels with which to name graph panels.
Can use |
disp.obs |
A boolean object to indicate whether raw data responses should be plotted as points on the graph |
n.iter |
number of total iterations per chain (including burn in; default: 2000) |
n.thin |
thinning rate. Must be a positive integer. Set
|
... |
Arguments to be sent to |
Details
Fitted values should only be plotted for models that have converged successfully.
If fitted values (theta
) have not been monitored in mbnma$parameters.to.save
then additional iterations will have to be run to get results for these.
Value
Generates a plot of fitted values from the MBNMA model and returns a list containing
the plot (as an object of class c("gg", "ggplot")
), and a data.frame of posterior mean
fitted values for each observation.
Examples
# Make network
painnet <- mb.network(osteopain)
# Run MBNMA
mbnma <- mb.run(painnet,
fun=temax(pool.emax="rel", method.emax="common",
pool.et50="abs", method.et50="random"))
# Plot fitted values from the model
# Monitor fitted values for 500 additional iterations
fitplot(mbnma, n.iter=500)