computeBootstrapTest {CAVIAR}R Documentation

computeBootstrapTest

Description

Computes bootstrap test for comparing 2 groups.

Usage

computeBootstrapTest(y, z, y.sd = NA, z.sd = NA, stat = "median", centring = FALSE,
		     iter = 1000, var.name = "", out = FALSE, plot = FALSE, plot.label = "")

Arguments

y a vector containing data for the first group
z a vector containing data for the second group
y.sd an optional vector containing standard deviations for the first group
z.sd an optional vector containing standard deviations for the second group
stat the method to be used:
"mean" for mean comparison;
"Student" for mean comparison using Student's t statistic;
"median" for median comparison (default);
"var" for variance comparison;
"disp.mean" for dispersion around the mean comparison;
"disp.median" for dispersion around the median comparison.
centring an optional logical indicating if data must be centred or not (default=FALSE)
iter an optional integer indicating the number of iterations for the bootstrap (default=1000)
var.name an optional character labeling the variable to be tested
out an optional logical indicating if bootstrapped series must be outputted or not (default=FALSE)
plot an optional logical indicating if a plot must be outputted or not (default=FALSE)
plot.label an optional character containing the plot title

Details

Computes unilateral bootstrap permutation tests for testing equality of mean, median or variance between two groups.
Several test statistics can be used: mean difference, Studentized mean difference, median difference, logarithm ratio of variance, dispersion around the mean ratio and dispersion around the median ratio.
For test statistics based on the mean, data can be centred.
Moreover this function can also be feed with two additional vectors containing standard deviations around the critical dates in order to take dispersion into account. It can plot (optionplot) an histogram of the bootstrap distribution of the tested statistic along with its observed value.

Value

A list containing the results of the test:
summary Summary of the test
ASL Signification level of the test
ts.obs Observed value of the tested statistic (out=TRUE)
iterations number of iterations (out=TRUE)
nb.combinations number of possible combinations (out=TRUE)
ts bootstrap series (out=TRUE)

Warning

Dispersion is not implemented for tests based on centred statistics (centring=TRUE)!

Note

Version: 4.0
Last modifications: 9 February 2010

Author(s)

Cyrille Rathgeber - LERFoB, UMR1092 - INRA Nancy (France)
Email: cyrille.rathgeber@nancy.inra.fr

References

Rathgeber C.B.K., Longuetaud F. , Mothe F., Cuny H., Le Moguedec G. 2010. Phenology of wood formation: data processing, analysis and visualisation using R. Accepted in Dendrochronologia.

See Also

CAVIAR-package, computeCriticalDates and plotWoodCalendar

Examples

## Loading the example dataset:
data(AMA2006)

## Computing wood formation critical dates for firs and pines:
Fir.cdd <- computeCriticalDates(AMA2006[AMA2006$Sp=="ABAL", ])
Pine.cdd <- computeCriticalDates(AMA2006[AMA2006$Sp=="PISY", ])

## Testing if pines start xylogenesis before firs
computeBootstrapTest(Fir.cdd$bE, Pine.cdd$bE)

## Testing if pines start xylogenesis before firs with taking dispersion into account
computeBootstrapTest(Fir.cdd$bE, Pine.cdd$bE, Fir.cdd$bE.sd, Pine.cdd$bE.sd)

[Package CAVIAR version 0.1-0 Index]