Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

power_Gamma

Power Calculations for Test of Two Gamma Means


Description

Compute the power for a test of two sample means with Gamma distributions, or determine parameters to obtain a target power.

Usage

power_Gamma(n1 = NULL, n2 = NULL, mu1 = NULL, mu2 = NULL, 
gmu1 = NULL, gmu2 = NULL, sig.level = 0.05, power = NULL, 
trials = 100, M = 10000, equal.sample = TRUE, equal.shape = NULL)

Arguments

n1

sample size in group 1, or sample size in each group if equal.sample = TRUE

n2

sample size in group 2

mu1

arithmetic mean of group 1

mu2

arithmetic mean of group 2

gmu1

geometric mean of group 1

gmu2

geometric mean of group 2

sig.level

significance level (Type I error probability)

power

power of test (1 minus Type II error probability)

trials

number of trials in simulation

M

number of simulations used in CAT method, see Chang (2011)

equal.sample

equal sample sizes for two groups, see details

equal.shape

assume the shape parameters are equal for two groups, see details

Details

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.

Value

Object of class "power.htest", a list of the arguments (including the computed one) augmented with method element.

References

Chang et al. (2011). Testing the equality of several gamma means: a parametric bootstrap method with applications. Computational Statistics, 26:55-76.

Examples

# Calculate power, equal sizes
power_Gamma(n1 = 50, mu1 = 1, mu2 = 1.5, gmu1 = 0.6, gmu2 = 0.6, M = 100)

PASSED

Calculate Power and Sample Size for Two Sample Mean Tests

v1.1-0
GPL (>= 2)
Authors
Jinpu Li [aut, cre], Ryan Knigge [aut], Kaiyi Chen [aut], Emily Leary [aut]
Initial release
2021-05-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.