n.multiway {easypower} | R Documentation |
Sample size calculations for factorial ANOVAs
Description
Sample size calculations for factorial ANOVAs
Usage
n.multiway(iv1 = NULL, iv2 = NULL, iv3 = NULL, iv4 = NULL,
interaction.eta2 = "small", sig.level = 0.05, power = 0.8,
result = "all", ...)
Arguments
iv1 |
The list of data for treatment 1. |
iv2 |
The list of data for treatment 2. |
iv3 |
(optional) The list of data for treatment 3. |
iv4 |
(optional) The list of data for treatment 4. |
interaction.eta2 |
(optional) Either a character string or numeric value of the desired eta squared. Default is set to "small". |
sig.level |
(optional) Desired significance level. Default value is 0.05. |
power |
(optional) Desired level of power. Default value is 0.80. |
result |
The amount of data that will be output to the user (default = "all"). The following are the three output options the user may specify:
|
... |
Extra interactions to pass in. In order to change the effect size of a specific interaction an interaction effect may be added to the function. It must take the form: int# = int.eff.#. |
Details
Acceptable effect size character string values and their numeric equivalents are: "small" (0.01), "med" (0.06), and "large" (0.14).
Note
Sample size recommendations are rounded up to the nearest integer. More detailed examples on n.multiway can be viewed in the vignette.
References
Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Hillsdale, N.J.: Lawrence Erlbaum Associates.
Examples
# Exercise 8.15, p.400 from Cohen (1988)
# Defining the treatments
main.eff.1 <- list(name = "R", levels = 2, eta.sq = 0.123)
main.eff.2 <- list(name = "C", levels = 4, eta.sq = 0.215)
# Running n.multiway
n.multiway(iv1=main.eff.1, iv2=main.eff.2, interaction.eta2 = 0.079)
# To just view highest
n.multiway(iv1=main.eff.1, iv2=main.eff.2, interaction.eta2 = 0.079, result = "highest")
# Exercise 8.14, p.397 from Cohen (1988)
# Defining the treatments and interaction
main.eff.1 <- list(name = "Sex", levels = 2, eta.sq = 0.0099)
main.eff.2 <- list(name = "Age", levels = 3, eta.sq = 0.0588)
main.eff.3 <- list(name = "Conditions", levels = 4, eta.sq = 0.1506)
# Running n.multiway
n.multiway(iv1=main.eff.1, iv2=main.eff.2, iv3=main.eff.3, interaction.eta2 = 0.0588)