aov_auto: Automatically Compute Parametric or Non-parametric t-test or...

View source: R/aov.R

aov_autoR Documentation

Automatically Compute Parametric or Non-parametric t-test or ANOVA

Description

Automatically perform t-test or ANOVA according to the number of levels of factors. Assumptions were checked prior to choosing parametric or non-parametric methods. All combination of factor and numeric variables in data.frame will be computed.

Usage

aov_auto(
  df,
  type = c("all", "params"),
  na.rm_type = c("cols", "rows"),
  norm_test = c("all", "res"),
  p.adjust.methods = "bonferroni",
  quiet = F
)

Arguments

df

A data.frame that has factor and numeric variables

type

(Character) If type = "params": It will only compute shapiro and levene test

na.rm_type

(Character) Specify how to remove NA values i.e., by rows ("rows") or columns ("cols").

norm_test

(Character)

  • "all": perform normality test on numeric variables: shapiro.test(num_var).

  • "res": perform normality test on residual of linear model: shapiro.test(residual(lm(num_var ~ fct_var))).

p.adjust.methods

(Character) P-value adjustment method pass to p.adjust()

quiet

(logical) Give message about removed variables or not?

Value

A data.frame

Examples

aov_auto(iris)


Lightbridge-KS/lbmod documentation built on Jan. 28, 2024, 6:21 p.m.