R/xweights.R

Defines functions xweights

Documented in xweights

xweights <-
function(X, weight, clevel1){
  tmc = qchisq(clevel1, ncol(X))
  dist=mahalanobis(X,
                   cov.rob(X, method=weight)$center,
                   cov.rob(X, method=weight)$cov)  # robust distance
  xweight=ifelse(dist<tmc, 1, tmc/dist)  #robust weights
  return(xweight)
}

Try the epmrob package in your browser

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

epmrob documentation built on July 9, 2023, 6:19 p.m.