Skip to content
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

Potentially incorrect equation mark comparing site mean to study mean #59

Closed
richb123 opened this issue May 6, 2024 · 1 comment
Closed

Comments

@richb123
Copy link

richb123 commented May 6, 2024

     prob_high = ifelse(
        .data$mean_ae_site_med75 == .data$mean_ae_study_med75,
        1,
        .data$prob_high
      )

.data$mean_ae_site_med75 == .data$mean_ae_study_med75,

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)
}
}

@erblast
Copy link
Collaborator

erblast commented May 22, 2024

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.

@erblast erblast mentioned this issue Sep 25, 2024
Merged
@erblast erblast closed this as completed Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants