Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: DetectoR
Title: Stay Safe; Don't Miss Any Adverse-Event Signal
Version: 3.0.1.9006
Version: 3.0.1.9007
Authors@R: c(
person("Carlos", "Fernandez-Escobar", , "carlos.fernandez4.ext@bayer.com", role = c("aut", "cre")),
person("Steffen", "Jeske", role = "aut"),
Expand Down
3 changes: 2 additions & 1 deletion R/mod_calculate.R
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ mod_calculate_server <- function(id, r, calculate_mode) {
} else if (input$stratified_by == "None") {
choices <- list(
"Two sided" = "two.sided",
"One sided" = "less"
"One sided (favours comparator)" = "greater",
"One sided (favours verum)" = "less"
)
}
shiny::updateSelectInput(
Expand Down
6 changes: 3 additions & 3 deletions R/mod_calculate_fct_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ calculate_results <- function(
adjustment = c("FDR", "DFDR"),
order_by = c("p-value", "effect"),
study_strat = "None",
alternative = c("two.sided", "less"),
alternative = c("two.sided", "less", "greater"),
alpha = 0.05,
filter = c("no_method", "one_percent", "min"),
frequency_measure = c("proportions", "incidence rates"),
Expand Down Expand Up @@ -232,7 +232,7 @@ filter_empty_variable <- function(data, variable) {
#' @param method A character, the method of filtering: "no_method",
#' "one_percent" or "min". "min" calls find_min_event()
#' @param alternative A character describing the alternative hypothesis for
#' "min" method: "two.sided" or "less" (one-sided)
#' "min" method: "two.sided", "less" or "greater" (one-sided)
#' @param alpha Numeric, alpha level of the test for "min" method.
#'
#' @returns A dataframe of filtered adverse events.
Expand All @@ -241,7 +241,7 @@ filter_minimum_aes <- function(
variable,
big_n,
method = c("no_method", "one_percent", "min"),
alternative = c("two.sided", "less"),
alternative = c("two.sided", "less", "greater"),
alpha
) {
filter <- match.arg(method)
Expand Down
9 changes: 6 additions & 3 deletions R/mod_calculate_fct_effect.R
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,11 @@ get_rr <- function(
#'
#' @returns A numeric vector with p-values
get_fisher_p_value <- function(a, b, c, d, alternative) {
stats::fisher.test(
matrix(c(a, b, c, d), nrow = 2),
#TODO: remove
matrix <- matrix(c(a, b, c, d), nrow = 2)
out <- stats::fisher.test(
matrix,
alternative = alternative
)$p.value
)
out$p.value
}
3 changes: 2 additions & 1 deletion R/utils_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
find_min_event <- function(
n1,
n2,
alternative = c("two.sided", "less"),
alternative = c("two.sided", "less", "greater"),
alpha = 0.05
) {
alternative <- match.arg(alternative)
alternative <- if (alternative == "greater") "less" else alternative
# Create a numeric vectors of events, to try which yields significant results
if (n1 < 1000) {
x1 <- seq(1, round(0.1 * n1, 0), 1)
Expand Down
2 changes: 1 addition & 1 deletion man/calculate_results.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/filter_minimum_aes.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion man/find_min_event.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading