Skip to contents

This function computes the approximate achieved significance level (ASL) for a permutation test or bootstrap hypothesis test.

Usage

computeASL(obs, rnd, alternative = c("two.sided", "less", "greater"))

Arguments

obs

a numeric scalar representing the observed value of the summary statistic.

rnd

numerical vector containing the permutation/bootstrap replication of the statistics.

alternative

a character string specifying the alternative hypothesis. Must be one of "two.sided" (default), "greater" or "less".

Value

A numerical value representing the approximate achieved significance level (ASL) of the test.

Details

It is computed as:

$$\hat{ASL}_{sample}(x) = \frac{1}{n}\sum_{i=1}^{n} {\hat{\theta}_{i}}^{*} \ge \hat{\theta}$$

where \(\hat{\theta}\) is a summary statistic; \({\hat{\theta}}^{*}\) is the permutation/bootstrap distribution of \(\hat{\theta}\); \({\hat{\theta}_{i}}^{*}\) is the computed statistic on the \(i\)-th permutation/bootstrap vector.

\(\hat{\theta}\) is observed, and the ASL of the test represents the probability of observing at least that large a value when the null hypothesis is true.

See also

Efron, B. and Tibshirani, R.J., An Introduction to the Bootstrap, pp.208 (1994)

Author

Alessandro Barberis