Learn R Programming

automatedtests (version 0.1.2)

check_parametric: Internal: Check if a numeric vector follows a normal distribution

Description

This function checks whether a numeric vector is approximately normally distributed, using the Shapiro-Wilk test for small samples (n < 5000) and the Anderson-Darling test for larger ones. If the input is not numeric, the function returns NULL.

Usage

check_parametric(data)

Value

A list containing:

test

Name of the test used ("Shapiro-Wilk Test" or "Anderson-Darling Test")

statistic

The test statistic

p_value

The p-value from the test

result

Logical; TRUE if p > 0.05 (assumed normal), FALSE otherwise

Returns NULL if input is not numeric.

Arguments

data

A numeric vector to test for normality.