Potentially incorrect equation mark comparing site mean to study mean
prob_high = ifelse(
.data$mean_ae_site_med75 == .data$mean_ae_study_med75,
1,
.data$prob_high
)
https://github.com/openpharma/simaerep/blob/dd5e9e7d39d20c4069775526ea2303d5c3120175/R/simaerep.R#L417
In this line we are setting the probability to 1 for site means which are equal (==) to study mean. If we look on similar block of code for under reporting (starting on line 689, see snippet below), I believe the intent is to "filter out" sites which are either above or below the study mean.
if (under_only) { # we are not interested in cases where site AE is greater study AE if (mean_ae_site > mean_ae_study) { prob_lower <- 1 return(prob_lower) } }
Hello,
this line is meant to make sure that over-reporting probability ends up being zero in cases when study and site mean are equal. This fixes cases in which sites with 0 AEs were flagged as over-reporting.
The behaviour is tested for in unit test "simaerep() - under_only = FALSE - over-reporting must be zero when mean_ae_site_med75 == mean_ae_study_med75" in file test_over_reporting.R
The condition could also be expressed like that, mean_ae_site_med75 == 0 & mean_ae_study_med75 == 0
We might change this in the future to make the purpose of this line more clear.