Learn R Programming

pwr2 (version 1.0)

pwr2-package:

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.

Arguments

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.

References

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

Examples

Run this code
## 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)

Run the code above in your browser using DataLab