Summarise follow-up data

summarise_cohort_followup(cohort_followup, by = NULL)

Arguments

cohort_followup

Data returned by construct_cohort_followup()

by

columns in cohort_followup to aggregate the data by. It should be noted that in the followup data and therefore in aggregated results, column names are in UPPERCASE and "." are replaced with "_".

Examples


start_date <- "2020-02-01" # start of follow-up
end_date <- as.character(Sys.Date()) # end of follow-up

cohort <-  data.frame(HETU_ID = c(1,2), 
SYNTYMAPAIVA = c(as.Date("1982-02-04"), as.Date("1980-05-04")),
KUOLINPVM = c(NA, NA))

vacs <-  data.frame(HETU_ID = c(1,1), 
RECORDDATE = as.Date(c("2021-04-20", "2021-05-20")), 
PRODUCT_ID  = c("COV", "COV"))

outcome <- data.frame(HETU_ID = c(1,1, 2),
TAPAHTUMAPVM = as.Date(c("2021-04-25", "2021-06-25", "2021-04-02")))


cohort_vac_outcome <- construct_cohort_vac_outcome(cohort, vacs, outcome,
incident_cases = FALSE,
washout = 0)

cohort_followup <- construct_cohort_followup(cohort_vac_outcome)
followup_summary <- summarise_cohort_followup(cohort_followup, by = c("VACCINE_EFFECT"))