normal_test {tidysummary}R Documentation

Perform normality test on a variable

Description

Conducts normality tests for a specified variable, optionally by group. Supports automatic testing and interactive visualization.

Usage

normal_test(data = NULL, var = NULL, group = NULL, norm = "auto")

Arguments

data

A data frame containing the variables to be tested.

var

A character string specifying the numeric variable in data to test.

group

A character string specifying the grouping variable in data. If NULL, treated as one group.

norm

Control parameter for test behavior. Accepts:

  • 'auto': Automatically decide based on p-values, but the same as 'ask' when n > 1000, default

  • 'ask': Show p-values, plots QQ plots and prompts for decision

  • TRUE/'true': Always returns TRUE

  • FALSE/'false': Always returns FALSE

Value

A logical value:

Methodology for p-values

Automatically selects test based on sample size per group:

Examples

normal_test(iris, "Sepal.Length", "Species", norm = "auto")
normal_test(iris, "Sepal.Length", "Species", norm = TRUE)


[Package tidysummary version 0.1.0 Index]