Skip to content

Commit

Permalink
Merge pull request #295 from Gilead-BioStats/fix-AE_qual
Browse files Browse the repository at this point in the history
update AE qualification tests for sorting updates to Flag and Summarise
  • Loading branch information
dsanders2gilead authored Mar 15, 2022
2 parents 6db8dfe + 3014d47 commit 844f3f2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
8 changes: 6 additions & 2 deletions tests/testthat/test_qual_T1_1.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,19 @@ test_that("AE assessment can return a correctly assessed data frame for the pois
is.na(Residuals) ~ NA_real_,
is.nan(Residuals) ~ NA_real_,
TRUE ~ 0),
)
) %>%
arrange(match(Flag, c(1, -1, 0)))

t1_summary <- t1_flagged %>%
mutate(
Assessment = "Safety",
Label = "",
Score = Residuals
) %>%
select(Assessment, Label, SiteID, N, Score, Flag)
select(Assessment, Label, SiteID, N, Score, Flag) %>%
arrange(desc(abs(.data$Score))) %>%
arrange(match(Flag, c(1, -1, 0)))


t1_1 <- list("strFunctionName" = "AE_Assess()",
"lParams" = list("dfInput" = "dfInput",
Expand Down
7 changes: 5 additions & 2 deletions tests/testthat/test_qual_T1_2.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,18 @@ test_that("AE assessment can return a correctly assessed data frame for the pois
is.na(Residuals) ~ NA_real_,
is.nan(Residuals) ~ NA_real_,
TRUE ~ 0),
)
) %>%
arrange(match(Flag, c(1, -1, 0)))

t1_2_summary <- t1_2_flagged %>%
mutate(
Assessment = "Safety",
Label = "",
Score = Residuals
) %>%
select(Assessment, Label, SiteID, N, Score, Flag)
select(Assessment, Label, SiteID, N, Score, Flag) %>%
arrange(desc(abs(Score))) %>%
arrange(match(Flag, c(1, -1, 0)))

t1_2 <- list("strFunctionName" = "AE_Assess()",
"lParams" = list("dfInput" = "dfInput",
Expand Down
8 changes: 6 additions & 2 deletions tests/testthat/test_qual_T1_3.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,19 @@ test_that("AE assessment can return a correctly assessed data frame for the wilc
Flag != 0 & Estimate >= median ~ 1,
TRUE ~ Flag)
) %>%
select(-median)
select(-median) %>%
arrange(match(Flag, c(1, -1, 0)))

t1_3_summary <- t1_3_flagged %>%
mutate(
Assessment = "Safety",
Label = "",
Score = PValue
) %>%
select(Assessment, Label, SiteID, N, Score, Flag)
select(Assessment, Label, SiteID, N, Score, Flag) %>%
arrange(desc(abs(.data$Score))) %>%
arrange(match(Flag, c(1, -1, 0)))


t1_3 <- list("strFunctionName" = "AE_Assess()",
"lParams" = list("dfInput" = "dfInput",
Expand Down
7 changes: 5 additions & 2 deletions tests/testthat/test_qual_T1_4.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,18 @@ test_that("AE assessment can return a correctly assessed data frame for the wilc
Flag != 0 & Estimate >= median ~ 1,
TRUE ~ Flag)
) %>%
select(-median)
select(-median) %>%
arrange(match(Flag, c(1, -1, 0)))

t1_4_summary <- t1_4_flagged %>%
mutate(
Assessment = "Safety",
Label = "",
Score = PValue
) %>%
select(Assessment, Label, SiteID, N, Score, Flag)
select(Assessment, Label, SiteID, N, Score, Flag) %>%
arrange(desc(abs(.data$Score))) %>%
arrange(match(Flag, c(1, -1, 0)))

t1_4 <- list("strFunctionName" = "AE_Assess()",
"lParams" = list("dfInput" = "dfInput",
Expand Down

0 comments on commit 844f3f2

Please sign in to comment.