Skip to contents

The apa function provides a convenient way to format statistical results according to American Psychological Association (APA) style guidelines. It dispatches to various S3 methods depending on the class of the input object.

Usage

apa(obj, ...)

Arguments

obj

An object to format in APA style

...

Additional arguments passed to specific methods

Value

The result of the method for obj: usually a character vector of APA-formatted statistical results. Regression methods can return a data.frame of coefficient summaries, and ANOVA methods can return a data.frame with formatted text appended when requested. See each method's documentation for its columns and selection options.

Details

This function supports various statistical objects directly:

In addition, there are standalone utility functions for formatting:

Examples

# t-test example
t_res <- t.test(rnorm(30), rnorm(30, 0.5))
apa(t_res)
#> [1] "_t_(51.1) = -3.32, _p_ = .002"

# Correlation example
cor_res <- cor.test(mtcars$mpg, mtcars$wt)
apa(cor_res)
#> [1] "_r_(30) = -0.87, _p_ < .001"