Skip to content

Commit

Permalink
improved .calculate_p_permu
Browse files Browse the repository at this point in the history
  • Loading branch information
qddyy committed Sep 14, 2023
1 parent 10f3d9a commit c3dfd6f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/PermuTest.R
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,11 @@ PermuTest <- R6Class(
},

.calculate_p_permu = function() {
l <- quote(mean(private$.statistic_permu <= private$.statistic))
r <- quote(mean(private$.statistic_permu >= private$.statistic))
lr <- quote(2 * min(eval(l), eval(r)))
l <- ecdf(private$.statistic_permu)(private$.statistic)
r <- 1 - l + 1 / length(private$.statistic_permu)
lr <- 2 * min(l, r, 0.5)

private$.p_value <- eval(get(private$.side))
private$.p_value <- get(private$.side)
},

.calculate = function() {
Expand Down

0 comments on commit c3dfd6f

Please sign in to comment.