Skip to content
Prev 166436 / 398502 Next

How to compute Bootstrap p-values

Hello.

How can I compute the Bootstrap p-value for a two-sided test problem like H_0: beta=0 vs. H_1: beta!=0 ?

Example for the sample mean:

x <- rnorm(100)

bootsample <- numeric(1000)

for(i in 1:1000) {

  idx <- sample(1:100,100,replace=TRUE)

  bootsample[i] <- mean(x[idx])

}


How can I compute the Bootstrap p-value for the mean of x?

H_0: "mean of x" = 0 vs. H_1: "mean of x" != 0



Thank you in advance.


Sincerely,
Andreas Klein.