R/k_hetang.R

Defines functions k_hetang

Documented in k_hetang

k_hetang <-
function(x) {
  nz <- sum(x==0)
  if(nz!=0) {
    cat(nz,"zeroes excluded\n")
    x <- x[x!=0]
  }
  N  <- sum(x)
  S  <- length(x)
  ma <- max(x)
  mi <- min(x)
  y  <- 1-(mi/ma)^(1/(S-1))
  return(y)
}

Try the MLpreemption package in your browser

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

MLpreemption documentation built on Feb. 11, 2021, 5:07 p.m.