Learn R Programming

snazzieR (version 0.1.2)

ANOVA.summary.table: Generate a Summary Table for ANOVA Results

Description

This function creates a summary table for ANOVA results, including degrees of freedom, sum of squares, mean squares, F-values, and p-values. The table can be output as either LaTeX (for PDF reports) or plain text (for console viewing).

Usage

ANOVA.summary.table(model, caption, latex = TRUE)

Value

If `latex = TRUE`, a LaTeX-formatted table object. If `latex = FALSE`, prints the summary table and returns it (invisibly).

Arguments

model

A model object for which ANOVA results are computed (e.g., output from `lm()` or `aov()`).

caption

A character string to be used as the caption for the table.

latex

Logical; if `TRUE`, returns a LaTeX-formatted table using `kableExtra`. If `FALSE`, prints a plain-text version to the console.

Examples

Run this code
# Fit a linear model
model <- lm(mpg ~ wt + hp, data = mtcars)

# Generate a plain-text ANOVA summary table
ANOVA.summary.table(model, caption = "ANOVA Summary", latex = FALSE)

Run the code above in your browser using DataLab