srh.simple.posthocs: Simple-effects post hoc tables for all possible effects...

View source: R/srh.simple.posthocs.R

srh.simple.posthocsR Documentation

Simple-effects post hoc tables for all possible effects (within-scope)

Description

For a formula y ~ A + B (+ C ...), enumerates all simple-effect setups of the form COMPARE(target) | BY(other factors) and runs srh.simple.posthoc with scope = "within" for each. Returns a named list of data frames (one per simple-effect configuration).

Usage

srh.simple.posthocs(formula, data)

Arguments

formula

A formula y ~ A + B (+ C ...) with at least two RHS factors.

data

A data.frame containing the variables in formula.

Details

For each choice of the comparison factor target from the RHS, all non-empty combinations of the remaining factors are treated as conditioning sets BY. For each pair (target, BY) we call srh.simple.posthoc() with compare = target and scope = "within". Effects where the conditioning subset has < 2 levels of target are skipped; messages are collected in attribute "skipped".

Labels use ASCII: "COMPARE(A) | BY(B x C)" (plain " x ").

Value

A named list of data.frames. Each element contains the columns produced by srh.simple.posthoc (e.g., Comparison, Z, P.unadj, P.adj, m.tests, adj.note). Attributes: "call" and (optionally) "skipped" with messages.

Examples

data(mimicry, package = "factorH")

# All simple-effect tables for a 2-factor design
tabs2 <- srh.simple.posthocs(liking ~ gender + condition, data = mimicry)
names(tabs2)
# e.g., tabs2[["COMPARE(gender) | BY(condition)"]]

# Three factors: all COMPARE(target) | BY(conditioning) combinations
tabs3 <- srh.simple.posthocs(liking ~ gender + condition + age_cat, data = mimicry)
names(tabs3)
attr(tabs3, "skipped")  # any skipped combos with reasons


factorH documentation built on Sept. 11, 2025, 9:09 a.m.