ss.1way: Sample size calculation for balanced one-way ANOVA models

Description Usage Arguments Details Value Author(s) References Examples

View source: R/ss.1way.R

Description

Calculate sample size for one-way ANOVA models.

Usage

1
ss.1way(k=k, alpha=alpha, beta=beta, f=NULL, delta=delta, sigma=sigma, B=B)

Arguments

k

Number of groups

alpha

Significant level (Type I error probability)

beta

Type II error probability (Power=1-beta)

f

Effect size

delta

The smallest difference among k group

sigma

Standard deviation, i.e. square root of variance

B

Iteration times, default number is 100

Details

Beta is the type II error probability which equals 1-power. For example, if the target power is 85% (=0.85), the corresponding beta equals 0.15. If effect size f is known, plug it in to the function; If delta and sigma are known instead of effect size, put NULL to f, or just miss f argument.

Value

Object of class "power.htest", a list of the arguments (including the computed one) augmented with "method" and "note" elements.

Author(s)

Pengcheng Lu, Junhao Liu, and Devin Koestler.

References

Angela Dean & Daniel Voss (1999). Design and Analysis of Experiments. Springer.

Examples

1
2
3
4
5
6
## Example 1
ss.1way(k=5, alpha=0.05, beta=0.1, f=1.5, B=100)

## Example 2
ss.1way(k=5, alpha=0.05, beta=0.1, delta=1.5, sigma=1, B=100)
ss.1way(k=5, alpha=0.05, beta=0.1, f=NULL, delta=1.5, sigma=1, B=100)

Example output

     Balanced one-way analysis of variance sample size adjustment 

              k = 5
      sig.level = 0.05
          power = 0.9
              n = 3

NOTE: n is number in each group, total sample = 15


     Balanced one-way analysis of variance sample size adjustment 

              k = 5
      sig.level = 0.05
          power = 0.9
              n = 15

NOTE: n is number in each group, total sample = 75


     Balanced one-way analysis of variance sample size adjustment 

              k = 5
      sig.level = 0.05
          power = 0.9
              n = 15

NOTE: n is number in each group, total sample = 75

pwr2 documentation built on May 2, 2019, 10:16 a.m.