BootstrapStat: Non-Parametric population samples and statistic comparison

BootstrapStatR Documentation

Non-Parametric population samples and statistic comparison

Description

Random populations are generated via ressampling using the suplied population. A statistic is calculated on the random population and compared to the statistic calculated on the original population.

Usage

BootstrapStat(
  ind.data,
  iterations,
  ComparisonFunc,
  StatFunc,
  sample.size = dim(ind.data)[1],
  parallel = FALSE
)

Arguments

ind.data

Matrix of residuals or indiviual measurments

iterations

Number of resamples to take

ComparisonFunc

comparison function

StatFunc

Function for calculating the statistic

sample.size

Size of ressamples, default is the same size as ind.data

parallel

if TRUE computations are done in parallel. Some foreach backend must be registered, like doParallel or doMC.

Value

returns the mean repeatability, that is, the mean value of comparisons from samples to original statistic.

Author(s)

Diogo Melo, Guilherme Garcia

See Also

BootstrapRep, AlphaRep

Examples

cov.matrix <- RandomMatrix(5, 1, 1, 10)

BootstrapStat(iris[,1:4], iterations = 50,
               ComparisonFunc = function(x, y) PCAsimilarity(x, y)[1],
               StatFunc = cov)

#Calculating R2 confidence intervals
r2.dist <- BootstrapR2(iris[,1:4], 30)
quantile(r2.dist)

#Multiple threads can be used with some foreach backend library, like doMC or doParallel
#library(doParallel)
##Windows:
#cl <- makeCluster(2)
#registerDoParallel(cl)
##Mac and Linux:
#registerDoParallel(cores = 2)
#BootstrapStat(iris[,1:4], iterations = 100,
#               ComparisonFunc = function(x, y) KrzCor(x, y)[1],
#               StatFunc = cov,
#               parallel = TRUE)

lem-usp/EvolQG documentation built on April 14, 2024, 6:21 a.m.