ss.2way: Sample size calculation for balanced two-way ANOVA models

Description Usage Arguments Details Value Author(s) References Examples

View source: R/ss.2way.R

Description

Calculate sample size for two-way ANOVA models.

Usage

1
2
ss.2way(a=a, b=b, alpha=alpha, beta=beta, f.A=NULL, f.B=NULL, 
delta.A=NULL, delta.B=NULL, sigma.A=NULL, sigma.B=NULL, B=B)

Arguments

a

Number of groups in Factor A

b

Number of groups in Factor B

alpha

Significant level (Type I error probability)

beta

Type II error probability (Power=1-beta)

f.A

Effect size of Factor A

f.B

Effect size of Factor B

delta.A

The smallest difference among a groups in Factor A

delta.B

The smallest difference among b groups in Factor B

sigma.A

Standard deviation, i.e. square root of variance in Factor A

sigma.B

Standard deviation, i.e. square root of variance in Factor B

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.

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
7
## Example 1
ss.2way(a=3, b=3, alpha=0.05, beta=0.1, f.A=0.4, f.B=0.2, B=100)
ss.2way(a=3, b=3, alpha=0.05, beta=0.1, f.A=0.4, f.B=0.2, 
delta.A=NULL, delta.B=NULL, sigma.A=NULL, sigma.B=NULL, B=100)

## Example 2
ss.2way(a=3, b=3, alpha=0.05, beta=0.1, delta.A=1, delta.B=2, sigma.A=2, sigma.B=2, B=100)

Example output

     Balanced two-way analysis of variance sample size adjustment 

              a = 3
              b = 3
      sig.level = 0.05
          power = 0.9
              n = 36

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


     Balanced two-way analysis of variance sample size adjustment 

              a = 3
              b = 3
      sig.level = 0.05
          power = 0.9
              n = 36

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


     Balanced two-way analysis of variance sample size adjustment 

              a = 3
              b = 3
      sig.level = 0.05
          power = 0.9
              n = 35

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

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