1 |
x |
|
beta |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (x, beta = 0.2)
{
temp <- sort(abs(x - median(x)))
omhatx <- temp[floor((1 - beta) * length(x))]
psi <- (x - median(x))/omhatx
i1 <- length(psi[psi < (-1)])
i2 <- length(psi[psi > 1])
sx <- ifelse(psi < (-1), 0, x)
sx <- ifelse(psi > 1, 0, sx)
pbos <- (sum(sx) + omhatx * (i2 - i1))/(length(x) - i1 -
i2)
pbos
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.