Skip to content

Commit

Permalink
... minor fix for studentized bootstrap ...
Browse files Browse the repository at this point in the history
  • Loading branch information
Brice Maxime Hugues Ozenne committed Sep 26, 2023
1 parent 40dca15 commit 00c37ef
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions R/discreteRoot.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
## Author: Brice Ozenne
## Created: nov 22 2017 (13:39)
## Version:
## Last-Updated: sep 19 2023 (16:54)
## Last-Updated: sep 26 2023 (09:42)
## By: Brice Ozenne
## Update #: 312
## Update #: 314
##----------------------------------------------------------------------
##
### Commentary:
Expand Down Expand Up @@ -191,8 +191,11 @@ boot2pvalue <- function(x, null, estimate = NULL, alternative = "two.sided",
}
x.boot <- na.omit(x)
n.boot <- length(x.boot)
statistic.boot <- mean(x.boot) - null

if(any(is.infinite(x.boot))){
statistic.boot <- median(x.boot, na.rm = TRUE) - null
}else{
statistic.boot <- mean(x.boot, na.rm = TRUE) - null
}
if(is.null(estimate)){
statistic <- statistic.boot
}else{
Expand Down

0 comments on commit 00c37ef

Please sign in to comment.