Skip to content

Commit

Permalink
WINratio rules changed to be inclusive of threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
abusjahn committed Jan 17, 2024
1 parent f6fb646 commit ebeb975
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/tests.R
Original file line number Diff line number Diff line change
Expand Up @@ -1223,18 +1223,18 @@ WINratio <- function(data,groupvar,testvars,rules, idvar=NULL,
case_when(
WIN!=0 ~ NA_integer_,
abs(!!sym(paste0("X",rule_i))-
!!sym(paste0("Y",rule_i)))>abs(rules[rule_i]) &
!!sym(paste0("Y",rule_i)))>=abs(rules[rule_i]) &
(sign(!!sym(paste0("X",rule_i))-
!!sym(paste0("Y",rule_i)))==sign(rules[rule_i])) |
(!!sym(paste0("X",rule_i))-
!!sym(paste0("Y",rule_i)))>rules[rule_i] &
!!sym(paste0("Y",rule_i)))>=rules[rule_i] &
sign(rules[rule_i])==0 ~ 1,
abs(!!sym(paste0("X",rule_i))-
!!sym(paste0("Y",rule_i)))>abs(rules[rule_i]) &
!!sym(paste0("Y",rule_i)))>=abs(rules[rule_i]) &
(sign(!!sym(paste0("X",rule_i))-
!!sym(paste0("Y",rule_i)))!=sign(rules[rule_i])) |
(!!sym(paste0("X",rule_i))-
!!sym(paste0("Y",rule_i)))<rules[rule_i] &
!!sym(paste0("Y",rule_i)))<=rules[rule_i] &
sign(rules[rule_i])==0 ~ -1,
.default=0),
WIN=sum(c_across(starts_with("rule")),na.rm=TRUE)
Expand Down

0 comments on commit ebeb975

Please sign in to comment.