Next: interactplot()
Up: Design Macros Help File
Previous: findpower()
Contents
Usage:
findsampsize(means,sigma2,alpha,pow[,rcb:T,prop:propvec])
means a REAL vector, sigma2, alpha, and pow positive REALs; alpha
and pow must be less than 1. Elements of propvec must be positive,
and means and propvec must be the same length. Cannot use rcb:
and prop: together.
findsampsize(ncp1,ngrps,alpha,pow[,rcb:T]) all arguments positive
scalars; ngrps is integer.
|
Keywords:
design
Usage
findsampsize(means,sigma2,alpha,pow) computes the minimum sample size
for the power of the F-test in the one-way anova testing the null
hypothesis of no treatment differences to be at least pow when the
means, sample sizes, and error variance are as given. Argument sigma2
must be positive; alpha and pow must be between 0 and 1. This usage
assumes that the sample sizes will be equal. The result is a structure
with components for the sample sizes and the achieved power.
findsampsize(ncp1,ngrps,alpha,pow) computes the minimum sample size
for the power of the F-test in the one-way anova testing the null
hypothesis of no treatment differences to be at least pow when the
n=1 noncentrality parameter, number of groups, and error variance
are as given. ncp1 must be positive. This usage assumes that the
sample sizes will be equal. The result is a structure with
components for the sample sizes and the achieved power.
Examples
Here we have three treatment groups with means 2.2, 2.8, and 3.1, the
error variance is 2, the type 1 error rate is .05, and the minimum
acceptable power is .7; the required sample size is 38
Cmd> findsampsize(vector(2.2,2.8,3.1),2,.05,.7)
component: nis
(1) 38 38 38
component: power
(1) 0.7039
Here we have three groups with a noncentrality of .21, the type 1
error is .05, and the minimum power is .7, then
Cmd> findsampsize(.21,3,.05,.7)
component: nis
(1) 38 38 38
component: power
(1) 0.7039
(This is just the previous example.)
Keyword prop
The additional keyword argument prop:propvec may also be used. propvec
must be a vector of positive reals the same length as means. In this
usage, findsampsize() will find a vector of sample sizes that achieves
the desired power but is (nearly) proportional to propvec.
Examples
Here we have three treatment groups with means 2.2, 2.8, and 3.1, the
error variance is 2, the type 1 error rate is .05, and the minimum
acceptable power is .7; we also require that the sample sizes be in
proportion 1:1:4
Cmd> findsampsize(vector(2.2,2.8,3.1),2,.05,.7,prop:vector(1,1,4))
component: nis
(1) 24 24 94
component: power
(1) 0.70055
Keyword rcb
The keyword argument rcb:T is used to indicate that the error df
should be computed as for a randomized complete block. This will
usually increase the needed sample size (all other parameters held
constant, although the whole point of blocking is to reduce the error
variance).
Examples
Here we have three treatment groups with means 2.2, 2.8, and 3.1, the
error variance is 2, the type 1 error rate is .05, and the minimum
acceptable power is .7; we also require an RCB design.
Cmd> findsampsize(vector(2.2,2.8,3.1),2,.05,.7,rcb:T)
component: nis
(1) 39 39 39
component: power
(1) 0.71011
Gary Oehlert
2006-01-30