View source: R/plotting-fxns.R
arbutus_plot_point | R Documentation |
Plots a histogram of the simulated values along with the observed values for a single test statistic when a point estimate is used
arbutus_plot_point( x, stat, xlab = NA, ylab = "Counts", col = NA, breaks = NA, las = 1, lwd = 3, legend = TRUE, legend.pos = "topright", cex = 1, ... )
x |
an |
stat |
the name of the test statistic to plot |
xlab |
x-axis label. Defaults to |
ylab |
y-axis label. Defaults to "Counts". |
col |
colours used in plot. The first colour corresponds to the histogram of simulated test statistics. The second colour to the line representing the observed value of the test statistic. If no argument is supplied, the function uses the default colours. |
breaks |
the number of breaks in the histogram. Defaults to 20. |
las |
plot parameter (see |
lwd |
plot parameter (see |
legend |
logical, specifying whether a legend should be included. |
legend.pos |
postiion of the legend (see |
cex |
plot parameter for legend (see |
... |
additional arguments to be passed to plot |
This function is designed to give researchers a quick visual inspection of model adequacy by plotting the simulated distribution of a test statistic along with the empirical estimate.
If the empirical estimate lies in the tails of the distribution of simulated test statistics, the model can be rejected as inadequate.
The p-values corresponding to this plot can be obtained with the function
pvalue_arbutus
.
plot.arbutus
wraps this function and allows results from all
test statistics to be viewed in a single plot.
arbutus
, compare_pic_stat
,
plot.arbutus
## finch data data(finch) phy <- finch$phy data <- finch$data[,1] ## pretend that the tree has already been rescaled modelad <- arbutus(phy, data=data, nsim=20) arbutus_plot_point(modelad, "m.sig") ## Not run: ## use diversitree to fit a BM model with ML require(diversitree) lik <- make.bm(phy, data) f <- find.mle(lik, x.init=1) modelad.bm <- arbutus(f) arbutus_plot_point(modelad.bm, "m.sig") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.