# \donttest{
# This can take a while
t.stock <- time_exposed_stock(pop_2006$date.birth, 2006, "forward")
t.stock <- t.stock[t.stock$age <= 100, ]
temp <- quarterly_variables(death_2006$date.birth, death_2006$date.death)
e.death <- count_events_quarter(temp)
e.death <- e.death[e.death$age <= 100, ]
t.birth <- time_exposed_newborns(birth_2006$date.birth)
out <- crude_mx(t.stock, e.death, time.birth = t.birth)
SAI.example <- compute_SAI(out, out)
dx <- tapply(e.death$number.events, e.death$age, sum)
Lax <- tapply(t.stock$time.exposed, t.stock$age, sum)
table.ex <- data.frame(age = 0:100, mx.a = dx/Lax)
example <- annual2quarterly(table.a = table.ex, SAIs = SAI.example, mx = TRUE)
# }
Run the code above in your browser using DataLab