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.
time_exposed_newborns(date.birth, random.b = TRUE)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:
Integer age to which the time exposed at risk corresponds.
Age quarter to which the time exposed at risk corresponds.
Calendar (time, season) quarter to which the time exposed at risk corresponds.
Total time (in years) exposed at risk of the population during the quarter determined for the combination of `age`, `quarter.age` and `quarter.season`.
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.
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.
Jose M. Pavia pavia@uv.es
Josep Lledo josep.lledo@uv.es
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. tools:::Rd_expr_doi("10.1111/rssa.12769")
time_exposed_stock, time_exposed_outs, time_exposed_ins
dates.b <- c("1920-05-13", "1999-04-12", "2019-01-01")
out <- time_exposed_newborns(dates.b)
Run the code above in your browser using DataLab