Learn R Programming

BoundEdgeworth (version 0.1.3)

Gauss_test_powerAnalysis: Computation of uniformly valid power and sufficient sample size for the one-sided Gauss test

Description

Let \(X_1, \dots, X_n\) be \(n\) i.i.d. variables with mean \(\mu\), variance \(\sigma^2\). Assume that we want to test the hypothesis \(H_0: \mu \leq \mu_0\) against the alternative \(H_1: \mu \leq \mu_0\). For this, we want to use the classical Gauss test, which rejects the null hypothesis if \(\sqrt{n}(\bar{X}_n - \mu)\) is larger than the quantile of the Gaussian distribution at level \(1 - \alpha\). Let \(\eta := (\mu - \mu_0) / \sigma\) be the effect size, i.e. the distance between the null and the alternative hypotheses, measured in terms of standard deviations. Let beta be the uniform power of this test: $$beta = \inf_{H_1} \textrm{Prob}(\textrm{Rejection}),$$ where the infimum is taken over all distributions under the alternative hypothesis, i.e. that have mean \(\mu = \mu_0 + \eta \sigma\), bounded kurtosis K4, and that satisfy the regularity condition kappa described below. This means that this power beta is uniformly valid over a large (infinite-dimensional) class of alternative distributions, much beyond the Gaussian family even though the test is based on the Gaussian quantile. There is a relation between the sample size n, the effect size eta and the uniform power beta of this test. This function takes as an input two of the three quantities (the sample size n, the effect size eta, and the uniform power beta) and return the other one.

Usage

Gauss_test_powerAnalysis(
  eta = NULL,
  n = NULL,
  beta = NULL,
  alpha = 0.05,
  K4 = 9,
  kappa = 0.99
)

Value

The computed value of either the sufficient sample size n, or the minimum effect size eta, or the power beta.

Arguments

eta

the effect size \(\eta\) that characterizes the alternative hypothesis

n

sample size

beta

the power of detecting the effect eta using the sample size n

alpha

the level of the test

K4

the kurtosis of the \(X_i\)

kappa

Regularity parameter of the distribution of the \(X_i\) It corresponds to a bound on the modulus of the characteristic function \(f_{X_n / \sigma_n}(t)\) of the standardized \(X_n\). More precisely, kappa is an upper bound on \(kappa :=\) sup of modulus of \(f_{X_n / \sigma_n}(t)\) over all \(t\) such that \(|t| \geq 2 t_1^* \pi / K3tilde\).

Details

This function can be used to plan experiments, for example to know what would be a sufficient sample size to attain a fixed power against a given effect size that the researcher would like to detect.

Note that the results given by this function are formally valid only for the Gauss test (i.e., when the variance of the distribution is assumed to be known).

References

Derumigny A., Girard L., and Guyonvarch Y. (2023). Explicit non-asymptotic bounds for the distance to the first-order Edgeworth expansion, Sankhya A. tools:::Rd_expr_doi("10.1007/s13171-023-00320-y") arxiv:2101.05780.

Examples

Run this code

# Sufficient sample size to detect an effect of 0.5 standard deviation with probability 80%
Gauss_test_powerAnalysis(eta = 0.5, beta = 0.8)
# We can detect an effect of 0.5 standard deviations with probability 80% for n >= 548

# Power of an experiment to detect an effect of 0.5 with a sample size of n = 800
Gauss_test_powerAnalysis(eta = 0.5, n = 800)
# We can detect an effect of 0.5 standard deviations with probability 85.1% for n = 800

# Smallest effect size that can be detected with a probability of 80% for a sample size of n = 800
Gauss_test_powerAnalysis(n = 800, beta = 0.8)
# We can detect an effect of 0.114 standard deviations with probability 80% for n = 800


Run the code above in your browser using DataLab