View source: R/nonpar.datatable.R
nonpar.datatable | R Documentation |
Produces descriptive statistics for all main effects and interaction cells
implied by the RHS of formula
. Ranks are computed globally
(across all observations) and cell-wise mean ranks are reported
(recommended for interpreting rank-based factorial effects).
nonpar.datatable(formula, data, force_factors = TRUE)
formula |
A formula of the form |
data |
A |
force_factors |
Logical; coerce grouping variables to |
The function first subsets to complete cases on y
and all RHS factors,
then computes global ranks of y
(ties.method = "average"
).
For each effect (every non-empty combination of factors up to full order),
it returns a row per cell with:
count
, mean
, sd
, median
, quartiles
(q1
, q3
), IQR
, and mean_rank
.
The column Effect
identifies the effect (e.g., "A"
, "B"
,
"A:B"
). Missing factor columns for a given effect are added with
NA
values but retain the proper factor levels for easy binding.
A base data.frame
with columns:
Effect
(character),
factor columns for all RHS factors (factors, possibly NA
in some rows),
count
, mean
, sd
, median
, q1
, q3
, IQR
, mean_rank
.
The original call is attached as attribute "call"
.
data(mimicry, package = "factorH")
# One factor
nonpar.datatable(liking ~ condition, data = mimicry)
# Two factors: rows for gender, for condition, and for gender:condition
nonpar.datatable(liking ~ gender + condition, data = mimicry)
# Three factors: all mains + 2-way and 3-way cells
nonpar.datatable(liking ~ gender + condition + age_cat, data = mimicry)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.