R/bias.R

Defines functions bias

Documented in bias

#' Title
#'
#' @param boot A vector of bootstrap estimates of theta
#' @param theta the sample estimate of theta
#'
#' @return z0 the bias parameter for BCa CI
#' @export
#'
#' @examples 
#' X<-data.frame(rnorm(1000))
#' theta<-mean(X)
#' boot<-NaiveBoot(X)
#' boot<-lapply(boot, mean)
#' boot<-do.call(rbind, boot)
#' bias(boot, theta)
bias<-function(boot,theta){
  z0<-length(boot[boot<theta])/length(boot)
  z0<-qnorm(z0)
  return(z0)
}

Try the Omisc package in your browser

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

Omisc documentation built on Aug. 9, 2022, 5:09 p.m.