count_events_quarter: Data frame of number of events occurring in each...

View source: R/count_events_quarter.R

count_events_quarterR Documentation

Data frame of number of events occurring in each Lexis-diagram quarter

Description

Computes for each integer age and each combination of age and seasonal quarter the number of events occurring in population. The computation is performed using the associated data frame of quarterly variables corresponding to the population obtained using the quarterly_variables function.

Usage

count_events_quarter(x)

Arguments

x

A data.frame output of the quarterly_variables function.

Value

A data frame with the time exposed at risk for each (potential) combination of integer age and age and season quarter of the input dataset. 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.

number.events

Number of events that occurred during the quarter determined for the combination of 'age', 'quarter.age' and 'quarter.calendar'.

Note

The structure of the dataset is similar to those obtained using the time_exposed_outs, time_exposed_ins and time_exposed_stock functions.

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")}

Examples

dates.b <- c("1920-05-13", "1999-04-12", "2019-01-01")
dates.e <- c("2002-03-23", "2009-04-12", "2019-01-01")
x <- quarterly_variables(dates.b, dates.e)
out <- count_events_quarter(x)

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