ss.fromdata.neff {ssanv}R Documentation

Find sample sizes when normal standardized difference is estimated from data

Description

Calculate sample sizes for two-sample differences in normal means when standardized difference is estimated from existing data

Usage

ss.fromdata.neff(thetahat, m0, m1, ss.ratio = 1, thetaB = 0, 
    sig.level = 0.05, real.power = 0.8, nominal.power = NULL, 
    alternative = c("two.sided", "one.sided"), 
    MINN0 = 2, MAXN0 = Inf, subdivisions = 1000)

Arguments

thetahat

estimated standardized difference in means

m0

sample size from control group of existing data

m1

sample size from treatment group of existing data

ss.ratio

n1/n0, where n0 (n1) is sample size of control (treatment) group for proposed study

thetaB

boundary value between null and alternative hypotheses for one-sided tests (see details)

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

subdivisions

number of subdivisions for numerical integration

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 each group are distributed normally with the same variance. The standardized difference in means (thetahat) is estimated from existing data that is assumed to also follow the same normal distribution. The method is inherently conservative, so that with a nominal power of .76 the real power will be about .80, and a nominal power of .88 the real power will be about .90. Other values of nominal power are allowed, but only real powers of .80 or .90 are allowed. The one-sided tests are designed to test either H_0: \theta \leq \theta_B vs. H_1: \theta > \theta_B or to test H_0: \theta \geq \theta_B vs. H_1: \theta < \theta_B. The choice of hypotheses is determined by the value of thetahat; if thetahat > thetaB 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.neff 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.pois, ss.nonadh, uniroot.integer

Examples

ss.fromdata.neff(.588,23,25)

[Package ssanv version 1.1 Index]