plot.htest_boot: Diagnostic plot of result held in htest_boot object

Description Usage Arguments Details Value See Also Examples

View source: R/htest_boot-class.R

Description

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.

Usage

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, ...)

Arguments

x

Value of class 'htest_boot'

breaks

The number of breaks to use when plotting the distribution, the default is calculated from n.iter of the call to nestedRanksTest

col

Fill color for histogram bars, passed to hist.

border

Border color for histogram bars, passed to hist

digits

Number of digits to use for statistic and p-value, the default is taken from the "digits" option

main

Main title, passed to hist

xlab

X-axis label, passed to hist

ylab

Y-axis label, passed to hist

p.col

Observed value line colour, passed to abline

p.lty

Observed value line type, passed to abline

p.lwd

Observed value line width, passed to abline

...

Additional arguments passed to hist and abline for plotting

Details

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.

Value

None

See Also

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'

Examples

 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)

douglasgscofield/nestedRanksTest documentation built on May 13, 2017, 4:38 a.m.