srh.posthoc | R Documentation |
Computes Dunn's rank-based pairwise comparisons for the effect implied by
formula
and returns symmetric matrices for Z, unadjusted p-values,
and adjusted p-values. Cells on one triangle (or both) can be blanked for
compact reporting. For multi-factor RHS, factors are combined into a single
grouping via interaction()
(e.g., "A:B"
cells).
srh.posthoc(
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 |
Number of digits for rounding in the returned matrices
when |
triangular |
Which triangle to show ( |
numeric |
Logical; if |
force_factors |
Logical; coerce grouping variables to |
sep |
Separator used in |
The function subsets to complete cases on y
and RHS factors, optionally
coerces factors, builds a single grouping variable (._grp
) and calls
FSA::dunnTest(y ~ ._grp, data = ..., method = ...)
. The pairwise
results are placed into symmetric matrices Z
, P.unadj
, and
P.adj
. By default only the lower triangle (excluding diagonal) is
shown for compactness.
A list with three data.frame
s:
Z
– Z statistics,
P.unadj
– unadjusted p-values,
P.adj
– adjusted p-values (per method
).
The original call is attached as attribute "call"
.
data(mimicry, package = "factorH")
# One factor
ph1 <- srh.posthoc(liking ~ condition, data = mimicry)
ph1$`P.adj` # gotowa macierz p po korekcji
# Two factors combined (all A:B cells vs all A:B cells)
ph2 <- srh.posthoc(liking ~ gender + condition, data = mimicry)
ph2$`P.adj`
# Upper triangle, numeric frames
ph3 <- srh.posthoc(liking ~ condition, data = mimicry,
triangular = "upper", numeric = TRUE)
ph3$Z
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.