| Type: | Package |
| Title: | Analysis of Variance for Factorial Designs ('ANOVA-kun') |
| Version: | 1.1.0 |
| Description: | Performs analysis of variance for between-subjects, within-subjects and mixed factorial designs with up to 26 factors, together with stepwise multiple comparison procedures, simple effects analyses, tests of the covariance structure of repeated measures with the corresponding epsilon corrections, effect sizes with confidence intervals, and confidence intervals of cell means. It distributes the 'ANOVA-kun' functions https://riseki.cloudfree.jp/?ANOVA%E5%90%9B, which are widely used for factorial designs in Japanese psychology and whose author is listed in the Authors field, without changing their computations; the methods and their references are documented on that page, and the results are returned as objects that print the original tables. |
| License: | MIT + file LICENSE |
| URL: | https://github.com/kosugitti/anovakun, https://kosugitti.github.io/anovakun/ |
| BugReports: | https://github.com/kosugitti/anovakun/issues |
| Encoding: | UTF-8 |
| Language: | en-US |
| Depends: | R (≥ 4.1.0) |
| Imports: | graphics, grDevices, stats, utils |
| Suggests: | lmerTest, lme4, pbkrtest, testthat (≥ 3.0.0) |
| Config/testthat/edition: | 3 |
| NeedsCompilation: | no |
| Packaged: | 2026-11-02 04:20:10 UTC; pythagoras |
| Author: | Ryuta Iseki [aut, cph],
Koji Kosugi |
| Maintainer: | Koji Kosugi <kosugitti@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-11-20 11:40:02 UTC |
Analysis of variance for factorial designs (ANOVA-kun)
Description
Performs analysis of variance for between-subjects, within-subjects, and mixed designs, given the design type and the number of levels of each factor. Post hoc analyses (multiple comparisons and simple effects), sphericity tests and corrections, effect sizes and confidence intervals are included. This is the ANOVA-kun function written by Ryuta Iseki, packaged without changing its computations.
Usage
anovakun(dataset, design, ..., long = FALSE, type2 = FALSE, nopost = FALSE,
tech = FALSE, data.frame = FALSE, copy = FALSE, holm = FALSE, hc = FALSE,
s2r = FALSE, s2d = FALSE, fs1 = FALSE, fs2r = FALSE, fs2d = FALSE,
welch = FALSE, criteria = FALSE, lb = FALSE, gg = FALSE, hf = FALSE,
cm = FALSE, auto = FALSE, mau = FALSE, har = FALSE, iga = FALSE, ciga = FALSE,
eta = FALSE, peta = FALSE, geta = NA, eps = FALSE, peps = FALSE, geps = NA,
omega = FALSE, omegana = FALSE, pomega = FALSE, gomega = NA, gomegana = NA,
nesci = FALSE, besci = FALSE, cilmd = FALSE, cilm = FALSE,
cind = FALSE, cin = FALSE, ciml = FALSE, cipaird = FALSE, cipair = FALSE,
bgraph = c(NA, NA))
## S3 method for class 'anovakun'
print(x, ...)
Arguments
x |
An object of class |
dataset |
A data frame. Between-subjects factors are arranged in columns at the left (one label column per factor) and within-subjects levels across columns (wide format), unless |
design |
A character string giving the design, e.g. |
... |
The numbers of levels of each factor, given in order (e.g. |
long |
If |
type2 |
If |
nopost |
If |
tech |
If |
data.frame |
If |
copy |
If |
holm |
If |
hc |
If |
s2r |
If |
s2d |
If |
fs1 |
If |
fs2r |
If |
fs2d |
If |
welch |
If |
criteria |
If |
lb |
If |
gg |
If |
hf |
If |
cm |
If |
auto |
If |
mau |
If |
har |
If |
iga |
If |
ciga |
If |
eta |
If |
peta |
If |
geta |
If |
eps |
If |
peps |
If |
geps |
If |
omega |
If |
omegana |
If |
pomega |
If |
gomega |
If |
gomegana |
If |
nesci |
If |
besci |
If |
cilmd |
If |
cilm |
If |
cind |
If |
cin |
If |
ciml |
If |
cipaird |
If |
cipair |
If |
bgraph |
Names of confidence-interval options (inner and outer, up to two) for drawing a bar graph with confidence intervals. |
Value
An object of class "anovakun". Printing it (which happens
automatically when anovakun() is called at the top level) shows the
tables in the same layout as the original ANOVA-kun; assigning it, as in
res <- anovakun(...), shows nothing. The object is a list with the
elements INFORMATION, DESCRIPTIVE STATISTICS,
SPHERICITY INDICES, ANOVA TABLE, EFFECT SIZE INFORMATION
(when besci = TRUE), POST ANALYSES and DATA.FRAME (when
data.frame = TRUE), the same list as the technical output.
With tech = TRUE, the technical output is returned as a plain list (as
in the original ANOVA-kun).
With copy = TRUE, the printed tables are also written to the
clipboard. With besci = TRUE, the progress of the bootstrap is reported
by message().
Author(s)
Ryuta Iseki (author); packaged by Koji Kosugi.
References
ANOVA-kun: https://riseki.cloudfree.jp/?ANOVA%E5%90%9B
Examples
# AsBC design (example from the original ANOVA-kun documentation):
# factor A (2 levels, between) x B (2 levels, within) x C (2 levels, within)
dat <- data.frame(
A = c("a1", "a1", "a1", "a2", "a2", "a2"),
b1c1 = c(12, 13, 11, 18, 17, 15),
b1c2 = c( 9, 10, 10, 12, 14, 13),
b2c1 = c(14, 14, 13, 16, 15, 18),
b2c2 = c(13, 12, 15, 15, 14, 15)
)
anovakun(dat, "AsBC", 2, 2, 2)
# Keep the result and look at a part of it
res <- anovakun(dat, "AsBC", 2, 2, 2, peta = TRUE)
res[["ANOVA TABLE"]][[2]]
res
Run anovakun separately for each level of a factor
Description
Splits the data by the factor given in tfact and runs anovakun for each level.
Usage
anovatan(dataset, design, ..., tfact = NULL, long = FALSE, type2 = FALSE,
nopost = FALSE, tech = FALSE, data.frame = FALSE, copy = FALSE, holm = FALSE,
hc = FALSE, s2r = FALSE, s2d = FALSE, fs1 = FALSE, fs2r = FALSE, fs2d = FALSE,
welch = FALSE, criteria = FALSE, lb = FALSE, gg = FALSE, hf = FALSE,
cm = FALSE, auto = FALSE, mau = FALSE, har = FALSE, iga = FALSE, ciga = FALSE,
eta = FALSE, peta = FALSE, geta = NA, eps = FALSE, peps = FALSE, geps = NA,
omega = FALSE, omegana = FALSE, pomega = FALSE, gomega = NA, gomegana = NA,
nesci = FALSE, besci = FALSE, cilmd = FALSE, cilm = FALSE,
cind = FALSE, cin = FALSE, ciml = FALSE, cipaird = FALSE, cipair = FALSE,
bgraph = c(NA, NA))
## S3 method for class 'anovatan'
print(x, ...)
Arguments
x |
An object of class |
dataset |
A data frame. Between-subjects factors are arranged in columns at the left (one label column per factor) and within-subjects levels across columns (wide format), unless |
design |
A character string giving the design, e.g. |
... |
The numbers of levels of each factor, given in order (e.g. |
tfact |
The label of the factor by which the data are split; |
long |
If |
type2 |
If |
nopost |
If |
tech |
If |
data.frame |
If |
copy |
If |
holm |
If |
hc |
If |
s2r |
If |
s2d |
If |
fs1 |
If |
fs2r |
If |
fs2d |
If |
welch |
If |
criteria |
If |
lb |
If |
gg |
If |
hf |
If |
cm |
If |
auto |
If |
mau |
If |
har |
If |
iga |
If |
ciga |
If |
eta |
If |
peta |
If |
geta |
If |
eps |
If |
peps |
If |
geps |
If |
omega |
If |
omegana |
If |
pomega |
If |
gomega |
If |
gomegana |
If |
nesci |
If |
besci |
If |
cilmd |
If |
cilm |
If |
cind |
If |
cin |
If |
ciml |
If |
cipaird |
If |
cipair |
If |
bgraph |
Names of confidence-interval options (inner and outer, up to two) for drawing a bar graph with confidence intervals. |
Value
An object of class "anovatan": a list with results, the
"anovakun" objects for each level of the split factor(s),
removed, the number of cases removed because of missing values, and,
if data.frame = TRUE, DATA.FRAME, the split data frames.
Printing it shows the tables of each level in the same layout as the
original ANOVA-kun. With tech = TRUE, a plain list is returned
instead, holding in turn the heading of each level
("[[ Simple Effects for ... ]]") and its technical output (see
anovakun); data.frame is ignored in this case.
Author(s)
Ryuta Iseki (author); packaged by Koji Kosugi.
References
ANOVA-kun: https://riseki.cloudfree.jp/?ANOVA%E5%90%9B
See Also
Examples
# AsBC design: A (2 levels, between) x B (2 levels, within) x C (2 levels, within)
dat <- data.frame(
A = c("a1", "a1", "a1", "a2", "a2", "a2"),
b1c1 = c(12, 13, 11, 18, 17, 15),
b1c2 = c( 9, 10, 10, 12, 14, 13),
b2c1 = c(14, 14, 13, 16, 15, 18),
b2c2 = c(13, 12, 15, 15, 14, 15)
)
# Simple effects of B and C at each level of A
anovatan(dat, "AsBC", 2, 2, 2, tfact = "A")
Bar graph with confidence intervals
Description
Draws a bar graph of cell means with confidence intervals. Usually called through the bgraph option of anovakun.
Usage
ci.bars(dat, design, factnames = NA, conf.level = 0.95, inn.tier = "cind",
out.tier = NA, main = NULL, ylab = NULL, barmin = 0)
Arguments
dat |
A data frame as used inside |
design |
A character string giving the design, e.g. |
factnames |
Names of the factors. If |
conf.level |
Confidence level. |
inn.tier |
Type of the inner confidence interval (e.g. |
out.tier |
Type of the outer confidence interval, or |
main |
Main title of the plot. |
ylab |
Label of the y axis. |
barmin |
Lower end of the bars. |
Value
A bar graph is drawn on the current graphics device as a side effect.
Author(s)
Ryuta Iseki (author); packaged by Koji Kosugi.
References
ANOVA-kun: https://riseki.cloudfree.jp/?ANOVA%E5%90%9B
See Also
Examples
dat <- data.frame(
A = c("a1", "a1", "a1", "a2", "a2", "a2"),
b1c1 = c(12, 13, 11, 18, 17, 15),
b1c2 = c( 9, 10, 10, 12, 14, 13),
b2c1 = c(14, 14, 13, 16, 15, 18),
b2c2 = c(13, 12, 15, 15, 14, 15)
)
# Usually drawn through the bgraph option of anovakun()
anovakun(dat, "AsBC", 2, 2, 2, bgraph = c("cind", "cin"))
# Direct use on the long-format data that anovakun() builds internally
long <- anovakun(dat, "AsBC", 2, 2, 2, tech = TRUE, data.frame = TRUE)$DATA.FRAME
ci.bars(long, "AsBC", inn.tier = "cind", out.tier = "cin", main = "AsBC design")
Read a data table from the clipboard
Description
A wrapper of read.table that reads from the clipboard on Windows, macOS, and Linux (requires xclip on Linux).
Usage
read.clip(...)
Arguments
... |
Further arguments passed to |
Value
A data frame.
Author(s)
Ryuta Iseki (author); packaged by Koji Kosugi.
References
ANOVA-kun: https://riseki.cloudfree.jp/?ANOVA%E5%90%9B
Examples
## Not run:
# Copy a table (e.g. from a spreadsheet) to the clipboard, then:
dat <- read.clip(header = TRUE)
anovakun(dat, "AsB", 2, 3)
## End(Not run)