srh.posthocs | R Documentation |
For a given y ~ A (+ B + ...)
formula, runs srh.posthoc
for every main effect and interaction implied by the RHS (all non-empty
combinations of factors) and returns a named list of adjusted p-value
matrices (P.adj
) for each effect.
srh.posthocs(
formula,
data,
method = "bonferroni",
digits = 3,
triangular = c("lower", "upper", "full"),
numeric = FALSE,
force_factors = TRUE,
sep = "."
)
formula |
A formula of the form |
data |
A |
method |
P-value adjustment method passed to |
digits |
Rounding used inside |
triangular |
Which triangle to show in each matrix
( |
numeric |
Logical; if |
force_factors |
Logical; coerce grouping variables to |
sep |
Separator for combined factor labels when needed (passed through
to |
The function enumerates all non-empty subsets of RHS factors (mains, 2-way,
..., k-way) and calls srh.posthoc
on each corresponding
sub-formula. If a subset has fewer than 2 observed levels (e.g., due to
missing data after subsetting to complete cases), that effect is skipped.
A named list
where each element is a data.frame
of adjusted p-values (P.adj
) for an effect. Names use "A"
,
"B"
, "A:B"
, ..., matching the effect structure.
The original call is attached as attribute "call"
.
data(mimicry, package = "factorH")
# Two-factor design: p.adj for 'gender', 'condition', and 'gender:condition'
L2 <- srh.posthocs(liking ~ gender + condition, data = mimicry)
names(L2)
L2$gender
L2$condition
L2$`gender:condition`
# Three-factor design: includes mains, all 2-ways, and the 3-way effect
L3 <- srh.posthocs(liking ~ gender + condition + age_cat, data = mimicry)
names(L3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.