| exposure {dembase} | R Documentation |
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
|
exposure(object, triangles = FALSE, openTriangles = c("weighted", "standard"))
## S4 method for signature 'Counts'
exposure(object, triangles = FALSE, openTriangles = c("weighted", "standard"))
object |
An object of class |
triangles |
Logical. If |
openTriangles |
|
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.
An object of class Counts.
To calculate exposure for births, see exposureBirths
To calculate exposure for origin-destination or parent-child
arrays, see addPair
## 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)