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