R/quantile.manual.thresh.scalewise.R

quantile.manual.thresh.scalewise<-function(x, which.levels=c(1,2,3),
                                            hard = TRUE,quantile=.9, ...)
{
wc.shrink <- x
if (hard) {
for (i in names(x)[which.levels]) {
wci <- x[[i]]
unithresh <- quantile(abs(wci),quantile)
wc.shrink[[i]] <- wci * (abs(wci) > unithresh)
}
}
else {
for (i in names(x)[which.levels]) {
wci <- x[[i]]
unithresh <- quantile(abs(wci),quantile)
wc.shrink[[i]] <- sign(wci) * (abs(wci) - unithresh) *
(abs(wci) > unithresh)
}
}
wc.shrink
}

Try the iWISA package in your browser

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

iWISA documentation built on May 1, 2019, 7:37 p.m.