# \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)
# }
dates.b <- c("2017-05-13", "2018-04-12", "2018-12-01")
t.stock <- time_exposed_stock(dates.b, year = 2020, type = "backward")
dates.bd <- c("2018-04-12")
dates.d <- c("2020-05-23")
x <- quarterly_variables(dates.bd, dates.d)
e.death <- count_events_quarter(x)
t.death <- time_exposed_outs(x)
out <- crude_mx(t.stock, e.death, t.death)
SAI.example <- compute_SAI(out, out)
Run the code above in your browser using DataLab