You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several of teal.modules.clincal do not give meaningful results or show undesired behaviour if the filtered (adsl) dataset they run on contains factor levels that are not present the data.
Examples (with code for tm_t_coxreg):
tm_t_coxreg (probably) attempts to estimate coefficients for all factor levels, present or not, resulting in coxph crashing.. Adjustment for variables where some levels have been removed by filtering can currently only be made using stratification (impacting functionality of the module).
In this example, BMRKR2 is chosen as covariate, but after filtering not all factor levels are present, leading to the described error.
tm_t_coxreg (and I think also tm_t_logistic) by default try to make treatment comparisons based on all defined factor levels in the treatment variable (I think taking the "first" factor level as reference, the others as comparators). This leads to an error ("Current ADSL data does not have observations from the reference and comparison treatments.") in both modules if any of those levels are not present in the filtered dataset. The app user must manually inspect his/her own filters and re-assign comparator/reference/unused factor levels before any regression result is displayed. Dropping non-existing factor levels should solve both these errors and increase usability considerably.
Of course one could explicitly specify treatment variable levels to be compared at startup (commented out here) - but as soon as the user changes the filter, the error would re-appear..
I posted those two errors together thinking that both of them could be solved by dropping all non-existent factor levels at some point during start of the module..
mthbretscher
changed the title
[Bug]: tm_t_coxreg and other modules crash when using a factor variable as covariate where some levels were removed by filter
[Bug]: tm_t_coxreg crashes when using a factor variable as covariate where some levels were removed by filter
Sep 21, 2023
What happened?
Several of teal.modules.clincal do not give meaningful results or show undesired behaviour if the filtered (adsl) dataset they run on contains factor levels that are not present the data.
Examples (with code for tm_t_coxreg):
In this example, BMRKR2 is chosen as covariate, but after filtering not all factor levels are present, leading to the described error.
Of course one could explicitly specify treatment variable levels to be compared at startup (commented out here) - but as soon as the user changes the filter, the error would re-appear..
I posted those two errors together thinking that both of them could be solved by dropping all non-existent factor levels at some point during start of the module..
sessionInfo()
Relevant log output
No response
Code of Conduct
Contribution Guidelines
Security Policy
The text was updated successfully, but these errors were encountered: