R/atkinson.R

atkinson <-
function (x, epsilon = 1) {
    x <- as.numeric(x)
    if (is.null(epsilon)) epsilon <- 1
    if (epsilon == 1){
        A <- 1 - (exp(mean(log(x)))/mean(x))
    }else{
        x <- (x/mean(x))^(1 - epsilon)
        A <- 1 - mean(x)^(1/(1 - epsilon))
    }
    return(A)
}

Try the acid package in your browser

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

acid documentation built on May 1, 2019, 10:14 p.m.