Learn R Programming

PASSED (version 1.0-3)

power_Geometric: Power Calculation for Comparing Two Geometric Rates.

Description

Compute sample size or power for comparing two geometric rates.

Usage

power_Geometric(n1 = NULL, n2 = NULL, power = NULL, sig.level = 0.05,
mu1 = NULL, mu2 = NULL, duration = 1, equal.sample = TRUE, 
alternative = c("two.sided", "one.sided"), approach = 3)

Arguments

n1

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

n2

sample size in group 2

power

power of test (1 minus Type II error probability)

sig.level

significance level (Type I error probability)

mu1

expected rate of events per time unit for group 1

mu2

expected rate of events per time unit for group 2

duration

(average) treatment duration

equal.sample

equal sample sizes for two groups, see details

alternative

one- or two-sided test

approach

1, 2, or 3; see Zhu and Lakkis (2014).

Value

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

Details

Exactly one of the parameters n1, n2, and power must be passed as NULL, and that parameter is determined from the others. If equal.sample = TRUE is used, N in output will denote the number in each group. Since the geometric distribution is a special case of negative binomial distribution, we used the algorithm for negative binomial distribution with setting theta = 1. See power.nb.test for more details.

Examples

Run this code
# NOT RUN {
# calculate power, equal sizes
power_Geometric(n1 = 100, mu1 = 0.3, mu2 = 0.6)
# calculate power, unequal sizes
power_Geometric(n1 = 180, n2 = 140, mu1 = 0.3, mu2 = 0.5)
# calculate n
power_Geometric( mu1 = 0.3, mu2 = 0.4, power = 0.8)
# }

Run the code above in your browser using DataLab