time_exposed_newborns: Data frame of time exposed at risk for a population of...

View source: R/time_exposed_newborns.R

time_exposed_newbornsR Documentation

Data frame of time exposed at risk for a population of newborns

Description

Computes for each combination of age and seasonal quarter the total time exposed at risk (in years) of a population of newborns, during the year of their birth, this is up to the end of the year when they born.

Usage

time_exposed_newborns(date.birth, random.b = TRUE)

Arguments

date.birth

A character vector with the dates of birth in format either "yyyy-mm-dd" or "yyyy-mm-dd hour:min:secs" (for instance, "2016-01-20 12:00:00") of the members of the population. If "hour:min:secs" is omitted the function imputes either "12:00:00", if 'random.b = FALSE', or a random hour by default.

random.b

A 'TRUE/FALSE' argument indicating whether the exact moment ("hour:min:secs") when the birth occurs within the day is randomly selected. If TRUE, this overwrites "hour:min:secs" in 'date.birth' even if those have been declared. By default, TRUE.

Value

A data frame with the time exposed at risk for each (potential) combination of integer age and age and season quarter of the population. The data frame has the following components:

age

Integer age to which the time exposed at risk corresponds.

quarter.age

Age quarter to which the time exposed at risk corresponds.

quarter.calendar

Calendar (time, season) quarter to which the time exposed at risk corresponds.

time.exposed

Total time (in years) exposed at risk of the population during the quarter determined for the combination of 'age', 'quarter.age' and 'quarter.season'.

Author(s)

Jose M. Pavia pavia@uv.es

Josep Lledo josep.lledo@uv.es

References

Pavia, JM and Lledo, J (2022). Estimation of the Combined Effects of Ageing and Seasonality on Mortality Risk. An application to Spain. *Journal of the Royal Statistical Society, Series A (Statistics in Society)*, 185(2), 471-497. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/rssa.12769")}

See Also

time_exposed_stock, time_exposed_outs, time_exposed_ins

Examples

dates.b <- c("1920-05-13", "1999-04-12", "2019-01-01")
out <- time_exposed_newborns(dates.b)

qlifetable documentation built on April 19, 2023, 5:09 p.m.