-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Expectation of factors in DMT01 #675
Comments
I totally agree that this should be fixed. @shajoezhu is it possible to fix this in rtables? |
depending on the requirement, it has different solutions.
current solution: there is already a format related thing to convert character to factor. If new variablee need to be added, of course user can update the formats file. If new levels comes in, if proper format is used, the 0 will be still displayed |
@BFalquet @barnett11 please have a look at the proposal @BFalquet please help evaluate the impact of only allowing factor in chevron |
I agree with the diagnosis, we can easily convert to character with the risk of loosing (or at least not gaining) information about the missing levels. We can probably mitigate the risk by creating reformatting rules that introduces level that we know should be present (maybe possible for the different flag and other very controlled variables). For more exotic variables, unfortunately, there is not much we can do. |
@BFalquet it is converting all character to factor, so won't lose any levels |
We had this originally is that correct, with a function to convert the dataset being read in to all factors (was it df_explicit_na?). Would this be the advised way again then, and why did we remove this before (I can't remember sorry) |
However now, we may consider at least convert those "analyze_vars" to use "factor" only, and users should take care of the "character-factor" conversion (for odering , keep missing levels, etc) |
Hi,
This issue covers beyond DMT01, but primarily impacts this extremely common table.
We can pass many variables into DMT01 to summarize (normally Demographic and Baseline Characteristics). If a category of a variable is present in one treatment group, but not another, then DMT01 fails and requires the variable to be passed as factor. This is a little erratic, especially as it will happen entirely dependent on data and its spread across treatment groups - and will eg. cause an error as data changes, or when applying filtering.
I understand this is not a
chevron
issue, but broader - but is there a better way we can process these types of templates so that the user is not forced to keep updating columns to factors just to display 0 under a treatment group?The text was updated successfully, but these errors were encountered: