| intervalWidth {dembase} | R Documentation |
Calculate the widths of credible intervals
stored in a DemographicArray.
If (l, u), is a credible interval,
then the width of the interval equals
u - l.
intervalWidth(interval) ## S4 method for signature 'DemographicArray' intervalWidth(interval)
interval |
interval must have a dimension of length
2 with dimtype "quantile"
specifying the intervals. interval is
typically calculated using function
credibleInterval.
#' set.seed(0)
object <- Values(array(runif(n = 20),
dim = c(2, 10),
dimnames = list(sex = c("F", "M"),
iteration = 1:10)))
interval <- credibleInterval(object)
interval
intervalWidth(interval)
object <- Values(array(rpois(n = 20, lambda = 10),
dim = c(2, 10),
dimnames = list(sex = c("F", "M"),
iteration = 1:10)))
interval <- credibleInterval(object, width = 90)
interval
intervalWidth(interval)