Skip to contents

Uses stats::anova for sequential (Type-I) tests, or car::Anova for Type-II/III if car is installed.

Usage

anova_table(
  model,
  typ = 2L,
  digits = 3L,
  output_format = "dataframe",
  title = "ANOVA Table"
)

Arguments

model

An lm/aov/glm fit.

typ

ANOVA type (1, 2, 3).

digits

Decimal places.

output_format

Output target.

title

Title.

Value

A character string.

Examples

set.seed(1)
df <- data.frame(x = rnorm(30))
df$y <- df$x + rnorm(30)
m <- lm(y ~ x, data = df)
anova_table(m, typ = 1L)
#>           Df Sum Sq Mean Sq F value p-value    
#> x          1 26.884  26.884  41.134  <0.001 ***
#> Residuals 28 18.300   0.654