intervalWidth: Calculate the widths of credible intervals

Description Usage Arguments Details Examples

Description

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.

Usage

1
2
3
4
intervalWidth(interval)

## S4 method for signature 'DemographicArray'
intervalWidth(interval)

Arguments

interval

A DemographicArray.

Details

interval must have a dimension of length 2 with dimtype "quantile" specifying the intervals. interval is typically calculated using function credibleInterval.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#' 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)

StatisticsNZ/dembase documentation built on Dec. 25, 2021, 4:49 p.m.