Compute power of test, or determine parameters to obtain target power for equal and unequal sample sizes.
1 2 3 4 
n 
Number of observations (per group) 
delta 
True difference in means 
sd 
Standard deviation 
sig.level 
Significance level (Type I error probability) 
power 
Power of test (1 minus Type II error probability) 
ratio 
The ratio n2/n1 between the larger group and the smaller group. Should be a value equal to or greater than 1 since n2 is the larger group. Defaults to 1 (equal group sizes) 
sd.ratio 
The ratio sd2/sd1 between the standard deviations in the larger group and the smaller group. Defaults to 1 (equal standard deviations in the two groups) 
type 
Type of t test 
alternative 
One or twosided test 
df.method 
Method for calculating the degrees of default. Possibilities are welch (the default) or classical. 
strict 
Use strict interpretation in twosided case 
Exactly one of the parameters n
, delta
, power
, sd
, sig.level
, ratio
sd.ratio
must be passed as NULL,
and that parameter is determined from the others. Notice that the last two have nonNULL defaults
so NULL must be explicitly passed if you want to compute them.
If strict = TRUE
is used, the power will include the probability
of rejection in the opposite direction of the true effect, in the
twosided case. Without this the power will be half the
significance level if the true difference is zero.
Object of class power.htest
, a list of the arguments (including the computed one)
augmented with method
and note
elements.
uniroot
is used to solve power equation for unknowns, so you may
see errors from it, notably about inability to bracket the root
when invalid arguments are given.
Claus Ekstrom claus@rprimer.dk
power.prop.test
1  power.t.test(delta=300, sd=450, power=.8, ratio=4)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.