Skip to content

Commit

Permalink
add an error message
Browse files Browse the repository at this point in the history
for critical_r > 1
  • Loading branch information
qinyun-lin committed May 30, 2024
1 parent bf6a2bc commit 64c148e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/test_sensitivity.R
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ test_sensitivity <- function(est_eff,

if (!is.na(eff_thr)) {
critical_r <- eff_thr
}

if (abs(critical_r) > 1 & index == "IT") {
stop("Effect threshold for ITCV is interpreted as a correlation. You entered a value that is greater than 1 in absolute value. Please convert your threshold to a correlation by multiplying by sdx/sdy. This will be addressed in future versions.")
}

## later: use sdx and sdy to calculate critical_r based on eff_thr
Expand Down

0 comments on commit 64c148e

Please sign in to comment.