boot.overlap: Nonparametric Bootstrap for estimated overlapping area

Description Usage Arguments Details Value Note Author(s) References Examples

View source: R/boot.overlap.R

Description

Bootstrap the estimated overlapping area of two or more kernel density estimations from empirical data.

Usage

1
boot.overlap( x, B = 1000, ... )

Arguments

x

list of numerical vectors to be compared; each vector is an element of the list

B

integer, number of bootstrap draws

...

options, see function overlap for details

Details

If the list x contains more than two elements (i.e. more than two distributions) it computes bootstrap overlapping between all q number of paired distributions. For example, if x contains three elements, then q = 3; if x contains four elements, then q = 6, and so on.

Value

It returns a list containing the following components:

OVboot_stats

Data frame q \times 3; each row containing the following statistics: estOV, estimated overlapping area, \hat{η}; bias, difference between the bootstrap's expected value and the observed value of the overlapping area: E(\hat{η}^*)-\hat{η}; se, bootstrap standard error σ_{\hat{η}}.

OVboot_dist

Matrix B \times q, B rows (bootstrap replicates) and q columns (depending on the number of elements of x); each column is a boostrap distribution of an overlapping index.

Note

Call function overlap.

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. 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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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()

masspastore/overlapping documentation built on Oct. 18, 2019, 3:31 a.m.