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.
井関龍太氏による分散分析関数「ANOVA君」(anovakun)を,R パッケージとしてインストールできる形にまとめるためのリポジトリです。
分析の計算そのものは本家の ANOVA君に手を加えず,パッケージの体裁を整えることだけを行います。出力は本家と数値が一致することを確かめてから公開します。
# install.packages("remotes")
remotes::install_github("kosugitti/anovakun")
library(anovakun)
本家と同じです。たとえば AsBC 計画(A が被験者間,B と C が被験者内)なら次のとおりです。
anovakun(dat, "AsBC", 2, 2, 2)
オプションの一覧は ?anovakun か,本家のページを参照してください。
本家との違いは,結果をオブジェクトとして返すことです。そのまま呼べば本家と同じ表が表示され,代入すれば表示せずに結果を取っておけます。
res <- anovakun(dat, "AsBC", 2, 2, 2, peta = TRUE) # 何も表示されない
res # 本家と同じ表
res[["ANOVA TABLE"]] # 分散分析表の部分(tech = TRUE と同じリスト)
パッケージ版 1.1.0 は本家 4.9.0 を収めています。本家の原本は inst/original/ に置き,本家の関数とパッケージ版が同じデータ・同じ指定で同じ結果を返すことをテスト(tests/testthat/)で確かめています。本家からの変更点(いずれも計算結果には影響しません)は NEWS.md に一覧があります。本家の次の版が公開されたら差し替えます(本家ページを週1回自動で確認し,新版があれば Issue を立てます)。
CRAN への登録を準備中です。
dput() の出力),anovakun() の呼び出し,sessionInfo() の出力を添えていただけると助かります。Questions are welcome in Discussions and bug reports in Issues, in English or Japanese.
本家の利用条件では,改変版はメインの関数名を変えることになっていますが,作者の井関氏から,分析関数の仕様を変えない限り anovakun の名前のままでよいとの了承を得ています(2026年10月)。ライセンスは MIT です(同じく了承済み)。