Learn R Programming

factorH (version 0.5.0)

levene.plan.datatable: Levene/Brown-Forsythe test for full-plan cells

Description

Tests homogeneity of variances across the highest-order interaction (all RHS factors combined), using Levene's test (Brown-Forsythe with median by default).

Usage

levene.plan.datatable(
  formula,
  data,
  center = c("median", "mean"),
  force_factors = TRUE
)

Value

A one-row data.frame with columns: Effect, n.groups, min.n, df.num, df.den, F, p, OK. Values F and p are formatted to 4 decimals (no scientific notation); OK is "OK" if p >= 0.05, otherwise "NOT OK".

Arguments

formula

A model formula y ~ A + B (+ C ...).

data

A data frame with the variables.

center

Character, "median" (default) for Brown-Forsythe or "mean" for classical Levene.

force_factors

Logical; if TRUE, coerces RHS predictors to factors.

Details

Internally relies on car::leveneTest. If fewer than two groups or any group has < 2 observations, NA values are returned with a warning.

See Also

plan.diagnostics

Examples

Run this code
if (FALSE) {
levene.plan.datatable(liking ~ gender + condition + age_cat, data = mimicry)
levene.plan.datatable(liking ~ gender + condition, data = mimicry, center = "mean")
}

Run the code above in your browser using DataLab