Skip to contents

Uses base R aov, then drop1 for Type-II sums of squares.

Usage

two_way_anova(data, outcome, factor_a, factor_b)

Arguments

data

A data frame.

outcome

Name of dependent-variable column.

factor_a, factor_b

Names of factor columns.

Value

An object of class "morie_test_result".

Examples

set.seed(1)
df <- data.frame(y = rnorm(40), a = rep(c("lo", "hi"), 20),
                 b = rep(c("x", "z"), each = 20))
two_way_anova(df, "y", "a", "b")
#> Two-way ANOVA
#> -------------
#>   statistic = 0.199658
#>   p-value   = 0.657673
#>   effect    = 0.0286736
#>   n         = 40