rbtt: Perform robust bootstrapped t-tests

Description Usage Arguments Value Examples

View source: R/rbtt.R

Description

Perform robust bootstrapped two-sample t-tests that aim to better control type-I error rates when comparing means of non-negative distributions with excess zero observations.

Usage

1
rbtt(x, y, n.boot, n.cores = 1, method = "combined", conf.level = 0.95)

Arguments

x

a (non-empty) numeric vector of data values.

y

a (non-empty) numeric vector of data values.

n.boot

number of bootstrap resamples to perform

n.cores

number of cores to use for parallelization. Defaults to 1. If using Windows, set n.cores = 1.

method

Which robust bootstrapped t-test to perform. Set ‘method=1<e2><80><99> for a two-sample t-test under the equal variance assumption, ’method = 2' for a two-sample t-test without the equal variance assumption, and 'method = "both"' to perform both methods simultaneously.

conf.level

Desired confidence level for computing confidence intervals: a number between 0 and 1.

Value

A list (or two lists in the case of method = "combined") containing the following components:

statistic

the value of the t-statistic.

p.value

the p-value for the test.

conf.int

a bootstrap-based confidence interval for the difference in means.

estimate

the estimated difference in means.

null.value

the hypothesized value of the mean difference, zero.

alternative

a character string describing the alternative hypothesis.

method

a character string describing the type of two-sample bootstrapped t-test used

data.name

a character string giving the names of the data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
x=rbinom(50,1,0.5)*rlnorm(50,0,1)
y=rbinom(150,1,0.3)*rlnorm(150,2,1)

rbtt(x, y, n.boot=999)

# Perform bootstrap resamples on 2 cores
rbtt(x, y, n.boot=999, n.cores=2)

# Use methods 1 or 2 individually
rbtt(x, y, n.boot = 999, method = 1)
rbtt(x, y, n.boot = 999, method = 2)

# Use a confidence level of 0.99
rbtt(x, y, n.boot = 999, conf.level = 0.99)

WannabeSmith/Robust-bootstrapped-t-test documentation built on May 14, 2019, 10:32 a.m.