R/getpval.R

getpval <- function (statvec, verbose = TRUE){

statlen <- length(statvec)

if (verbose){
        cat("Observed bootstrap is ", round(statvec[1],3), "\n")
}

p <- (1+sum(statvec[1] <= statvec[2:statlen]))/statlen

if (verbose) {
        cat("p-value is ", p, "\n")
}

return(p)
}

Try the LS2Wstat package in your browser

Any scripts or data that you put into this service are public.

LS2Wstat documentation built on Sept. 17, 2023, 9:06 a.m.