Learn R Programming

ssanv (version 1.1)

ss.fromdata.nvar: Find sample sizes when normal standard deviation is estimated from data

Description

Calculate sample sizes for two-sample differences in normal means when the standard deviation (or variance) is estimated from existing data.

Usage

ss.fromdata.nvar(delta, sdhat = NULL, vhat = NULL, df = Inf, ss.ratio = 1, var.ratio = 1, deltaB = 0, sig.level = 0.05, power = 0.8, alternative = c("two.sided", "one.sided"))

Arguments

delta
clinically significant difference in means
sdhat
estimate of standard deviation from existing data (must supply either sdhat or vhat)
vhat
estimate of variance from existing data (must supply either sdhat or vhat)
df
degrees of freedom associated with standard deviation (or variance) estimate
ss.ratio
n1/n0, where n0 (n1) is sample size of control (treatment) group for proposed study
var.ratio
$sigma1^2/sigma0^2$, where $sigma0$ ($sigma1$) is standard deviation of control (treatment) group for proposed study
deltaB
boundary value between null and alternative hypotheses for one-sided tests (see details)
sig.level
significance level (Type I error)
power
minimum power that you want the sample size to achieve
alternative
One- or two-sided test

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.

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. The standard deviation (sdhat) or variance (vhat) is estimated from existing data that is assumed to also follow a normal distribution with variance the same as the control group of the proposed study. If sdhat (or vhat) is estimated from one group with a sample size of m, then df=m-1. If sdhat (or vhat) is estimated from two groups with sample sizes of m0 and m1, then df=m0+m1-2.

The one-sided tests are designed to test either $H0: delta <= deltab$="" vs.="" $h1:="" delta=""> deltaB$ or to test $H0: delta >= deltaB$ vs. $H1: delta < deltaB$. The choice of hypotheses is determined by the value of delta; if delta $>$ deltaB 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.neff, ss.fromdata.pois, ss.nonadh, find.calibrated.beta

Examples

Run this code
ss.fromdata.nvar(.4,sdhat=.682,df=46)

Run the code above in your browser using DataLab