normalityTest-methods: It creates a 'data.frame' of boolean indicating if the...

normalityTestR Documentation

It creates a data.frame of boolean indicating if the exposures follows a normal distribution or not.

Description

This functions uses shapiro.test to test the normality of the exposures and returns a data.frame with a boolean value and a p-value for each exposure.

Usage

normalityTest(
  object,
  exposure,
  th = 0.05,
  min.val = 5,
  na.rm = TRUE,
  warnings = TRUE
)

Arguments

object

ExposomeSet with the exposome to be tested.

exposure

Name of the exposure to be tested, if missing all the exposures will be tested.

th

(by default 0.05) Threshold to considere an exposure to follow a normal distribution.

min.val

(by default 5) Minimum number of values not missings to test the exposures.

na.rm

(by default TRUE) Removes the NA values to test the normality on the exposure.

warnings

(by default: TRUE) Show warnings if required.

Value

A data.frame with three columns: exposure, normality and p.value. "exposure" column contains the name of each exposure. "normalty" column contains a logical value indicating if the obtained p-value is under the given threshold. "p.value" column contains the obtained p-value from shapiro.test.

See Also

plotHistogram to draw the shape of an exposure, plotMissings to draw a plot with the missing data an ExposomeSet, imputation to impute missing data on the exposures of an ExposomeSet

Examples

data("exposome")
normalityTest(expo)

isglobal-brge/rexposome documentation built on Feb. 4, 2023, 12:35 p.m.