A wrapper for anovakun (version 4.8.9) with improved usability and formatting
Source:R/anovakun_tidy.r
anovakun_tidy.RdThis function serves as a wrapper around anovakun_ (version 4.8.9),
streamlining common usage patterns in mutolab and formatting the results for easier interpretation.
Arguments
- dataset
A data frame containing the input data in long (tidy) format.
- design
A character string specifying the experimental design (e.g., "As", "ABs", "sA", "sAB", "AsB", etc.).
- alpha
Significance level. Defaults to 0.05.
- inc_allvar
Logical. If
TRUE, all columns will be included in the output. Defaults toFALSE.- do_round
Logical. If
TRUE, numeric values in the output will be rounded for readability. Defaults toTRUE.- ...
Additional arguments passed to
anovakun_. The number of levels for each factor is automatically calculated fromdatasetanddesign, and does not need to be specified manually.
Value
A data frame containing the results of ANOVA, including F-statistics, p-values, effect sizes, and sphericity indices (if applicable).
Details
While the core computation is delegated to the original anovakun function, this wrapper
automatically infers the number of factor levels, simplifies output, and adds formatting options such as rounding.
For full details of the original implementation of anovakun, refer to: https://riseki.cloudfree.jp/?ANOVA%E5%90%9B
See also
anovakun_ for the original function wrapped by this helper.
Examples
data_snakemr %>%
anovakun_tidy("sABC")
#> A 2*2*5 within-participants ANOVA was performed.
#> effect df1 df2 F p sig eta2 peta2 cohens_f epsilon_CM
#> 1 shape 1.00 23.00 37.31 0.000 * 0.019 0.619 1.274 1.000
#> 2 face 1.00 23.00 98.23 0.000 * 0.025 0.810 2.067 1.000
#> 3 angle 1.60 36.83 201.16 0.000 * 0.458 0.897 2.957 0.400
#> 4 shape:face 1.00 23.00 9.72 0.005 * 0.003 0.297 0.650 1.000
#> 5 shape:angle 3.45 79.26 6.91 0.000 * 0.003 0.231 0.548 0.861
#> 6 face:angle 4.00 92.00 3.87 0.006 * 0.002 0.144 0.410 1.000
#> 7 shape:face:angle 4.00 92.00 1.37 0.249 ns 0.001 0.056 0.244 1.000