Description Usage Arguments Details Value Note Author(s) References Examples
It gives the overlapped estimated area of two or more kernel density estimations from empirical data.
1 2 |
x |
list of numerical vectors to be compared; each vector is an element of the list |
nbins |
number of equally spaced points at which the overlapping density is evaluated; see |
plot |
logical, if |
partial.plot |
logical, if |
boundaries |
an optional list for bounded distributions, see Details |
... |
optional arguments to be passed to function |
If the list x
contains more than two elements (i.e. more than two distributions) it computes overlapping between all paired distributions. Partial plots refer to these paired distributions.
If plot=TRUE
, all overlapped areas are plotted. It requires ggplot2
.
The optional list boundaries
must contain two elements: from
and to
, indicating the empirical limits of input variables. Each element must be of length equal to the input data list x
or, at least, length one when all boundaries are equal for all distributions. See examples below.
It returns a list containing the following components:
DD |
Data frame with information used for computing overlapping, containing the following variables:
|
OV |
Estimates of overlapped areas relative to each pair of distributions. |
xpoints |
List of abscissas of intersection points among the density curves. |
Call function final.plot
.
Massimiliano Pastore
Pastore, M. (2018). Overlapping: a R package for Estimating Overlapping in Empirical Distributions. The Journal of Open Source Software, 3 (32), 1023. URL: https://doi.org/10.21105/joss.01023
Pastore, M., Calcagnì, A. (2019). Measuring Distribution Similarities Between Samples: A Distribution-Free Overlapping Index. Frontiers in Psychology, 10:1089. URL: https://doi.org/10.3389/fpsyg.2019.01089
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | set.seed(20150605)
x <- list(X1=rnorm(100), X2=rt(50,8), X3=rchisq(80,2))
out <- overlap(x, plot=TRUE)
out$OV
# including boundaries
x <- list(X1=runif(100), X2=runif(100,.5,1))
boundaries <- list( from = c(0,.5), to = c(1,1) )
out <- overlap(x, plot=TRUE, boundaries=boundaries)
out$OV
# equal boundaries
x <- list(X1=runif(100), X2=runif(50), X3=runif(30))
boundaries <- list( from = 0, to = 1 )
out <- overlap(x, plot=TRUE, boundaries=boundaries)
out$OV
# changing kernel
out <- overlap(x, plot=TRUE, kernel="rectangular")
out$OV
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.