| Type: | Package | 
| Title: | Power and Sample Size Analysis for One-way and Two-way ANOVA Models | 
| Version: | 1.0 | 
| Date: | 2017-05-01 | 
| Author: | Pengcheng Lu, Junhao Liu, Devin Koestler | 
| Maintainer: | Pengcheng Lu <plu2@kumc.edu> | 
| Description: | User friendly functions for power and sample size analysis at one-way and two-way ANOVA settings take either effect size or delta and sigma as arguments. They are designed for both one-way and two-way ANOVA settings. In addition, a function for plotting power curves is available for power comparison, which can be easily visualized by statisticians and clinical researchers. | 
| License: | GPL-2 | 
| NeedsCompilation: | no | 
| Packaged: | 2017-05-02 02:51:50 UTC; Junhao | 
| Repository: | CRAN | 
| Date/Publication: | 2017-05-06 05:22:35 UTC | 
Power and Sample Size Analysis for One-way and Two-way ANOVA Models
Description
User friendly functions for power and sample size analysis at one-way and two-way ANOVA settings take either effect size or delta and sigma as arguments. They are designed for both one-way and two-way ANOVA settings. In addition, a function for plotting power curves is available for power comparison, which can be easily visualized by statisticians and clinical researchers.
Details
| Package: | SPA | 
| Type: | Package | 
| Version: | 1.0 | 
| Date: | 2017-05-01 | 
| License: | GPL-2 | 
There are major five functions in the package. The pwr.1way and pwr.2way functions provide the power analysis for one-way and two-way ANOVA models. The ss.1way and ss.2way functions provide the sample size calculation for one-way and two-way ANOVA models. The pwr.plot function illustrates drawing power curves for different parameter settings.
Author(s)
Pengcheng Lu, Junhao Liu, and Devin Koestler.
Maintainer:Pengcheng Lu <plu2@kumc.edu>
References
[1] Angela Dean & Daniel Voss (1999). Design and Analysis of Experiments. Springer.
Examples
## Example 1
pwr.2way(a=3, b=3, alpha=0.05, size.A=4, size.B=5, f.A=0.8, f.B=0.4)
pwr.2way(a=3, b=3, alpha=0.05, size.A=4, size.B=5, delta.A=4, delta.B=2, sigma.A=2, sigma.B=2)
## 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 3
n <- seq(2, 30, by=4)
f <- seq(0.1, 1.0, length.out=10)
pwr.plot(n=n, k=5, f=f, alpha=0.05)
Power calculation for balanced one-way ANOVA models
Description
Calculate power for one-way ANOVA models.
Usage
pwr.1way(k=k, n=n, alpha=alpha, f=NULL, delta=delta, sigma=sigma)
Arguments
| k | Number of groups | 
| n | Sample size per group | 
| f | Effect size | 
| alpha | Significant level (Type I error probability) | 
| delta | The smallest difference among k groups | 
| sigma | Standard deviation, i.e. square root of variance | 
Details
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
## Example 1
pwr.1way(k=5, n=15, alpha=0.05, delta=1.5, sigma=1)
pwr.1way(k=5, n=15, f=NULL, alpha=0.05, delta=1.5, sigma=1)
## Example 2
pwr.1way(k=5, n=15, f=0.4, alpha=0.05)
Power calculation for balanced two-way ANOVA models
Description
Calculate power for two-way ANOVA models.
Usage
pwr.2way(a=a, b=b, alpha=alpha, size.A=size.A, size.B=size.B, f.A=NULL, f.B=NULL, 
delta.A=NULL, delta.B=NULL, sigma.A=NULL, sigma.B=NULL)
Arguments
| a | Number of groups in Factor A | 
| b | Number of groups in Factor B | 
| alpha | Significant level (Type I error probability) | 
| size.A | Sample size per group in Factor A | 
| size.B | Sample size per group in Factor B | 
| 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 | 
Details
If effect sizes f.A and f.B are known, plug them in to the function; If delta.A and sigma.A are known instead of f.A, put NULL to f.A. Similarly as delta.B and sigma.B.
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
## Example 1
pwr.2way(a=3, b=3, alpha=0.05, size.A=4, size.B=5, f.A=0.8, f.B=0.4)
## Example 2
pwr.2way(a=3, b=3, alpha=0.05, size.A=4, size.B=5, delta.A=4, delta.B=2, sigma.A=2, sigma.B=2)
pwr.2way(a=3, b=3, alpha=0.05, size.A=4, size.B=5, f.A=NULL, f.B=NULL, 
delta.A=4, delta.B=2, sigma.A=2, sigma.B=2)
Power curves for different parameter settings (sample size and effect size) in balanced one-way ANOVA models
Description
Draw power curves for different parameter settings in balanced one-way ANOVA models.
Usage
pwr.plot(n=n, k=k, f=f, alpha=alpha)
Arguments
| n | Sample size per group | 
| k | Number of groups | 
| f | Effect size | 
| alpha | Significant level (Type I error probability) | 
Details
This function demonstrates drawing power curves for different sample size and effect size settings. N and f can be either a single value or a sequence of values, but they cannot be single values simultaneously. The combination of them could be (a sequence of n, a sequence of f), (a sequence of n, a single f), or (a single n, a sequence of f).
Author(s)
Pengcheng Lu, Junhao Liu, and Devin Koestler.
References
Angela Dean & Daniel Voss (1999). Design and Analysis of Experiments. Springer.
Examples
## Example 1
n <- seq(2, 30, by=4)
f <- 0.5
pwr.plot(n=n, k=5, f=f, alpha=0.05)
## Example 2
n <- 20
f <- seq(0.1, 1.0, length.out=10)
pwr.plot(n=n, k=5, f=f, alpha=0.05)
## Example 3
n <- seq(2, 30, by=4)
f <- seq(0.1, 1.0, length.out=10)
pwr.plot(n=n, k=5, f=f, alpha=0.05)
Sample size calculation for balanced one-way ANOVA models
Description
Calculate sample size for one-way ANOVA models.
Usage
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
## 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)
Sample size calculation for balanced two-way ANOVA models
Description
Calculate sample size for two-way ANOVA models.
Usage
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
## 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)