Description Usage Arguments Details Value Author(s) See Also Examples
Bins numeric variables according to their quantiles and computes the Bertin Classification Index BCI.
The data.frame
method computes the multivariate qBCI and not the pairwise values (c.f. cmat).
1 2 3 4 5 |
x |
A numeric vector (in this case |
y |
A numeric vector. |
p |
A percentage to use for the quantiles sequence. See details. |
k |
A minimum expected number of observations in each cell after the binning. |
sort |
Whether or not to compute the BCI for the optimized tables or not. If not, kendalls is usually a better alternative. |
iter |
An optile parameter. |
... |
dots |
The breakpoints for the binning are the data quantiles according to equidistant probabilities seq(0,1,p)
where p
is minimal under the condition that each cell has an expected number of observations of at least k
.
A value between 0 and 1.
Alexander Pilhoefer
BCI,kendalls, wdcor, cmat
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | ## Not run:
qBCI(rnorm(100),runif(100))
# non-functional relationship:
x1 <- runif(500,0,10)
x2 <- runif(500,0,10)
y1 <- x1+rnorm(500,sd=1)
y2 <- 10-x2+rnorm(500,sd=1)
x <- c(x1,x2)
y <- c(y1,y2)
plot(x,y, pch = 19)
wdcor(x,y)
1 - qBCI(x,y)
y1 <- x1+rnorm(500,sd=0.1)
y2 <- 10-x2+rnorm(500,sd=0.1)
x <- c(x1,x2)
y <- c(y1,y2)
plot(x,y, pch = 19)
wdcor(x,y)
1 - qBCI(x,y)
# or a quadratic curve:
test <- sapply(seq(0,4,0.2),function(s){
x <- runif(200,-1,1)
y <- 5+12*x^2+rnorm(200,sd=s)
return(c(cor(x,y),
wdcor(x,y),
1 - qBCI(x,y)))
})
plot(test[3,],type="l", ylim=c(-0.2,1))
lines(test[1,], col = 2, lwd = 2)
lines(test[2,], col = 3, lwd = 2)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.