insightsengineering / tlg-catalog

A catalog of Tables, Listings and Graphs (TLGs) created with NEST R packages
https://insightsengineering.github.io/tlg-catalog/
Other
20 stars 8 forks source link

AEL02/AEL03: Imputed dates are not flagged even though the standard footnote says it #268

Open kathrinflunkert opened 1 month ago

kathrinflunkert commented 1 month ago

Hi!

I think there is an issue in the template for the standard listing of AEs / SAEs: There is a standard footnote that indicates that Onset dates and Durations that are based on an imputed start/end dates are flagged, but the code does not cover this step at the moment.

The expected output should have asterisks like this when the imputation flags for start/end date are not empty:

image
BFalquet commented 1 month ago

(just as a side note, there is no formal way to include referential footnotes in a listings. A workaround is available here)

kathrinflunkert commented 1 month ago

What I mean is that I find it quite risky and misleading for people coming to the TLG catalog that they see this standard footnote displayed there, but the code is not actually setting these asterisks. So if they simply copy paste this code they will display the footnote, but will not flag those imputed values! At least give users a warning on the AEL02 TLG catalog page that this feature is not implemented and link them to the workaround. However, as this is part of the standard DSG template for listings, I wonder why the code does not cover this workaround? The code for the preparation of the dataset for the listing consists of dplyr code anyway, so why not include this step as well (copied from the link you provided):?

  dplyr::mutate(ASTDY = factor(
    ifelse(!is.na(ASTDTF), paste0(as.character(ASTDY), "**"), as.character(ASTDY)),
    levels = c(sapply(sort(unique(adae$ASTDY)), paste0, c("", "**")))
BFalquet commented 1 month ago

Please note that this is an public repository. Do no publish confidential information such as internal links.

Melkiades commented 1 month ago

What I mean is that I find it quite risky and misleading for people coming to the TLG catalog that they see this standard footnote displayed there, but the code is not actually setting these asterisks. So if they simply copy paste this code they will display the footnote, but will not flag those imputed values! At least give users a warning on the AEL02 TLG catalog page that this feature is not implemented and link them to the workaround. However, as this is part of the standard DSG template for listings, I wonder why the code does not cover this workaround? The code for the preparation of the dataset for the listing consists of dplyr code anyway, so why not include this step as well (copied from the link you provided):?

  dplyr::mutate(ASTDY = factor(
    ifelse(!is.na(ASTDTF), paste0(as.character(ASTDY), "**"), as.character(ASTDY)),
    levels = c(sapply(sort(unique(adae$ASTDY)), paste0, c("", "**")))

We need to add a disclaimer for this and a reference to the workaround in {rlistings}. What do you think @shajoezhu?