1 | deciles(x)
|
x |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ##---- 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)
{
xs <- sort(x)
n <- length(x)
vecx <- seq(along = x)
xq <- 0
for (i in 1:9) {
q <- i/10
m1 <- (n + 1) * q
m2 <- (n + 1) * (1 - q)
wx <- pbeta(vecx/n, m1, m2) - pbeta((vecx - 1)/n, m1,
m2)
xq[i] <- sum(wx * xs)
}
xq
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.