Learn R Programming

ssanv (version 1.1)

ss.fromdata.pois: Find sample sizes when 2 Poisson means are estimated from data

Description

Calculate sample sizes for two-sample differences in Poisson means when means are estimated from existing data

Usage

ss.fromdata.pois(xbar0, xbar1, m0, m1, ss.ratio = 1, sig.level = 0.05, real.power = 0.8, nominal.power = NULL, alternative = c("two.sided", "one.sided"), MINN0 = 1, MAXN0 = 10^5)

Arguments

xbar0
mean from control group of existing data
xbar1
mean from treatment group of existing data
m0
sample size of control group of existing data
m1
sample size of treatment group of existing data
ss.ratio
n1/n0, where n0 (n1) is sample size of control (treatment) group for proposed study
sig.level
significance level (Type I error)
real.power
minimum power that you want the sample size to achieve, only .8 or .9 allowed
nominal.power
see details
alternative
One- or two-sided test
MINN0
minimum sample size for control group
MAXN0
maximum sample size for control group

Value

(including the computed sample sizes) augmented with 'METHOD' and 'NOTE' elements. The values 'n0' and 'n1' are the samples sizes for the two groups, rounded up to the nearest integer.

Details

Calculates the sample sizes for a study designed to test the difference between the means of two groups, where it is assumed that the responses from both groups are distributed Poisson. The means from each group (xbar0 and xbar1) come from existing data that is assumed to also follow the same Poisson distributions. The method is inherently conservative, so that with a nominal power of .77 the real power will be about .80, and a nominal power of .89 the real power will be about .90. Other values of nominal power are allowed, but only real powers of .80 or .90 are allowed. If mu0 and mu1 are the means from the two groups, the one-sided tests are designed to test either $H0: mu0 <= mu1$="" vs.="" $h1:="" mu0=""> mu1$ or to test $H0: mu0 >= mu1 $ vs. $H1: mu0 < mu1$. We estimate $mu0$ and $mu1$ with $mu0hat=xbar0 + 1/(2m0)$ and $mu1hat=xbar1 + 1/(2m1)$. The choice of hypotheses is determined by the value of $mu0hat$ and $mu1hat$; if $mu0hat > mu1hat$ then the former hypotheses are tested, otherwise the latter are. See Fay, Halloran and Follmann (2007) for details.

References

Fay, M.P., Halloran, M.E., and Follmann, D.A. (2007). `Accounting for Variability in Sample Size Estimation with Applications to Nonadherence and Estimation of Variance and Effect Size' Biometrics 63: 465-474.

See Also

ss.fromdata.nvar, ss.fromdata.neff, ss.nonadh, uniroot.integer

Examples

Run this code
ss.fromdata.pois(1.65,.88,23,25)

Run the code above in your browser using DataLab