Compute the power for a test of two sample means with Gamma distributions, or determine parameters to obtain a target power.
power_Gamma(n1 = NULL, n2 = NULL, power = NULL, sig.level = 0.05,
mu1 = NULL, mu2 = NULL, gmu1 = NULL, gmu2 = NULL, trials = 100,
M = 10000, equal.sample = TRUE, equal.shape = NULL, trace = FALSE)
Object of class "power.htest", a list of the arguments (including the computed one) augmented with method element.
sample size in group 1, or sample size in each group if equal.sample = TRUE
sample size in group 2
power of test (1 minus Type II error probability)
significance level (Type I error probability)
arithmetic mean of group 1
arithmetic mean of group 2
geometric mean of group 1
geometric mean of group 2
number of trials in simulation
number of simulations used in CAT method, see Chang (2011)
equal sample sizes for two groups, see details
assume the shape parameters are equal for two groups, see details
if positive, sample size and power are printed during the running of each simulation
Exactly one of the parameters n1
, n2
, and power
must be passed as NULL, and that parameter is determined from the others.
Notice that sig.level
has non-NULL defaults, so NULL must be explicitly passed if you want to compute it.
If equal.sample = TRUE
is used, N in output will denote the number in each group.
The equal shape parameter assumption will be tested automatically; otherwise it could be set manually with equal.shape
.
Chang et al. (2011). Testing the equality of several gamma means: a parametric bootstrap method with applications. Computational Statistics, 26:55-76.
# Calculate power, equal sizes
power_Gamma(n1 = 50, mu1 = 1, mu2 = 1.5, gmu1 = 0.6, gmu2 = 0.6, M = 100)
Run the code above in your browser using DataLab