MyNixOS website logo
Description

Analyses of Frequency Data.

Analyses of frequencies can be performed using an alternative test based on the G statistic. The test has similar type-I error rates and power as the chi-square test. However, it is based on a total statistic that can be decomposed in an additive fashion into interaction effects, main effects, simple effects, contrast effects, etc., mimicking precisely the logic of ANOVA. We call this set of tools 'ANOFA' (Analysis of Frequency data) to highlight its similarities with ANOVA. This framework also renders plots of frequencies along with confidence intervals. Finally, effect sizes and planning statistical power are easily done under this framework. The ANOFA is a tool that assesses the significance of effects instead of the significance of parameters; as such, it is more intuitive to most researchers than alternative approaches based on generalized linear models. See Laurencelle and Cousineau (2023) <doi:10.20982/tqmp.19.2.p173>.

ANOFA: Analyses of Frequency Data

CRANStatus

The library ANOFA provides easy-to-use tools to analyze frequency data. It does so using the Analysis of Frequency datA (ANOFA) framework (the full reference Laurencelle & Cousineau, 2023). With this set of tools, you can examined if classification factors are non-equal (have an effect) and if their interactions (in case you have more than 1 factor) are significant. You can also examine simple effects (a.k.a. expected marginal analyses). Finally, you can assess differences based on orthogonal contrasts. ANOFA also comes with tools to make a plot of the frequencies along with 95% confidence intervals (these intervals are adjusted for pair- wise comparisons Cousineau, Goulet, & Harding, 2021); with tools to compute statistical power given some a priori expected frequencies or sample size to reach a certain statistical power. In sum, eveything you need to analyse frequencies!

The main function is anofa() which provide an omnibus analysis of the frequencies for the factors given. For example, Light & Margolin (1971) explore frequencies for attending a certain type of higher education as a function of gender:

w <- anofa( obsfreq ~ vocation * gender, LightMargolin1971)
summary(w)
##                       G df Gcorrected pvalue    etasq
## Total           266.889  9         NA     NA       NA
## vocation        215.016  4    214.668 0.0000 0.258428
## gender            1.986  1      1.985 0.1589 0.003209
## vocation:gender  49.887  4     49.555 0.0000 0.301949

A plot of the frequencies can be obtained easily with

anofaPlot(w) 

Owing to the interaction, simple effects can be analyzed from the expected marginal frequencies with

e <- emFrequencies(w, ~ gender | vocation )
summary(e)
##                            G df Gcorrected pvalue    etasq
## gender | Secondary   0.00813  1   0.008124 1.0000 0.000066
## gender | Vocational  2.90893  1   2.906575 0.5736 0.010659
## gender | Teacher     3.38684  1   3.384098 0.4957 0.048118
## gender | Gymnasium   3.22145  1   3.218840 0.5219 0.057299
## gender | University 42.34782  1  42.313530 0.0000 0.289364

Follow-up functions includes contrasts examinations with `contrastFrequencies()’.

Power planning can be performed on frequencies using anofaPower2N() or anofaN2Power if you can determine theoretical frequencies.

Finally, toRaw(), toCompiled(), toTabulated(), toLong() and toWide() can be used to present the frequency data in other formats.

Installation

Note that the package is named using UPPERCASE letters whereas the main function is in lowercase letters.

The official CRAN version can be installed with

install.packages("ANOFA")
library(ANOFA)

The development version 0.1.3 can be accessed through GitHub:

devtools::install_github("dcousin3/ANOFA")
library(ANOFA)

The library is loaded with

library(ANOFA)

For more

As seen, the library ANOFA makes it easy to analyze frequency data. Its general philosophy is that of ANOFAs.

The complete documentation is available on this site.

A general introduction to the ANOFA framework underlying this library can be found at the Quantitative Methods for Psychology Laurencelle & Cousineau (2023).

References

Cousineau, D., Goulet, M.-A., & Harding, B. (2021). Summary plots with adjusted error bars: The superb framework with an implementation in R. Advances in Methods and Practices in Psychological Science, 4, 1–18. https://doi.org/10.1177/25152459211035109

Laurencelle, L., & Cousineau, D. (2023). Analysis of frequency tables: The ANOFA framework. The Quantitative Methods for Psychology, 19, 173–193. https://doi.org/10.20982/tqmp.19.2.p173

Light, R. J., & Margolin, B. H. (1971). An analysis of variance for categorical data. Journal of the American Statistical Association, 66, 534–544. https://doi.org/10.1080/01621459.1971.10482297

Metadata

Version

0.1.3

License

Unknown

Platforms (75)

    Darwin
    FreeBSD 13
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd13
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd13
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows