MyNixOS website logo
Description

APA 7th Edition Statistical Tables, Plots, and Multilevel Model Reports.

Produces publication-ready statistical tables and figures formatted according to the 7th edition of the American Psychological Association (APA) style guidelines. Supports descriptive statistics, t-tests, z-tests, chi-square tests, Analysis of Variance (ANOVA), Analysis of Covariance (ANCOVA), two-way ANOVA with simple effects, Multivariate Analysis of Variance (MANOVA), robust and cluster-robust regression using Heteroscedasticity-Consistent (HC) standard errors, post-hoc pairwise comparisons, homoskedasticity and heteroscedasticity diagnostics including the Non-Constant Variance (NCV) test, proportion tests, and multilevel mixed-effects models with intraclass correlation coefficients (ICC) and model-comparison tables. Output can be directed to the console, Microsoft Word (via 'officer' and 'flextable'), or LaTeX. For APA style guidelines see American Psychological Association (2020, ISBN:978-1-4338-3216-1).

statAPA

CRAN status R-CMD-check License: MIT

statAPA produces publication-ready statistical tables and figures formatted according to the 7th edition of the American Psychological Association (APA) style guidelines. Output can be directed to the R console, Microsoft Word (via officer + flextable), or LaTeX.


Installation

Install the released version from CRAN:

install.packages("statAPA")

Or the development version from GitHub:

# install.packages("remotes")
remotes::install_github("causalfragility-lab/statAPA")

Functions at a glance

FunctionWhat it does
apa_descriptives()Descriptive statistics table (optionally by group)
apa_t_test()One-sample, two-sample (Welch/pooled), and paired t-tests
apa_z_test_mean()z-test with known population standard deviation(s)
apa_chisq()Chi-square test (goodness-of-fit or independence)
apa_prop_test()Proportion test with risk difference, risk ratio, odds ratio
apa_anova()One-way ANOVA/ANCOVA (Type II/III) with effect sizes
apa_ancova()ANCOVA with covariate validation and adjusted means
apa_twoway_anova()Two-way ANOVA with interaction and simple effects
apa_manova()MANOVA (Pillai, Wilks, Hotelling-Lawley, Roy)
apa_posthoc()Post-hoc pairwise comparisons (emmeans)
apa_table()Regression / multilevel coefficient table
apa_robust()Robust regression (HC or cluster-robust SEs)
apa_hetero()Heteroscedasticity diagnostics
apa_homoskedasticity()Homoskedasticity check (Breusch-Pagan, White, Levene)
apa_multilevel()Multilevel models: fixed/random effects, ICC, R², model comparison
apa_plot_descriptives()Mean ± 95% CI plot by group
apa_plot_regression()Fitted-line plot with confidence ribbon
apa_plot_anova()Estimated marginal means plot
apa_plot_residuals()Residual diagnostic plots
apa_to_flextable()Convert any result to an APA-styled flextable
save_apa()Save a ggplot figure at 300 dpi with APA dimensions
theme_apa()APA-style ggplot2 theme

Quick example

library(statAPA)

# Descriptive statistics
apa_descriptives(mtcars, vars = c("mpg", "wt", "hp"), group = "cyl")

# t-test
apa_t_test(mtcars$mpg[mtcars$am == 0],
           mtcars$mpg[mtcars$am == 1],
           output = "console")

# Two-way ANOVA with simple effects
mtcars2 <- transform(mtcars, cyl = factor(cyl), gear = factor(gear))
apa_twoway_anova(mpg ~ cyl * gear, data = mtcars2,
                 factorA = "cyl", factorB = "gear")

# MANOVA
apa_manova(cbind(Sepal.Length, Petal.Length) ~ Species, data = iris)

# Multilevel model
library(lme4)
data(ECLS_demo)
m0 <- lmer(math ~ 1 + (1 | schid), data = ECLS_demo, REML = FALSE)
m1 <- lmer(math ~ SES + (1 | schid), data = ECLS_demo, REML = FALSE)
apa_multilevel(m0, m1, model_names = c("Null", "+ SES"))

# Export to Word
fit <- lm(mpg ~ wt + hp, data = mtcars)
apa_table(fit, output = "word", file = "regression_table.docx")

Citation

If you use statAPA in published research, please cite: Hait, S. (2026). statAPA: APA 7th Edition Statistical Tables, Plots, and Multilevel Model Reports. R package version 0.1.0. https://CRAN.R-project.org/package=statAPA

License

MIT © 2026 Subir Hait.

Metadata

Version

0.1.0

License

Unknown

Platforms (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • 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-linux
  • 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
  • sh4-linux
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows