United4Surveillance / signal-detection-tool

A tool for detection of signals in infectious disease surveillance data.
Other
8 stars 0 forks source link

[BUG] Recreate factors after signal generation for the plots #199

Closed tinneuro closed 8 months ago

tinneuro commented 8 months ago

Describe the Bug

After the signals are generated we do not have the factor structure anymore as it is lost in the process of signal generation. The results from the signals furthermore is a dataframe with category and stratum column where there can be multiple values of variables, i.e. sex and age_group together.

To Reproduce

Run get_signals_stratified() with the preprocessed input_example dataset with stratum age_group and have a look at the stratum column. This is no longer a factor. Thus the sorting in the barplot is also lost.

Expected Behavior

Sorting in the barplots and tables in the signals tab should be correct, thus factors need to be created at this level.

Screenshots / Code Snippets (if applicable)

If applicable, add screenshots, code snippets, or logs to help explain your problem.

Environment (please complete the following information):

Additional Context

Add any other context about the problem here.

tinneuro commented 8 months ago

what needs to be done in addition