ss.fromdata.pois {ssanv}R Documentation

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

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 H_0: \mu_0 \leq \mu_1 vs. H_1: \mu_0 > \mu_1 or to test H_0: \mu_0 \geq \mu_1 vs. H_1: \mu_0 < \mu_1. We estimate \mu_0 and \mu_1 with \hat{\mu}_0 = xbar0 + \frac{1}{2m_0} and \hat{\mu}_1 = xbar1 + \frac{1}{2m_1} . The choice of hypotheses is determined by the value of \hat{\mu}_0 and \hat{\mu}_1; if \hat{\mu}_0 > \hat{\mu}_1 then the former hypotheses are tested, otherwise the latter are. See Fay, Halloran and Follmann (2007) for details.

Value

Object of class "power.htest", a list of the arguments (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.

Note

The function ss.fromdata.pois calls uniroot.integer, a function written for this package that finds the nearest integer to the root.

Author(s)

Michael P. Fay

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

ss.fromdata.pois(1.65,.88,23,25)

[Package ssanv version 1.1 Index]