Skip to contents

This function performs analysis of variance (ANOVA) based on the anovakun version 4.8.9, originally developed by Prof. Ryuta Iseki (Taisho University, Japan).

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,
  prep = FALSE,
  nesci = FALSE,
  besci = FALSE,
  cilmd = FALSE,
  cilm = FALSE,
  cind = FALSE,
  cin = FALSE,
  ciml = FALSE,
  cipaird = FALSE,
  cipair = FALSE,
  bgraph = c(NA, NA)
)

Arguments

dataset

A data frame containing the input data.

design

A character string specifying the experimental design (e.g., "As", "ABs", "sA", "sAB", "AsB", etc.).

...

Numbers of levels of each factor.

long

Logical. Whether the data is in long format.

type2

Logical. Whether to use Type II sums of squares (default is FALSE for Type III).

nopost

Logical. If TRUE, skips post hoc tests.

tech

Logical. If TRUE, returns raw lists of results instead of printing.

data.frame

Logical. If TRUE, returns the reformatted data frame.

copy

Logical. If TRUE, copies the output to the clipboard.

holm, ..., bgraph

Additional flags controlling specific analyses (see documentation).

Value

Depending on the arguments, either printed output or a list of ANOVA results.

Details

In this implementation, the code of anovakun version 4.8.9 has been included as-is with no modification to its computational logic or output. However, for the purpose of maintainability and modularity, internal helper functions have been separated into a different file.

Additionally, all original Japanese-language comments have been removed from the source code to maintain stylistic consistency with this package and to simplify documentation.

Redistribution and minor modifications of the original function are permitted under the terms indicated by the original author, provided that such modifications are clearly stated. This implementation complies with that policy.

For methodological details and rationale, please refer to the original documentation of anovakun version 4.8.9.

See also

The original documentation for anovakun by Prof. Ryuta Iseki is available at: https://riseki.cloudfree.jp/?ANOVA%E5%90%9B

Examples


 data_snakemr %>%
   anovakun_("sABC", 2, 2, 5, long = TRUE)
#> 
#> [ sABC-Type Design ]
#> 
#> This output was generated by anovakun 4.8.9 under R version 4.3.2.
#> It was executed on Fri Jan 16 22:14:16 2026.
#> 
#>  
#> << DESCRIPTIVE STATISTICS >>
#> 
#> ---------------------------------------------
#>  shape     face  angle   n    Mean    S.D. 
#> ---------------------------------------------
#>  human   absent      0  24  0.8909  0.2040 
#>  human   absent     40  24  1.0862  0.2460 
#>  human   absent     80  24  1.2410  0.2888 
#>  human   absent    120  24  1.4275  0.3710 
#>  human   absent    160  24  1.7042  0.4039 
#>  human  present      0  24  0.8332  0.1365 
#>  human  present     40  24  0.9645  0.1900 
#>  human  present     80  24  1.1502  0.2581 
#>  human  present    120  24  1.3415  0.2987 
#>  human  present    160  24  1.5974  0.3769 
#> 
#>  snake   absent      0  24  0.9350  0.2213 
#>  snake   absent     40  24  1.2910  0.3269 
#>  snake   absent     80  24  1.4150  0.3240 
#>  snake   absent    120  24  1.6560  0.3528 
#>  snake   absent    160  24  1.8818  0.4148 
#>  snake  present      0  24  0.8433  0.1953 
#>  snake  present     40  24  1.0460  0.2530 
#>  snake  present     80  24  1.2166  0.3247 
#>  snake  present    120  24  1.4268  0.3808 
#>  snake  present    160  24  1.7307  0.4217 
#> ---------------------------------------------
#> 
#> 
#> << SPHERICITY INDICES >>
#> 
#> == Mendoza's Multisample Sphericity Test and Epsilons ==
#> 
#> --------------------------------------------------------------------------------------
#>               Effect  Lambda  approx.Chi  df      p         LB     GG     HF     CM 
#> --------------------------------------------------------------------------------------
#>               Global  0.0000    427.6417 189 0.0000 *** 0.0526 0.2017 0.2470 0.2416 
#>                shape  1.0000     -0.0000   0            1.0000 1.0000 1.0000 1.0000 
#>                 face  1.0000     -0.0000   0            1.0000 1.0000 1.0000 1.0000 
#>                angle  0.0000     67.1279   9 0.0000 *** 0.2500 0.3866 0.4092 0.4003 
#>         shape x face  1.0000     -0.0000   0            1.0000 1.0000 1.0000 1.0000 
#>        shape x angle  0.0001     18.2129   9 0.0333 *   0.2500 0.7541 0.8806 0.8615 
#>         face x angle  0.0294      6.5699   9 0.6828 ns  0.2500 0.8558 1.0236 1.0014 
#> shape x face x angle  0.1462      3.5802   9 0.9370 ns  0.2500 0.9195 1.1163 1.0921 
#> --------------------------------------------------------------------------------------
#>                                            LB = lower.bound, GG = Greenhouse-Geisser
#>                                           HF = Huynh-Feldt-Lecoutre, CM = Chi-Muller
#> 
#> 
#> << ANOVA TABLE >>
#> 
#> --------------------------------------------------------------------------
#>                    Source       SS  df       MS   F-ratio  p-value      
#> --------------------------------------------------------------------------
#>                         s  34.5516  23   1.5022                         
#> --------------------------------------------------------------------------
#>                     shape   1.7442   1   1.7442   37.3117   0.0000 ***  
#>                 s x shape   1.0752  23   0.0467                         
#> --------------------------------------------------------------------------
#>                      face   2.2803   1   2.2803   98.2323   0.0000 ***  
#>                  s x face   0.5339  23   0.0232                         
#> --------------------------------------------------------------------------
#>                     angle  41.4920   4  10.3730  201.1569   0.0000 ***  
#>                 s x angle   4.7441  92   0.0516                         
#> --------------------------------------------------------------------------
#>              shape x face   0.2457   1   0.2457    9.7189   0.0048 **   
#>          s x shape x face   0.5816  23   0.0253                         
#> --------------------------------------------------------------------------
#>             shape x angle   0.2827   4   0.0707    6.9114   0.0001 ***  
#>         s x shape x angle   0.9408  92   0.0102                         
#> --------------------------------------------------------------------------
#>              face x angle   0.1578   4   0.0394    3.8702   0.0060 **   
#>          s x face x angle   0.9376  92   0.0102                         
#> --------------------------------------------------------------------------
#>      shape x face x angle   0.0567   4   0.0142    1.3736   0.2492 ns   
#>  s x shape x face x angle   0.9488  92   0.0103                         
#> --------------------------------------------------------------------------
#>                     Total  90.5731 479   0.1891                         
#>                               +p < .10, *p < .05, **p < .01, ***p < .001
#> 
#> 
#> << POST ANALYSES >>
#> 
#> < MULTIPLE COMPARISON for "angle" >
#> 
#> == Shaffer's Modified Sequentially Rejective Bonferroni Procedure ==
#> == The factor < angle > is analysed as dependent means. == 
#> == Alpha level is 0.05. == 
#>  
#> -----------------------------
#>  angle   n    Mean    S.D. 
#> -----------------------------
#>      0  96  0.8756  0.1932 
#>     40  96  1.0969  0.2818 
#>     80  96  1.2557  0.3113 
#>    120  96  1.4630  0.3660 
#>    160  96  1.7285  0.4111 
#> -----------------------------
#> 
#> --------------------------------------------------------------
#>     Pair     Diff  t-value  df       p   adj.p              
#> --------------------------------------------------------------
#>   80-160  -0.4728  17.7531  23  0.0000  0.0000   80 < 160 * 
#>   40-160  -0.6316  16.3023  23  0.0000  0.0000   40 < 160 * 
#>    0-160  -0.8529  15.6908  23  0.0000  0.0000    0 < 160 * 
#>   40-120  -0.3660  14.6521  23  0.0000  0.0000   40 < 120 * 
#>    0-120  -0.5873  13.7817  23  0.0000  0.0000    0 < 120 * 
#>  120-160  -0.2656  11.4339  23  0.0000  0.0000  120 < 160 * 
#>   80-120  -0.2072  10.7847  23  0.0000  0.0000   80 < 120 * 
#>     0-80  -0.3801  10.6498  23  0.0000  0.0000     0 < 80 * 
#>     0-40  -0.2213   8.8435  23  0.0000  0.0000     0 < 40 * 
#>    40-80  -0.1588   8.7577  23  0.0000  0.0000    40 < 80 * 
#> --------------------------------------------------------------
#> 
#> 
#> < SIMPLE EFFECTS for "shape x face" INTERACTION >
#> 
#> --------------------------------------
#>  shape     face   n    Mean    S.D. 
#> --------------------------------------
#>  human   absent 120  1.2700  0.4159 
#>  human  present 120  1.1774  0.3773 
#>  snake   absent 120  1.4358  0.4610 
#>  snake  present 120  1.2527  0.4443 
#> --------------------------------------
#> 
#> --------------------------------------------------------------------------------
#>            Effect  Lambda  approx.Chi  df   p         LB     GG     HF     CM 
#> --------------------------------------------------------------------------------
#>   shape at absent  1.0000     -0.0000   0         1.0000 1.0000 1.0000 1.0000 
#>  shape at present  1.0000     -0.0000   0         1.0000 1.0000 1.0000 1.0000 
#>     face at human  1.0000     -0.0000   0         1.0000 1.0000 1.0000 1.0000 
#>     face at snake  1.0000     -0.0000   0         1.0000 1.0000 1.0000 1.0000 
#> --------------------------------------------------------------------------------
#>                                      LB = lower.bound, GG = Greenhouse-Geisser
#>                                     HF = Huynh-Feldt-Lecoutre, CM = Chi-Muller
#> 
#> --------------------------------------------------------------------
#>                Source      SS  df      MS   F-ratio  p-value      
#> --------------------------------------------------------------------
#>       shape at absent  1.6497   1  1.6497   67.7233   0.0000 ***  
#>   s x shape at absent  0.5603  23  0.0244                         
#> --------------------------------------------------------------------
#>      shape at present  0.3403   1  0.3403    7.1376   0.0136 *    
#>  s x shape at present  1.0965  23  0.0477                         
#> --------------------------------------------------------------------
#>         face at human  0.5144   1  0.5144   17.0083   0.0004 ***  
#>     s x face at human  0.6957  23  0.0302                         
#> --------------------------------------------------------------------
#>         face at snake  2.0116   1  2.0116  110.2117   0.0000 ***  
#>     s x face at snake  0.4198  23  0.0183                         
#> --------------------------------------------------------------------
#>                         +p < .10, *p < .05, **p < .01, ***p < .001
#> 
#> < SIMPLE EFFECTS for "shape x angle" INTERACTION >
#> 
#> ------------------------------------
#>  shape  angle   n    Mean    S.D. 
#> ------------------------------------
#>  human      0  48  0.8621  0.1741 
#>  human     40  48  1.0254  0.2260 
#>  human     80  48  1.1956  0.2748 
#>  human    120  48  1.3845  0.3360 
#>  human    160  48  1.6508  0.3902 
#>  snake      0  48  0.8892  0.2116 
#>  snake     40  48  1.1685  0.3146 
#>  snake     80  48  1.3158  0.3362 
#>  snake    120  48  1.5414  0.3812 
#>  snake    160  48  1.8062  0.4208 
#> ------------------------------------
#> 
#> ---------------------------------------------------------------------------------
#>          Effect  Lambda  approx.Chi  df      p         LB     GG     HF     CM 
#> ---------------------------------------------------------------------------------
#>      shape at 0  1.0000     -0.0000   0            1.0000 1.0000 1.0000 1.0000 
#>     shape at 40  1.0000     -0.0000   0            1.0000 1.0000 1.0000 1.0000 
#>     shape at 80  1.0000     -0.0000   0            1.0000 1.0000 1.0000 1.0000 
#>    shape at 120  1.0000     -0.0000   0            1.0000 1.0000 1.0000 1.0000 
#>    shape at 160  1.0000     -0.0000   0            1.0000 1.0000 1.0000 1.0000 
#>  angle at human  0.0000     57.2646   9 0.0000 *** 0.2500 0.4415 0.4755 0.4652 
#>  angle at snake  0.0000     54.4022   9 0.0000 *** 0.2500 0.4211 0.4506 0.4409 
#> ---------------------------------------------------------------------------------
#>                                       LB = lower.bound, GG = Greenhouse-Geisser
#>                                      HF = Huynh-Feldt-Lecoutre, CM = Chi-Muller
#> 
#> -------------------------------------------------------------------
#>              Source       SS  df      MS   F-ratio  p-value      
#> -------------------------------------------------------------------
#>          shape at 0   0.0177   1  0.0177    2.9972   0.0968 +    
#>      s x shape at 0   0.1355  23  0.0059                         
#> -------------------------------------------------------------------
#>         shape at 40   0.4917   1  0.4917   35.0968   0.0000 ***  
#>     s x shape at 40   0.3222  23  0.0140                         
#> -------------------------------------------------------------------
#>         shape at 80   0.3467   1  0.3467   24.8161   0.0000 ***  
#>     s x shape at 80   0.3213  23  0.0140                         
#> -------------------------------------------------------------------
#>        shape at 120   0.5911   1  0.5911   27.1479   0.0000 ***  
#>    s x shape at 120   0.5007  23  0.0218                         
#> -------------------------------------------------------------------
#>        shape at 160   0.5798   1  0.5798   18.1126   0.0003 ***  
#>    s x shape at 160   0.7362  23  0.0320                         
#> -------------------------------------------------------------------
#>      angle at human  18.2016   4  4.5504  155.5901   0.0000 ***  
#>  s x angle at human   2.6906  92  0.0292                         
#> -------------------------------------------------------------------
#>      angle at snake  23.5732   4  5.8933  181.0704   0.0000 ***  
#>  s x angle at snake   2.9943  92  0.0325                         
#> -------------------------------------------------------------------
#>                        +p < .10, *p < .05, **p < .01, ***p < .001
#> 
#> 
#> < MULTIPLE COMPARISON for "angle at human" >
#> 
#> == Shaffer's Modified Sequentially Rejective Bonferroni Procedure ==
#> == The factor < angle at human > is analysed as dependent means. == 
#> == Alpha level is 0.05. == 
#>  
#> --------------------------------------------------------------
#>     Pair     Diff  t-value  df       p   adj.p              
#> --------------------------------------------------------------
#>    0-160  -0.7888  14.4987  23  0.0000  0.0000    0 < 160 * 
#>   80-160  -0.4552  13.9691  23  0.0000  0.0000   80 < 160 * 
#>   40-160  -0.6255  13.6709  23  0.0000  0.0000   40 < 160 * 
#>    0-120  -0.5224  12.3736  23  0.0000  0.0000    0 < 120 * 
#>   40-120  -0.3591  11.2590  23  0.0000  0.0000   40 < 120 * 
#>     0-80  -0.3336  10.5190  23  0.0000  0.0000     0 < 80 * 
#>   80-120  -0.1889   9.0888  23  0.0000  0.0000   80 < 120 * 
#>    40-80  -0.1703   8.8257  23  0.0000  0.0000    40 < 80 * 
#>  120-160  -0.2663   8.4701  23  0.0000  0.0000  120 < 160 * 
#>     0-40  -0.1633   7.5100  23  0.0000  0.0000     0 < 40 * 
#> --------------------------------------------------------------
#> 
#> 
#> < MULTIPLE COMPARISON for "angle at snake" >
#> 
#> == Shaffer's Modified Sequentially Rejective Bonferroni Procedure ==
#> == The factor < angle at snake > is analysed as dependent means. == 
#> == Alpha level is 0.05. == 
#>  
#> --------------------------------------------------------------
#>     Pair     Diff  t-value  df       p   adj.p              
#> --------------------------------------------------------------
#>   80-160  -0.4904  17.1014  23  0.0000  0.0000   80 < 160 * 
#>   40-160  -0.6377  16.7296  23  0.0000  0.0000   40 < 160 * 
#>    0-160  -0.9171  15.3224  23  0.0000  0.0000    0 < 160 * 
#>   40-120  -0.3729  14.9307  23  0.0000  0.0000   40 < 120 * 
#>    0-120  -0.6522  13.0827  23  0.0000  0.0000    0 < 120 * 
#>  120-160  -0.2648  10.5039  23  0.0000  0.0000  120 < 160 * 
#>     0-80  -0.4266   9.8567  23  0.0000  0.0000     0 < 80 * 
#>   80-120  -0.2256   9.7885  23  0.0000  0.0000   80 < 120 * 
#>     0-40  -0.2793   8.4577  23  0.0000  0.0000     0 < 40 * 
#>    40-80  -0.1473   6.8479  23  0.0000  0.0000    40 < 80 * 
#> --------------------------------------------------------------
#> 
#> < SIMPLE EFFECTS for "face x angle" INTERACTION >
#> 
#> --------------------------------------
#>     face  angle   n    Mean    S.D. 
#> --------------------------------------
#>   absent      0  48  0.9130  0.2117 
#>   absent     40  48  1.1886  0.3043 
#>   absent     80  48  1.3280  0.3161 
#>   absent    120  48  1.5418  0.3763 
#>   absent    160  48  1.7930  0.4148 
#>  present      0  48  0.8383  0.1667 
#>  present     40  48  1.0053  0.2252 
#>  present     80  48  1.1834  0.2921 
#>  present    120  48  1.3841  0.3413 
#>  present    160  48  1.6640  0.4013 
#> --------------------------------------
#> 
#> -----------------------------------------------------------------------------------
#>            Effect  Lambda  approx.Chi  df      p         LB     GG     HF     CM 
#> -----------------------------------------------------------------------------------
#>         face at 0  1.0000     -0.0000   0            1.0000 1.0000 1.0000 1.0000 
#>        face at 40  1.0000     -0.0000   0            1.0000 1.0000 1.0000 1.0000 
#>        face at 80  1.0000     -0.0000   0            1.0000 1.0000 1.0000 1.0000 
#>       face at 120  1.0000     -0.0000   0            1.0000 1.0000 1.0000 1.0000 
#>       face at 160  1.0000     -0.0000   0            1.0000 1.0000 1.0000 1.0000 
#>   angle at absent  0.0000     34.2839   9 0.0001 *** 0.2500 0.5152 0.5666 0.5543 
#>  angle at present  0.0000     61.8081   9 0.0000 *** 0.2500 0.4009 0.4263 0.4170 
#> -----------------------------------------------------------------------------------
#>                                         LB = lower.bound, GG = Greenhouse-Geisser
#>                                        HF = Huynh-Feldt-Lecoutre, CM = Chi-Muller
#> 
#> ---------------------------------------------------------------------
#>                Source       SS  df      MS   F-ratio  p-value      
#> ---------------------------------------------------------------------
#>             face at 0   0.1339   1  0.1339   25.2253   0.0000 ***  
#>         s x face at 0   0.1221  23  0.0053                         
#> ---------------------------------------------------------------------
#>            face at 40   0.8069   1  0.8069   44.6931   0.0000 ***  
#>        s x face at 40   0.4152  23  0.0181                         
#> ---------------------------------------------------------------------
#>            face at 80   0.5017   1  0.5017   41.7537   0.0000 ***  
#>        s x face at 80   0.2764  23  0.0120                         
#> ---------------------------------------------------------------------
#>           face at 120   0.5963   1  0.5963   39.8364   0.0000 ***  
#>       s x face at 120   0.3443  23  0.0150                         
#> ---------------------------------------------------------------------
#>           face at 160   0.3993   1  0.3993   29.2877   0.0000 ***  
#>       s x face at 160   0.3135  23  0.0136                         
#> ---------------------------------------------------------------------
#>       angle at absent  21.6257   4  5.4064  171.1057   0.0000 ***  
#>   s x angle at absent   2.9069  92  0.0316                         
#> ---------------------------------------------------------------------
#>      angle at present  20.0241   4  5.0060  165.9741   0.0000 ***  
#>  s x angle at present   2.7749  92  0.0302                         
#> ---------------------------------------------------------------------
#>                          +p < .10, *p < .05, **p < .01, ***p < .001
#> 
#> 
#> < MULTIPLE COMPARISON for "angle at absent" >
#> 
#> == Shaffer's Modified Sequentially Rejective Bonferroni Procedure ==
#> == The factor < angle at absent > is analysed as dependent means. == 
#> == Alpha level is 0.05. == 
#>  
#> --------------------------------------------------------------
#>     Pair     Diff  t-value  df       p   adj.p              
#> --------------------------------------------------------------
#>   40-160  -0.6044  16.2689  23  0.0000  0.0000   40 < 160 * 
#>    0-160  -0.8801  15.4199  23  0.0000  0.0000    0 < 160 * 
#>   80-160  -0.4650  14.5773  23  0.0000  0.0000   80 < 160 * 
#>    0-120  -0.6288  13.9024  23  0.0000  0.0000    0 < 120 * 
#>   40-120  -0.3532  12.9035  23  0.0000  0.0000   40 < 120 * 
#>     0-80  -0.4150  10.4741  23  0.0000  0.0000     0 < 80 * 
#>  120-160  -0.2513   9.4778  23  0.0000  0.0000  120 < 160 * 
#>   80-120  -0.2138   8.3919  23  0.0000  0.0000   80 < 120 * 
#>     0-40  -0.2756   7.4953  23  0.0000  0.0000     0 < 40 * 
#>    40-80  -0.1394   6.6371  23  0.0000  0.0000    40 < 80 * 
#> --------------------------------------------------------------
#> 
#> 
#> < MULTIPLE COMPARISON for "angle at present" >
#> 
#> == Shaffer's Modified Sequentially Rejective Bonferroni Procedure ==
#> == The factor < angle at present > is analysed as dependent means. == 
#> == Alpha level is 0.05. == 
#>  
#> --------------------------------------------------------------
#>     Pair     Diff  t-value  df       p   adj.p              
#> --------------------------------------------------------------
#>   80-160  -0.4806  17.8211  23  0.0000  0.0000   80 < 160 * 
#>    0-160  -0.8258  14.9215  23  0.0000  0.0000    0 < 160 * 
#>   40-160  -0.6588  14.7136  23  0.0000  0.0000   40 < 160 * 
#>    0-120  -0.5459  12.1325  23  0.0000  0.0000    0 < 120 * 
#>   40-120  -0.3789  11.0116  23  0.0000  0.0000   40 < 120 * 
#>  120-160  -0.2799   9.8885  23  0.0000  0.0000  120 < 160 * 
#>     0-80  -0.3452   9.6747  23  0.0000  0.0000     0 < 80 * 
#>   80-120  -0.2007   9.6236  23  0.0000  0.0000   80 < 120 * 
#>     0-40  -0.1670   8.7929  23  0.0000  0.0000     0 < 40 * 
#>    40-80  -0.1782   6.7604  23  0.0000  0.0000    40 < 80 * 
#> --------------------------------------------------------------
#> 
#> output is over --------------------///
#>