-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug when transposing to have toxicity grades in columns using tm_t_events_by_grade #1310
Comments
Hi, I think I something similar was reported recently but I don't find it now to check if it was fixed or what was done. Thanks for the report. We'll see what we can do. I edited your question to set code formatting. Could you report the |
Thanks, please do reach out to me for the dummy .rds files I have created so that you can re-produce the issue with my reprex code. [email protected] Sessioninfo() below:
|
Thanks! I am not sure if I will be fixing this or someone else, but in any case it will be easier to not need to pass the data files via email. |
Sure, dput outputs below: ADSL <-
structure(list(STUDYID = structure(c("XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX"), label = "Study Identifier"),
USUBJID = structure(c("1", "2", "3", "4", "5", "6", "7",
"8", "9", "10", "11", "12", "13", "14", "15", "16", "17",
"18", "19", "20", "21", "22", "23", "24", "25", "26", "27",
"28", "29", "30", "31", "32", "33", "34", "35", "36", "37",
"38", "39", "40", "41", "42", "43", "44", "45", "46", "47",
"48", "49", "50", "51", "52", "53", "54", "55", "56", "57",
"58", "59", "60", "61", "62", "63", "64", "65", "66", "67",
"68", "69", "70", "71", "72", "73", "74", "75", "76", "77",
"78", "79", "80", "81", "82", "83", "84", "85", "86", "87",
"88", "89", "90", "91", "92", "93", "94", "95", "96", "97",
"98", "99", "100", "101", "102", "103", "104", "105"), label = "Unique Subject Identifier"),
TRT01A = structure(c(2L, 1L, 2L, 1L, 3L, 1L, 1L, 3L, 1L,
2L, 2L, 3L, 3L, 1L, 2L, 3L, 1L, 1L, 2L, 3L, 1L, 3L, 2L, 1L,
1L, 3L, 3L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, 3L, 1L, 1L, 3L, 1L,
1L, 2L, 3L, 2L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 2L,
2L, 1L, 2L, 2L, 1L, 1L, 1L, 3L, 1L, 1L, 3L, 1L, 3L, 1L, 2L,
3L, 1L, 1L, 3L, 1L, 1L, 2L, 3L, 1L, 2L, 1L, 1L, 2L, 2L, 1L,
3L, 1L, 1L, 2L, 1L, 1L, 2L, 3L, 1L, 1L, 2L, 3L, 2L, 3L, 2L,
1L, 3L, 1L, 3L, 3L, 1L), levels = c("Dummy A", "Dummy B",
"Dummy C"), class = "factor")), row.names = c(NA, -105L), class = c("tbl_df",
"tbl", "data.frame")) ADAE <-
structure(list(STUDYID = structure(c("XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX"), label = "Study Identifier"), USUBJID = structure(c("1",
"2", "2", "3", "4", "5", "5", "5", "6", "7", "8", "9", "10",
"11", "12", "13", "13", "14", "15", "16", "16", "17", "17", "18",
"18", "18", "19", "19", "20", "20", "21", "22", "23", "23", "23",
"23", "23", "24", "24", "25", "26", "26", "26", "27", "27", "28",
"28", "29", "29", "29", "30", "30", "31", "31", "32", "33", "33",
"34", "35", "35", "36", "36", "36", "37", "38", "38", "38", "38",
"39", "40", "41", "41", "42", "42", "43", "44", "44", "45", "46",
"47", "48", "48", "48", "49", "49", "50", "51", "51", "52", "53",
"54", "55", "56", "57", "58", "58", "59", "60", "60", "60", "61",
"62", "62", "63", "63", "63", "63", "63", "64", "65", "66", "67",
"68", "69", "70", "70", "71", "71", "72", "73", "74", "74", "74",
"74", "75", "76", "77", "78", "78", "78", "78", "78", "78", "79",
"80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "89",
"89", "90", "91", "92", "93", "94", "95", "95", "95", "96", "97",
"97", "98", "99", "99", "100", "100", "101", "102", "103", "104",
"104", "105"), label = "Unique Subject Identifier"), AEDECOD = structure(c("AECodedterm1",
"AECodedterm3", "AECodedterm2", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm2", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm2", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm2",
"AECodedterm2", "AECodedterm1", "AECodedterm1", "AECodedterm2",
"AECodedterm2", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm2", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm3", "AECodedterm3", "AECodedterm3",
"AECodedterm1", "AECodedterm2", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm2",
"AECodedterm2", "AECodedterm1", "AECodedterm3", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm2",
"AECodedterm1", "AECodedterm1", "AECodedterm3", "AECodedterm2",
"AECodedterm1", "AECodedterm1", "AECodedterm2", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm2", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm3",
"AECodedterm1", "AECodedterm2", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm3", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm2",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm2", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm2", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm3", "AECodedterm1",
"AECodedterm2", "AECodedterm1", "AECodedterm2"), label = "Dictionary-Derived Term"),
AEBODSYS = structure(c("SOC1", "SOC3", "SOC2", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC2", "SOC1", "SOC1", "SOC1", "SOC2", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC2",
"SOC2", "SOC1", "SOC1", "SOC2", "SOC2", "SOC1", "SOC1", "SOC1",
"SOC2", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC3", "SOC3", "SOC3",
"SOC1", "SOC2", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC2",
"SOC2", "SOC1", "SOC3", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC2", "SOC1", "SOC1", "SOC3", "SOC2",
"SOC1", "SOC1", "SOC2", "SOC1", "SOC1", "SOC1", "SOC2", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC3", "SOC1", "SOC2", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC3", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC2", "SOC1", "SOC1", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC2", "SOC1", "SOC1", "SOC1", "SOC2", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC3", "SOC1",
"SOC2", "SOC1", "SOC2"), label = "Body System or Organ Class"),
AETOXGR = structure(c(4L, 2L, 2L, 4L, 2L, 3L, 4L, 3L, 3L,
4L, 4L, 3L, 3L, 4L, 4L, 3L, 4L, 4L, 5L, 1L, 3L, 4L, 3L, 4L,
3L, 3L, 4L, 3L, 3L, 2L, 4L, 4L, 3L, 3L, 4L, 4L, 3L, 2L, 4L,
2L, 4L, 4L, 4L, 4L, 3L, 3L, 2L, 4L, 3L, 4L, 4L, 2L, 3L, 3L,
3L, 3L, 4L, 3L, 4L, 3L, 3L, 4L, 4L, 2L, 4L, 3L, 4L, 3L, 4L,
4L, 5L, 6L, 3L, 4L, 3L, 1L, 3L, 3L, 4L, 2L, 2L, 4L, 3L, 2L,
3L, 4L, 4L, 6L, 3L, 4L, 4L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L,
3L, 3L, 5L, 6L, 3L, 4L, 3L, 3L, 4L, 3L, 3L, 3L, 3L, 2L, 3L,
1L, 4L, 5L, 6L, 4L, 3L, 4L, 3L, 4L, 3L, 4L, 3L, 4L, 4L, 4L,
3L, 3L, 5L, 4L, 4L, 4L, 3L, 3L, 3L, 4L, 3L, 4L, 5L, 5L, 4L,
5L, 6L, 4L, 4L, 4L, 4L, 3L, 3L, 3L, 3L, 4L, 3L, 4L, 4L, 3L,
3L, 3L, 3L, 4L, 3L, 5L, 3L, 4L, 3L), levels = c("<Missing>",
"1", "2", "3", "4", "5"), class = "factor", label = "Standard Toxicity Grade"),
TRT01A = structure(c(2L, 1L, 1L, 2L, 1L, 3L, 3L, 3L, 1L,
1L, 3L, 1L, 2L, 2L, 3L, 3L, 3L, 1L, 2L, 3L, 3L, 1L, 1L, 1L,
1L, 1L, 2L, 2L, 3L, 3L, 1L, 3L, 2L, 2L, 2L, 2L, 2L, 1L, 1L,
1L, 3L, 3L, 3L, 3L, 3L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 2L,
1L, 1L, 1L, 2L, 3L, 3L, 1L, 1L, 1L, 1L, 3L, 3L, 3L, 3L, 1L,
1L, 2L, 2L, 3L, 3L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 1L,
1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 1L, 1L,
1L, 1L, 3L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 3L, 1L, 3L, 1L, 2L,
3L, 3L, 1L, 1L, 1L, 3L, 1L, 1L, 1L, 1L, 1L, 2L, 3L, 1L, 1L,
1L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 3L, 1L, 1L, 2L, 1L,
1L, 1L, 1L, 2L, 3L, 1L, 1L, 2L, 2L, 2L, 3L, 2L, 2L, 3L, 2L,
2L, 1L, 1L, 3L, 1L, 3L, 3L, 3L, 1L), levels = c("Dummy A",
"Dummy B", "Dummy C"), class = "factor")), row.names = c(NA,
-168L), label = "Adverse Event Analysis Dataset", class = c("tbl_df",
"tbl", "data.frame")) |
I used your data with the development version of teal.modules.clinical and rtables (among others) and run your reproducible example (reprex). When I check the "Display grade groupings in nested columns" I see a message: "Data includes records with grade levels outside of 1-5. Please use filter panel to exclude from analysis in order to display grade grouping in nested columns.". On the right panel "Active Filter Variables" I see that AETOXGR variable has If I use When I deselect those missing then I see the following table: I hope this help clarify the problem and updates we made on the package to avoid this kind of confusions. reprexmy_data <- within(teal_data(),
{
ADSL <-
structure(list(STUDYID = structure(c("XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX"), label = "Study Identifier"),
USUBJID = structure(c("1", "2", "3", "4", "5", "6", "7",
"8", "9", "10", "11", "12", "13", "14", "15", "16", "17",
"18", "19", "20", "21", "22", "23", "24", "25", "26", "27",
"28", "29", "30", "31", "32", "33", "34", "35", "36", "37",
"38", "39", "40", "41", "42", "43", "44", "45", "46", "47",
"48", "49", "50", "51", "52", "53", "54", "55", "56", "57",
"58", "59", "60", "61", "62", "63", "64", "65", "66", "67",
"68", "69", "70", "71", "72", "73", "74", "75", "76", "77",
"78", "79", "80", "81", "82", "83", "84", "85", "86", "87",
"88", "89", "90", "91", "92", "93", "94", "95", "96", "97",
"98", "99", "100", "101", "102", "103", "104", "105"), label = "Unique Subject Identifier"),
TRT01A = structure(c(2L, 1L, 2L, 1L, 3L, 1L, 1L, 3L, 1L,
2L, 2L, 3L, 3L, 1L, 2L, 3L, 1L, 1L, 2L, 3L, 1L, 3L, 2L, 1L,
1L, 3L, 3L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, 3L, 1L, 1L, 3L, 1L,
1L, 2L, 3L, 2L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 2L,
2L, 1L, 2L, 2L, 1L, 1L, 1L, 3L, 1L, 1L, 3L, 1L, 3L, 1L, 2L,
3L, 1L, 1L, 3L, 1L, 1L, 2L, 3L, 1L, 2L, 1L, 1L, 2L, 2L, 1L,
3L, 1L, 1L, 2L, 1L, 1L, 2L, 3L, 1L, 1L, 2L, 3L, 2L, 3L, 2L,
1L, 3L, 1L, 3L, 3L, 1L), levels = c("Dummy A", "Dummy B",
"Dummy C"), class = "factor")), row.names = c(NA, -105L), class = c("tbl_df",
"tbl", "data.frame"))
ADAE <-
structure(list(STUDYID = structure(c("XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX",
"XXXXXXXXX"), label = "Study Identifier"), USUBJID = structure(c("1",
"2", "2", "3", "4", "5", "5", "5", "6", "7", "8", "9", "10",
"11", "12", "13", "13", "14", "15", "16", "16", "17", "17", "18",
"18", "18", "19", "19", "20", "20", "21", "22", "23", "23", "23",
"23", "23", "24", "24", "25", "26", "26", "26", "27", "27", "28",
"28", "29", "29", "29", "30", "30", "31", "31", "32", "33", "33",
"34", "35", "35", "36", "36", "36", "37", "38", "38", "38", "38",
"39", "40", "41", "41", "42", "42", "43", "44", "44", "45", "46",
"47", "48", "48", "48", "49", "49", "50", "51", "51", "52", "53",
"54", "55", "56", "57", "58", "58", "59", "60", "60", "60", "61",
"62", "62", "63", "63", "63", "63", "63", "64", "65", "66", "67",
"68", "69", "70", "70", "71", "71", "72", "73", "74", "74", "74",
"74", "75", "76", "77", "78", "78", "78", "78", "78", "78", "79",
"80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "89",
"89", "90", "91", "92", "93", "94", "95", "95", "95", "96", "97",
"97", "98", "99", "99", "100", "100", "101", "102", "103", "104",
"104", "105"), label = "Unique Subject Identifier"), AEDECOD = structure(c("AECodedterm1",
"AECodedterm3", "AECodedterm2", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm2", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm2", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm2",
"AECodedterm2", "AECodedterm1", "AECodedterm1", "AECodedterm2",
"AECodedterm2", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm2", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm3", "AECodedterm3", "AECodedterm3",
"AECodedterm1", "AECodedterm2", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm2",
"AECodedterm2", "AECodedterm1", "AECodedterm3", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm2",
"AECodedterm1", "AECodedterm1", "AECodedterm3", "AECodedterm2",
"AECodedterm1", "AECodedterm1", "AECodedterm2", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm2", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm3",
"AECodedterm1", "AECodedterm2", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm3", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm2",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm2", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm2", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm1", "AECodedterm1",
"AECodedterm1", "AECodedterm1", "AECodedterm3", "AECodedterm1",
"AECodedterm2", "AECodedterm1", "AECodedterm2"), label = "Dictionary-Derived Term"),
AEBODSYS = structure(c("SOC1", "SOC3", "SOC2", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC2", "SOC1", "SOC1", "SOC1", "SOC2", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC2",
"SOC2", "SOC1", "SOC1", "SOC2", "SOC2", "SOC1", "SOC1", "SOC1",
"SOC2", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC3", "SOC3", "SOC3",
"SOC1", "SOC2", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC2",
"SOC2", "SOC1", "SOC3", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC2", "SOC1", "SOC1", "SOC3", "SOC2",
"SOC1", "SOC1", "SOC2", "SOC1", "SOC1", "SOC1", "SOC2", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC3", "SOC1", "SOC2", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC3", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC2", "SOC1", "SOC1", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1",
"SOC1", "SOC1", "SOC2", "SOC1", "SOC1", "SOC1", "SOC2", "SOC1",
"SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC1", "SOC3", "SOC1",
"SOC2", "SOC1", "SOC2"), label = "Body System or Organ Class"),
AETOXGR = structure(c(4L, 2L, 2L, 4L, 2L, 3L, 4L, 3L, 3L,
4L, 4L, 3L, 3L, 4L, 4L, 3L, 4L, 4L, 5L, 1L, 3L, 4L, 3L, 4L,
3L, 3L, 4L, 3L, 3L, 2L, 4L, 4L, 3L, 3L, 4L, 4L, 3L, 2L, 4L,
2L, 4L, 4L, 4L, 4L, 3L, 3L, 2L, 4L, 3L, 4L, 4L, 2L, 3L, 3L,
3L, 3L, 4L, 3L, 4L, 3L, 3L, 4L, 4L, 2L, 4L, 3L, 4L, 3L, 4L,
4L, 5L, 6L, 3L, 4L, 3L, 1L, 3L, 3L, 4L, 2L, 2L, 4L, 3L, 2L,
3L, 4L, 4L, 6L, 3L, 4L, 4L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L,
3L, 3L, 5L, 6L, 3L, 4L, 3L, 3L, 4L, 3L, 3L, 3L, 3L, 2L, 3L,
1L, 4L, 5L, 6L, 4L, 3L, 4L, 3L, 4L, 3L, 4L, 3L, 4L, 4L, 4L,
3L, 3L, 5L, 4L, 4L, 4L, 3L, 3L, 3L, 4L, 3L, 4L, 5L, 5L, 4L,
5L, 6L, 4L, 4L, 4L, 4L, 3L, 3L, 3L, 3L, 4L, 3L, 4L, 4L, 3L,
3L, 3L, 3L, 4L, 3L, 5L, 3L, 4L, 3L), levels = c("<Missing>",
"1", "2", "3", "4", "5"), class = "factor", label = "Standard Toxicity Grade"),
TRT01A = structure(c(2L, 1L, 1L, 2L, 1L, 3L, 3L, 3L, 1L,
1L, 3L, 1L, 2L, 2L, 3L, 3L, 3L, 1L, 2L, 3L, 3L, 1L, 1L, 1L,
1L, 1L, 2L, 2L, 3L, 3L, 1L, 3L, 2L, 2L, 2L, 2L, 2L, 1L, 1L,
1L, 3L, 3L, 3L, 3L, 3L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 2L,
1L, 1L, 1L, 2L, 3L, 3L, 1L, 1L, 1L, 1L, 3L, 3L, 3L, 3L, 1L,
1L, 2L, 2L, 3L, 3L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 1L,
1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 1L, 1L,
1L, 1L, 3L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 3L, 1L, 3L, 1L, 2L,
3L, 3L, 1L, 1L, 1L, 3L, 1L, 1L, 1L, 1L, 1L, 2L, 3L, 1L, 1L,
1L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 3L, 1L, 1L, 2L, 1L,
1L, 1L, 1L, 2L, 3L, 1L, 1L, 2L, 2L, 2L, 3L, 2L, 2L, 3L, 2L,
2L, 1L, 1L, 3L, 1L, 3L, 3L, 3L, 1L), levels = c("Dummy A",
"Dummy B", "Dummy C"), class = "factor")), row.names = c(NA,
-168L), label = "Adverse Event Analysis Dataset", class = c("tbl_df",
"tbl", "data.frame"))
})
join_keys(my_data) <- join_keys(
join_key("ADSL", keys = c("STUDYID", "USUBJID")),
join_key("ADAE", keys = c("STUDYID", "USUBJID")),
join_key(
"ADSL",
"ADAE",
keys = c("STUDYID" = "STUDYID", "USUBJID" = "USUBJID")
)
)
app <- init(
data = my_data,
modules = modules(
tm_t_events_by_grade(
label = "Adverse Events by Grade Table",
dataname = "ADAE",
arm_var = choices_selected(c("TRT01A"), "TRT01A"),
llt = choices_selected(
choices = variable_choices("ADAE", c("AEDECOD")),
selected = c("AEDECOD")
),
hlt = choices_selected(
choices = variable_choices("ADAE", c("AEBODSYS")),
selected = "AEBODSYS"
),
grade = choices_selected(
choices = variable_choices("ADAE", c("AETOXGR")),
selected = "AETOXGR"
)
)
)
)
if (interactive()) {
shinyApp(app$ui, app$server)
}
|
Hi, yes, when you deselect missing's (as i mentioned in my document) it makes no difference for the initial table, still 82.7%, yet the transposed version is 79%. This doesn't make sense. There are no missing's for this particular AEcodedterm2 - can you inform me how it arrives at 79% (ie what is being used as num. and denom.)? I guess what I'm saying is when you filter out missing's in the module - both tables (original and transposed versions) should surely be showing the same thing (ie 43/52=82.7%) for the 'any grade' column. |
@jenko1979 I'm not familiar with the part of the code base responsible of these calculations, I hope other people can help you better. |
If one checks the code produced by teal, the relevant results is calculated by: ....
lyt <- rtables::basic_table(title = "Adverse Event summary by : Body System or Organ Class and Dictionary-Derived Term") %>%
rtables::split_cols_by(var = "TRT01A", split_fun = add_overall_level("All Patients", first = FALSE)) %>%
split_cols_by_groups("MAXAETOXGR", groups_list = list(`Any Grade (%)` = c("1", "2", "3", "4", "5"), `Grade 1-2 (%)` = c("1", "2"), `Grade 3-4 (%)` = c("3", "4"), `Grade 5 (%)` = "5")) %>%
rtables::split_rows_by("AEBODSYS", child_labels = "visible", nested = FALSE, split_fun = trim_levels_in_group("AEDECOD")) %>%
append_varlabels(df = anl, vars = "AEBODSYS") %>%
summarize_num_patients(var = "USUBJID", .stats = "unique", .labels = "Total number of patients with at least one adverse event", ) %>%
analyze_vars("AEDECOD", na.rm = FALSE, denom = "N_col", .stats = "count_fraction", .formats = c(count_fraction = format_fraction_threshold(0.01))) %>%
append_varlabels(df = anl, vars = "AEDECOD", indent = 1L)
result <- rtables::build_table(lyt = lyt, df = anl, col_counts = col_counts)
result So it seems the issue is with rtables, as no teal.modules.clinical code is needed to reproduce the issue (but it might need to be updated to calculate the right value). Could you @jenko1979 explore more about this issue, with this information? In any case I hope @insightsengineering/nest-sme can help on how to update this module to fix this issue. |
Thanks @llrs-roche for flagging this issue. It seems to me that the two calculations may differ in what is filtered out at different splits. @jenko1979 could you copy the above code with the different data inputs and make a reproducible code snippet so we can close in the issue? I find also helpful to filter and grouping the data as if it is under different split, and then use |
Hi, I must admit I haven't got experience with using col_counts = in the rtables framework as this is a depreciated feature I think. I can see that the numerator seems to still be 43 if i use this code below over my dummy data without giving a col_count argument, hence I really do think that its something to do with column counts being used and the denominator that is being used is incorrect in the transposed version, with the missing values playing a bit of a part in that. I am not sure how MAXAETOXGR is being calculated either and whether this is causing any issues when you have missing's - this must be something that the Teal module is adding as this is not part of the variables in the ADAE contained in the reprex from the Teal module documentation. I don't know how much more i can help, I guess i have already provided a complete reprex to show that the module is not giving the correct percentages in the transposed version of this table. I will chat to @kpagacz about this - he may be able to help us identify where the issue is as we are working on something similar for a custom module for this internally. |
@jenko1979 let's talk about this and see if and how I can help. Also, I am unsure if we are using the same things this module uses, so we might not be affected. All in all, let's talk about:
We can schedule a call for this :) |
Hi @kpagacz @jenko1979 @llrs-roche sorry for joining late to the party, but I was one of the developers to add the "transpose" feature in this module, so I just did a little experiment. It seemed the issue was from the numerator really. See my code below to reproduce the error.
|
Hi @jenko1979 I think I figured the reason. Your
|
Hi @yli110-stat697 , I think the grade 6 thing is a bit of a red herring. I don't actually have any grade 6's in the real data i am using, but something funny happened when i created the dummy data for the reprex. Its odd as when i look at the real data there are no grade 6's either, but when i take a dput of my real data it shows 1-6, but these are just factor levels, not the actual grade values. so i think what is happening here is that indeed it is causing an issue because of the factor levels currently in the data are not the same as the grades, and the module must be using the factor levels so the levels are: Missing = 1 So what is happening therefore is that the transposed version is not using 6 even though that is actually a grade 5 value. 1 = 1 I will try this and see if this fixes my issues. A little bit off topic, but relevant to this transposed module, is there a way to get the n (%) rather than just the % in the transposed version? I think this would be useful as well |
Hi, so the issue can be resolved now by me changing the factor levels in AETOXGR. I think because when we are doing the transposed version and rtables is now using a split_cols_by I think its the levels that are being used now, so its imperative that these match the grades you expect - i don't think its necessarily the same issue when these are coming out as data rows. Anyway, still a worthwhile discussion as if anyone else reports something similar it will most likely be that their levels in AETOXGR are incorrect (or not matching the grade they expect to see) |
Nicely done figuring this one out, Paul! |
The module could check if the factors are within what we expect so that users like you have an easier time to uncover this. For instance in this case the conversion to detect the max value is with:
Instead of the recommended
|
Hi @llrs-roche I don't know the current development guidance on teal.modules.clinical since I have stopped the work for almost two years now, but we used to avoid warnings or error during execution phase. It worth a check upfront to see if |
Hi @jenko1979 so we hardcoded the format here. It was due to some internal requests of a certain format, but I agree, user should have the ability to change into the formats they preferred. This could be a feature enhancement for the |
What happened?
Using the dummy rds dataframes ADSL and ADAE I have supplied in this post, we can see the bug occurring with the transposed version of the table.
Result in App after filtering out missing gives a count of 43 subjects in SOC1/AECodedterm1which yields a percentage of 82.7% in the original view. There are not actually any missing with AECodedterm1 so we know that filtering out missing or not will always yield 43 subjects and 82.7% in this section.
However, when this table is transposed using the “display grade groupings in nested columns” checkbox, the percentages no longer match this. The percentage has gone down to 79%.
Teal Bug_tm_t_events_by_grade_images.docx
I think this is to do with the percentages now being calculated out of a different denominator.
This change in percentage can only happen if the numerator has gone down in performing this transpose (which should not happen here as mentioned this AECodedterm1 has no missing toxicity grades so this numerator should always be 43 when only missings are being filtered out in the app), or the denominator has gone up, which again, should not happen as 52 is our max. number of subjects we have in this trt arm. So percentage should still remain as 82.7% in this table.
I also propose that in this transposed version we need to move the N=xx here to directly below the treatment arm. It makes no sense at all below the grades as this doesn’t reflect the number of subjects in each of these columns, just the number of subjects in each treatment arm. This is now possible in rtables actually as there are now arguments to add these N=xx for each spanning column header. (within the split_cols_by function split_cols_by("TRT01A", show_colcounts = TRUE and split_cols_by("AETOXGR", show_colcounts = FALSE) %>%). Then we would only get one occurrence of this N=xx under each trt arm. It’s also possible to add the N for number of subjects that are in each grade spanning header (split_cols_by("AETOXGR", show_colcounts = TRUE), and maybe this will also help debug what denominator Is being used in this transposed version of the table to construct these percentages.
Code to reproduce this, using rds data supplied (please reach out to me on [email protected] and i can supply the dummy .rds data as this is not supported to attach here):
sessionInfo()
No response
Relevant log output
No response
Code of Conduct
Contribution Guidelines
Security Policy
The text was updated successfully, but these errors were encountered: