factorH: intro

What this package does (and why)

factorH provides a simple, single-call workflow for multifactor nonparametric, rank-based ANOVA and publication-ready outputs:

Why? Popular GUI stats tools do not offer a ready-made, user-friendly multifactor rank-based pipeline that mirrors standard H / SRH analyses in a way that is easy for beginners. factorH aims to fill that gap with clear R-like formula syntax and a one-command report function.

The package is intentionally small: most users will only ever need:

Advanced integrations can additionally use:

Formula syntax at a glance

All high-level functions use standard R model formulas:

response ~ factorA + factorB + factorC

Examples below use the included dataset mimicry.

library(factorH)
data(mimicry, package = "factorH")
str(mimicry)

Predictors should be factors. If they are not, the functions will coerce them to factors internally.

What is allowed?

# One factor (KW-style):
liking ~ condition

# Two factors (SRH-style):
liking ~ gender + condition

# Three or more factors (k-way):
liking ~ gender + condition + age_cat

You do not need to write gender:condition or gender*condition. The package constructs the required interaction terms internally when needed.

Numeric response (Likert note)

The response must be numeric. For Likert-type responses (e.g., 1 = strongly disagree, …, 5 = strongly agree), keep the variable numeric. Rank-based procedures can be used with such ordinal-like data.

If your Likert variable has been imported as a factor or character, coerce it safely:

# if stored as character "1", "2", ...:
mimicry$liking <- as.numeric(mimicry$liking)

# if stored as factor with labels "1", "2", ...:
mimicry$liking <- as.numeric(as.character(mimicry$liking))

Diagnostics at a glance

Most users can cover assumption checks with a single command:

diag_out <- plan.diagnostics(response ~ factorA + factorB (+ factorC ...), data = your_data)

What it does:

  1. Raw normality: Shapiro-Wilk in each subgroup and interaction cell of the specified factors.
  2. Residual normality per cell: Shapiro-Wilk on residuals from the corresponding full-factorial ANOVA, tested within each cell.
  3. Homogeneity of variances: Levene/Brown-Forsythe across full-plan cells (median by default).
  4. Count balance: chi-square homogeneity / independence / log-linear independence across factors.
  5. It prints a concise overall summary (share of OK and overall status) and returns all detailed tables in diag_out$results, with per-type OK percentages in diag_out$summary.

For most workflows, this single command is enough to document design diagnostics alongside rank-based analyses.

The one-call pipeline

The main function srh.kway.full() runs:

  1. an ANOVA-like table on ranks
  2. a descriptive summary
  3. post hoc matrices (Dunn; adjusted P.adj)
  4. simple-effects post hocs

It also supports: - type = 2 vs type = 3 - scope = "within" vs scope = "global" for simple-effects Bonferroni - design diagnostics and warnings stored in res$meta

For 2 factors:

res2 <- srh.kway.full(liking ~ gender + condition, data = mimicry)
names(res2)
res2$anova
head(res2$summary)
names(res2$posthoc_cells)
names(res2$posthoc_simple)

For 2 factors with Type III SS:

res2_t3 <- srh.kway.full(liking ~ gender + condition, data = mimicry, type = 3)
res2_t3$anova

For 3 factors:

res3 <- srh.kway.full(liking ~ gender + condition + age_cat, data = mimicry)
res3$anova

For global simple-effects Bonferroni:

res3g <- srh.kway.full(
  liking ~ gender + condition + age_cat,
  data = mimicry,
  scope = "global"
)
names(res3g$posthoc_simple)

Export full result to a tab-separated file

f <- file.path(tempdir(), "result.tsv")
write.srh.kway.full.tsv(res3, file = f, dec = ".")
file.exists(f)

If you need a decimal comma:

f2 <- file.path(tempdir(), "result_comma.tsv")
write.srh.kway.full.tsv(res3, file = f2, dec = ",")
file.exists(f2)

The TSV contains clearly separated sections:

and can be easily opened in spreadsheet software such as Excel or Google Sheets.

Jamovi/backend helper

If you want to map the full pipeline into a Jamovi module or another structured frontend, use:

jam <- as_jamovi_srh_full(res3)
names(jam)

This helper does not build Jamovi result objects directly. Instead, it normalizes the srh.kway.full() output into a predictable list of sections and items that can be consumed by a backend.

What is in the example dataset?

mimicry is a real study on the chameleon effect (Trzmielewska et al., 2025) about how movement conditions affect liking of an interlocutor. Potential moderators include gender and age (with dichotomized age_cat and a 3-level age_cat2). This makes it a natural playground for multifactor rank-based analyses.

table(mimicry$condition)
table(mimicry$gender)
table(mimicry$age_cat)

What the functions compute (high level)

That is it. For most users, the intro ends here: use srh.kway.full() and export with write.srh.kway.full.tsv().

C:0u34e45b057346-intro.R