R/r.hc.sub.R

Defines functions r.hc.sub

Documented in r.hc.sub

r.hc.sub <-
function(x.sub, x, weight.sub, weight, k){
  n <- length(x)
  if(is.null(weight)){
    weight <- rep(1, n)
    weight.sub <- rep(1, length(x.sub))
  }
  rhow <- k*weighted.median(x, weight)
  r.3 <- sum(weight.sub[x.sub > rhow])/sum(weight.sub)
return(list(count.rich = length(x.sub[x.sub > rhow]), r.hc = r.3))

}

Try the affluenceIndex package in your browser

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

affluenceIndex documentation built on Jan. 5, 2022, 5:07 p.m.