boot.overlap | R Documentation |
Resampling via non-parametric bootstrap to estimate the overlapping area between two or more kernel density estimations from empirical data.
boot.overlap( x, B = 1000, pairsOverlap = FALSE, ... )
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 |
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.
It returns a list containing the following components:
OVboot_stats |
a data frame q \times 3 where each row contains the following statistics:
|
OVboot_dist |
a matrix with |
Call function overlap
.
Thanks to Jeremy Vollen for suggestions.
Massimiliano Pastore
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
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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.