I am trying to obtain categories of patients based on year of diagnosis (cohort_start_date) using addCategories. I have created the following code:
cdm$outcome <- cdm$outcome %>%
PatientProfiles::addCategories(
variable = "cohort_start_date",
categories = list("diag_yr_gp" = list(
"2003 to 2006" = as.Date(c("2003-01-01", "2006-12-31")),
"2007 to 2010" = as.Date(c("2007-01-01", "2010-12-31")),
"2011 to 2014" = as.Date(c("2011-01-01", "2014-12-31")),
"2015 to 2018" = as.Date(c("2015-01-01", "2018-12-31")),
"2019 to 2022" = as.Date(c("2019-01-01", "2022-12-31"))
)
)
)
What i would expect is categories of for example "2003-2006" however i get 2003-01-01 to 2003-01-01. So its the right category but the label is not correct.
I am trying to obtain categories of patients based on year of diagnosis (cohort_start_date) using addCategories. I have created the following code:
What i would expect is categories of for example "2003-2006" however i get 2003-01-01 to 2003-01-01. So its the right category but the label is not correct.