boot.overlap: Nonparametric Bootstrap to estimate the overlapping area

boot.overlapR 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 TRUE, available only when the list x contains more than two elements, it returns the overlapped area relative to each pair of distributions.

...

options, see function overlap for details.

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 q \times 3 where each row contains the following statistics: estOV, estimated overlapping area, \hat{η}; bias, difference between the expected value over the bootstrap samples and the observed overlapping area: E(\hat{η}^*)-\hat{η}; se, bootstrap standard error σ_{\hat{η}}.

OVboot_dist

a matrix with B rows (bootstrap replicates) and q columns (depending on the number of elements of x); each column is a boostrap distribution of the corresponding overlapping measure.

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()

overlapping documentation built on Dec. 28, 2022, 2:13 a.m.