anofa {ANOFA}R Documentation

anofa: analysis of frequency data.

Description

The function anofa() performs an anofa of frequencies for designs with up to 4 factors according to the anofa framework. See Laurencelle and Cousineau (2023) for more.

Usage

anofa(formula = NULL, data = NULL, factors = NULL)

Arguments

formula

A formula with the factors on the left-hand side. See below for writing the formula according to the data format.

data

Dataframe in one of wide, long, raw or compiled format;

factors

For raw data formats, provide the factor names.

Details

The data can be given in four formats:

Value

a model fit to the given frequencies. The model must always be an omnibus model (for decomposition of the main model, follow the analysis with emFrequencies() or contrastFrequencies())

References

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

Examples

# Basic example using a single-factor design with the data in compiled format. 
# Ficticious data present frequency of observation classified according
# to Intensity (three levels) and Pitch (two levels) for 6 possible cells.
minimalExample

formula <- Frequency ~ Intensity * Pitch
w <- anofa(formula, minimalExample) 
summary(w)

# To know more about other ways to format the datasets, 
# see, e.g., `toRaw()`, `toLong()`, `toWide()`
w <- anofa(formula, minimalExample)
toWide(w)
# See the vignette `DataFormatsForFrequencies` for more.

# Real-data example using a two-factor design with the data in compiled format:
LandisBarrettGalvin2013

w <- anofa( obsfreq ~ program * provider, LandisBarrettGalvin2013 )
summary(w)

# You can ask easier outputs
w <- anofa(formula, minimalExample)
summarize(w) # or summary(w) for the ANOFA table
explain(w)   # human-readable ouptut


[Package ANOFA version 0.1.3 Index]