Learn R Programming

factorH (version 0.5.0)

plan.diagnostics: Plan-level diagnostics for ANOVA/rank-based workflows

Description

Runs all assumption checks in one call: raw normality per subgroup (Shapiro-Wilk), residual normality per cell (from a full-factorial ANOVA on the specified factors), Levene/Brown-Forsythe for the full plan (median by default), and count-balance chi-square tests for all factor combinations. Prints a concise summary and returns all detailed tables in a list.

Usage

plan.diagnostics(formula, data, force_factors = TRUE)

Value

An invisible list with:

  • $summary: overall percent_ok, ok_count, total, overall, plus per-type percentages (percent_ok_normality_raw, percent_ok_residuals_cellwise, percent_ok_balance_chisq, percent_ok_levene_full_plan).

  • $results: data.frames for normality_raw, residuals_cellwise_normality, levene_full_plan, balance_chisq.

Arguments

formula

A model formula of the form y ~ A + B (+ C ...).

data

A data frame containing the variables in the model.

force_factors

Logical; if TRUE, coerces RHS predictors to factors.

Details

Requires helper functions defined in this package: normality.datatable, residuals.cellwise.normality.datatable, levene.plan.datatable, balance.chisq.datatable. Levene's test uses car; if unavailable, the Levene block returns NA rows with a warning.

See Also

normality.datatable, residuals.cellwise.normality.datatable, levene.plan.datatable, balance.chisq.datatable

Examples

Run this code
if (FALSE) {
diag_out <- plan.diagnostics(liking ~ gender + condition + age_cat, data = mimicry)
diag_out$summary
diag_out$results$normality_raw
}

Run the code above in your browser using DataLab