R/lmean.R

Defines functions lmean

Documented in lmean

lmean <-
function(z,p) {

        ind<-p*length(z)
        i0<-floor(ind)

        if( i0 < 1 ) {
                Lp<-min(z)
        } else {
                z<-sort(z,partial=1:(i0+1))
                i1<-ind-i0
                Lp<-(sum(z[1:i0])+i1*z[i0+1])/ind
        }

        Lp

}

Try the npsm package in your browser

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

npsm documentation built on Nov. 15, 2023, 1:08 a.m.