cohort <- data.frame(
age = c(17, 25, 30, NA, 50, 60),
sex = c("M", "F", "F", "M", "F", "M"),
value = c(1, NA, 3, 4, 5, NA),
dementia = c(TRUE, FALSE, FALSE, FALSE, TRUE, FALSE)
)
exclusion_count(
cohort,
age < 18,
is.na(value),
dementia == TRUE,
.criteria_names = c(
"Age < 18 years",
"Missing value",
"History of dementia"
)
)
Run the code above in your browser using DataLab