From 2ad558e469297e35799a265aea9e912ce41eb5b1 Mon Sep 17 00:00:00 2001 From: Adrian Steffan Date: Fri, 3 Jan 2025 22:11:18 +0100 Subject: [PATCH] Fix score comparison that led to inaccuracies in edge cases --- DESCRIPTION | 2 +- R/cdi_processing.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9bc740a..0642618 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: peekbankr Type: Package Title: Accessing the Peekbank Database and working with Peekbank data -Version: 0.2.3.2 +Version: 0.2.3.3 Authors@R: c( person("Mika", "Braginsky", email = "mika.br@gmail.com", role = c("aut", "cre")), person("Kyle", "MacDonald", email = "kylem412@gmail.com", role = "aut"), diff --git a/R/cdi_processing.R b/R/cdi_processing.R index 1155c60..180f76b 100644 --- a/R/cdi_processing.R +++ b/R/cdi_processing.R @@ -141,7 +141,7 @@ populate_cdi_percentiles <- function(subjects_table) { by = c("instrument_type", "measure", "reference_age", "language"), relationship = "many-to-many" ) %>% - dplyr::filter(score < rawscore) %>% + dplyr::filter(score <= rawscore) %>% dplyr::group_by(across(!c(score, norm_percentile))) %>% dplyr::slice_max(score, n = 1, with_ties = FALSE) %>% dplyr::ungroup() %>%