boot.overlap {overlapping} | R Documentation |
Nonparametric Bootstrap to estimate the overlapping area
Description
Resampling via non-parametric bootstrap to estimate the overlapping area between two or more kernel density estimations from empirical data.
Usage
boot.overlap( x, B = 1000, pairsOverlap = FALSE, ... )
Arguments
x |
a list of numerical vectors to be compared (each vector is an element of the list). |
B |
integer, number of bootstrap draws. |
pairsOverlap |
logical, if |
... |
options, see function |
Details
If the list x
contains more than two elements (i.e., more than two distributions) it computes the bootstrap overlapping measure between all the q
paired distributions. For example, if x
contains three elements then q = 3
; if x
contains four elements then q = 6
.
Value
It returns a list containing the following components:
OVboot_stats |
a data frame |
OVboot_dist |
a matrix with |
Note
Call function overlap
.
Thanks to Jeremy Vollen for suggestions.
Author(s)
Massimiliano Pastore
References
Pastore, M. (2018). Overlapping: a R package for Estimating Overlapping in Empirical Distributions. The Journal of Open Source Software, 3 (32), 1023. doi: 10.21105/joss.01023
Pastore, M., Calcagnì, A. (2019). Measuring Distribution Similarities Between Samples: A Distribution-Free Overlapping Index. Frontiers in Psychology, 10:1089. doi: 10.3389/fpsyg.2019.01089
Examples
set.seed(20150605)
x <- list(X1=rnorm(100), X2=rt(50,8), X3=rchisq(80,2))
## bootstrapping
out <- boot.overlap( x, B = 10 )
out$OVboot_stats
# bootstrap quantile intervals
apply( out$OVboot_dist, 2, quantile, probs = c(.05, .9) )
# plot of bootstrap distributions
Y <- stack( data.frame( out$OVboot_dist ))
ggplot( Y, aes( values )) + facet_wrap( ~ind ) + geom_density()