Performs a two-way permutation ANOVA, reporting main effects and interaction.

factorial_permutation_anova(
  df,
  factor1,
  factor2,
  vals,
  n = 1000,
  seed = 123,
  ci = 0.95
)

Arguments

df

Data frame or tibble.

factor1

First factor.

factor2

Second factor.

vals

Numeric response variable.

n

Number of permutations.

seed

Random seed.

ci

Confidence level for null distribution (default 0.95).

Value

A tibble with:

factor

Factor or interaction term.

observed_statistic

Observed F-statistic.

p_value

Permutation p-value.

ci_low

Lower bound of confidence interval.

ci_high

Upper bound of confidence interval.