exposure {dembase} | R Documentation

## Calculate exposure from population counts.

### Description

`object` typically has a dimension with `dimtype` `time` and `dimscale` `"Points"`, and a dimension with dimtype `"age"` and dimscale `"Intervals"`. The complete set of choices for age-time-cohort dimensions and dimscales is

`time` | `age` | `cohort`
`Points` | `Intervals` | <none>
`Points` | <none> | <none>
<none> | `Points` | <none>
`Points` | <none> | `Intervals`
<none> | `Points` | `Intervals`

### Usage

    exposure(object, triangles = FALSE, openTriangles = c("weighted", "standard"))

    ## S4 method for signature 'Counts'
    exposure(object, triangles = FALSE, openTriangles = c("weighted", "standard"))

### Arguments

`object` | An object of class `Counts`.
`triangles` | Logical. If `TRUE`, the return value includes a dimension with `dimtype` code"triangle". Defaults to `FALSE`.
`openTriangles` | `"weighted"` (the default) or `"standard"`.

### Details

If `triangles` is `TRUE`, then exposure is calculated separately for lower and upper Lexis triangles. `triangles` can only by `TRUE` if `object` has dimensions with `dimtype` `"time"` and `"age"`.

Argument `openTriangles` governs the way that the exposures for the final age group are calculated when the final age group is open (ie has no upper age limit) and `triangles` is `TRUE`. The sum of the exposures for the upper and lower triangles is unaffected. When `openTriangles` is `"weighted"`, exposure for the upper triangle is twice as large as exposure for the lower triangle (reflecting the fact that the upper triangle includes multiple cohorts). When `openTriangles` is `"standard"` exposure is calculated the same way as it is for other age groups.

### Value

An object of class `Counts`.

### See Also

To calculate exposure for births, see `exposureBirths` To calculate exposure for origin-destination or parent-child arrays, see `addPair`

### Examples

    ## prepare data
    library(demdata)
    popn <- demdata::nz.popn.reg
    popn <- Counts(popn, dimscales = c(year = "Points"))
    popn <- subarray(popn, year %in% c(1996, 2001, 2006, 2011, 2016))
    popn <- collapseDimension(popn, dimension = "region")

    ## no triangles
    exposure(popn)

    ## with triangles
    exposure(popn, triangles = TRUE)

    ## with triangles, openTriangles is "standard"
    exposure(popn, triangles = TRUE, openTriangles = "standard")

    ## cohort
    popn <- Counts(array(4:1,
                         dim = c(1, 4),
                         dimnames = list(cohort = "2001-2005",
                                         age = c(0, 5, 10, 15))))
    exposure(popn)

[Package dembase version 0.0.0.119 Index]