Learn R Programming

samplesize (version 0.2-4)

n.ttest: n.ttest computes sample size for paired and unpaired t-tests.

Description

n.ttest computes sample size for paired and unpaired t-tests. Design may be balanced or unbalanced. Homogeneous and heterogeneous variances are allowed.

Usage

n.ttest(power = 0.8, alpha = 0.05, mean.diff = 0.8, sd1 = 0.83, sd2 = sd1, k = 1, design = "unpaired", fraction = "balanced", variance = "equal")

Arguments

power
Power (1 - Type-II-error)
alpha
Two-sided Type-I-error
mean.diff
Expected mean difference
sd1
Standard deviation in group 1
sd2
Standard deviation in group 2
k
Sample fraction k
design
Type of design. May be paired or unpaired
fraction
Type of fraction. May be balanced or unbalanced
variance
Type of variance. May be homo- or heterogeneous

Value

References

Bock J., Bestimmung des Stichprobenumfangs fuer biologische Experimente und kontrollierte klinische Studien. Oldenbourg 1998

Examples

Run this code
n.ttest(power = 0.8, alpha = 0.05, mean.diff = 0.80, sd1 = 0.83, k = 1,
design = "unpaired", fraction = "balanced", variance = "equal")

n.ttest(power = 0.8, alpha = 0.05, mean.diff = 0.80, sd1 = 0.83, sd2 =
2.65, k = 0.7, design = "unpaired", fraction = "unbalanced", variance =
"unequal")

Run the code above in your browser using DataLab