Description Usage Arguments Details Value See Also Examples
plot.htest_boot
creates a diagnostic plot of a return value
held in a list of class 'htest_boot'
, as returned by e.g.,
nestedRanksTest
. The plot contains a histogram of the
null distribution generated by' bootstrapping plotted with
hist
, and a verticle line indicating the observed value
plotted with abline
.
1 2 3 4 5 6 7 8 | ## S3 method for class 'htest_boot'
plot(x, breaks, col = "lightblue", border = NA,
digits = getOption("digits"), main = paste(sep = "", x$method, ", ",
x$data.name, "\n", names(x$statistic), " = ", format(signif(x$statistic,
max(1L, digits - 2L))), ", P = ", format.pval(x$p.value, digits = max(1L,
digits - 3L))), xlab = "Distribution of Z-scores", ylab = paste(sep = "",
"Frequency (out of ", x$n.iter, ")"), p.col = "red", p.lty = 2,
p.lwd = 2, ...)
|
x |
Value of class |
breaks |
The number of breaks to use when plotting the distribution,
the default is calculated from |
col |
Fill color for histogram bars, passed to |
border |
Border color for histogram bars, passed to |
digits |
Number of digits to use for statistic and p-value, the
default is taken from the |
main |
Main title, passed to |
xlab |
X-axis label, passed to |
ylab |
Y-axis label, passed to |
p.col |
Observed value line colour, passed to |
p.lty |
Observed value line type, passed to |
p.lwd |
Observed value line width, passed to |
... |
Additional arguments passed to |
If there is no null distribution included in the class, e.g., because
the' options lightweight = TRUE
or n.iter = 1
were given to
nestedRanksTest
, this function produces an error.
None
print.htest_boot
for printing test results,
hist
and abline
for plotting options,
and nestedRanksTest
for one test that
returns an object of class 'htest_boot'
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | require(graphics)
data(woodpecker_multiyear)
## n.iter set to 1000 to shorten completion time
res.a <- nestedRanksTest(Distance ~ Year | Granary, n.iter = 1000,
data = woodpecker_multiyear,
subset = Species == "agrifolia")
res.l <- nestedRanksTest(Distance ~ Year | Granary, n.iter = 1000,
data = woodpecker_multiyear,
subset = Species == "lobata")
opa = par(mfrow = c(2, 1))
## Defaults
plot(res.l)
## Modify colours, line type and main title
plot(res.a, main = "Quercus agrifolia", col = "lightgreen",
p.col = "brown4", p.lty = 1)
par(opa)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.